@kortix/ui 0.16.3 → 0.16.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_vendor/kortix-shared.js +1 -4
- package/dist/customize/sections/view/review-center-connected.js +64 -71
- package/dist/customize/sections/view/secret-delivery.d.ts +11 -20
- package/dist/customize/sections/view/secret-delivery.js +20 -29
- package/dist/customize/sections/view/secrets-view.js +9 -24
- package/dist/customize/settings/rail-copy-context.d.ts +2 -0
- package/dist/customize/settings/rail-copy-context.js +2 -0
- package/dist/customize/settings/tabs/chrome-connections-tab.js +1 -1
- package/dist/files/renderers/show-content-renderer.js +3 -1
- package/dist/i18n/en.d.ts +130 -22
- package/dist/i18n/en.js +142 -34
- package/dist/i18n/ui-catalog/product-catalog-translation-keys.generated.js +2 -0
- package/dist/internal/auth/auth-card-shell.d.ts +24 -3
- package/dist/internal/auth/auth-card-shell.js +15 -8
- package/dist/internal/auth/auth-primitives.d.ts +15 -2
- package/dist/internal/auth/auth-primitives.js +22 -5
- package/dist/internal/chrome/chrome-connect.d.ts +3 -5
- package/dist/internal/chrome/chrome-connect.js +7 -10
- package/dist/internal/chrome/extension.d.ts +1 -8
- package/dist/internal/chrome/extension.js +1 -8
- package/dist/internal/chrome/use-chrome-offered.d.ts +6 -12
- package/dist/internal/chrome/use-chrome-offered.js +13 -15
- package/dist/internal/components/agent-mark.d.ts +2 -1
- package/dist/internal/components/agent-mark.js +14 -3
- package/dist/internal/hooks/use-review-session-summary.d.ts +1 -1
- package/dist/internal/hooks/use-review-session-summary.js +1 -1
- package/dist/internal/layout/project-nav-row.d.ts +3 -1
- package/dist/internal/layout/project-nav-row.js +2 -2
- package/dist/internal/layout/project-page-header.js +5 -4
- package/dist/internal/stores/user-preferences-store.d.ts +17 -0
- package/dist/internal/stores/user-preferences-store.js +5 -0
- package/dist/markdown/setup-links/secret-intake-form.d.ts +4 -1
- package/dist/markdown/setup-links/secret-intake-form.js +60 -16
- package/dist/markdown/setup-links/setup-link-button.js +6 -1
- package/dist/primitives/color-picker.d.ts +19 -0
- package/dist/primitives/color-picker.js +27 -0
- package/dist/primitives/faded-scroll-area.js +4 -0
- package/dist/primitives/glyph-picker.d.ts +11 -0
- package/dist/primitives/glyph-picker.js +10 -6
- package/dist/primitives/gradient-wallpaper-gl.d.ts +61 -0
- package/dist/primitives/gradient-wallpaper-gl.js +446 -0
- package/dist/primitives/gradient-wallpaper.d.ts +20 -0
- package/dist/primitives/gradient-wallpaper.js +242 -0
- package/dist/primitives/resizable.d.ts +1 -1
- package/dist/session/agents/agent-hover-card.d.ts +26 -0
- package/dist/session/agents/agent-hover-card.js +70 -0
- package/dist/session/agents/agent-strip.js +33 -7
- package/dist/session/agents/agent-surface.d.ts +26 -1
- package/dist/session/agents/agent-surface.js +57 -6
- package/dist/session/agents/held-messages.js +2 -2
- package/dist/session/agents/subagent-dialog-content.js +2 -2
- package/dist/session/composer/ComposerCard.js +4 -4
- package/dist/session/composer/composer-toolbar.d.ts +8 -1
- package/dist/session/composer/composer-toolbar.js +2 -2
- package/dist/session/composer/dictation/dictation-control.d.ts +10 -0
- package/dist/session/composer/dictation/dictation-control.js +28 -0
- package/dist/session/composer/dictation/dictation-state.d.ts +26 -0
- package/dist/session/composer/dictation/dictation-state.js +71 -0
- package/dist/session/composer/dictation/recorder.d.ts +30 -0
- package/dist/session/composer/dictation/recorder.js +129 -0
- package/dist/session/composer/dictation/use-composer-dictation.d.ts +25 -0
- package/dist/session/composer/dictation/use-composer-dictation.js +218 -0
- package/dist/session/composer/queued-prompt-list.js +5 -1
- package/dist/session/panel/easy/apps-card.js +3 -10
- package/dist/session/panel/easy/background-tasks-card.d.ts +23 -0
- package/dist/session/panel/easy/background-tasks-card.js +119 -0
- package/dist/session/panel/easy/change-requests-card.js +1 -1
- package/dist/session/panel/easy/changes-card.js +4 -6
- package/dist/session/panel/easy/context-card.js +8 -9
- package/dist/session/panel/easy/context-meter.d.ts +2 -0
- package/dist/session/panel/easy/context-meter.js +18 -4
- package/dist/session/panel/easy/detail-view.js +7 -4
- package/dist/session/panel/easy/easy-panel-logic.d.ts +4 -15
- package/dist/session/panel/easy/easy-panel-logic.js +4 -17
- package/dist/session/panel/easy/easy-panel.js +5 -4
- package/dist/session/panel/easy/outputs-card.d.ts +1 -13
- package/dist/session/panel/easy/outputs-card.js +14 -40
- package/dist/session/panel/easy/panel-card.d.ts +13 -40
- package/dist/session/panel/easy/panel-card.js +17 -55
- package/dist/session/panel/easy/plan-card.js +4 -7
- package/dist/session/panel/model-switch-event.d.ts +2 -2
- package/dist/session/panel/model-switch-event.js +13 -9
- package/dist/session/panel/session-panel-provider.d.ts +2 -1
- package/dist/session/panel/session-panel-provider.js +3 -3
- package/dist/session/panel/shared/collect-tool-parts.js +2 -2
- package/dist/session/panel/shared/derive-panels.js +14 -1
- package/dist/session/panel/shared/use-panel-handoffs.d.ts +0 -1
- package/dist/session/panel/shared/use-panel-handoffs.js +26 -17
- package/dist/session/thread/chat-minimap.js +7 -1
- package/dist/session/thread/session-body.js +1 -1
- package/dist/session/thread/session-chat.js +59 -15
- package/dist/session/tool/shared/infrastructure-contexts.d.ts +7 -0
- package/dist/session/tool/shared/infrastructure-contexts.js +9 -0
- package/dist/session/tool/shared/infrastructure-row-header.js +4 -1
- package/dist/session/tool/shared/infrastructure-rows.js +19 -19
- package/dist/session/tool/show-group-renderer.d.ts +5 -5
- package/dist/session/tool/show-group-renderer.js +7 -4
- package/dist/session/tool/tool-part-renderer.js +25 -9
- package/dist/session/tool/tool-renderers.d.ts +1 -1
- package/dist/session/tool/tool-renderers.js +1 -1
- package/dist/session/tool/tools/bash-tool.js +3 -2
- package/dist/session/tool/tools/codemode-tool.d.ts +15 -0
- package/dist/session/tool/tools/codemode-tool.js +54 -2
- package/dist/session/tool/tools/kortix-action-tool.d.ts +1 -0
- package/dist/session/tool/tools/kortix-action-tool.js +19 -8
- package/dist/session/tool/tools/multi-agent-tool-bodies.d.ts +8 -1
- package/dist/session/tool/tools/multi-agent-tool-bodies.js +76 -10
- package/dist/session/tool/tools/task-tool.js +17 -5
- package/dist/session/turn/peer-message-row.d.ts +3 -0
- package/dist/session/turn/peer-message-row.js +8 -2
- package/dist/session/turn/subagent-notice-row.js +5 -3
- package/dist/styles.css +1 -1
- package/dist/test-utils/intl.d.ts +130 -22
- package/dist/theme/index.d.ts +2 -1
- package/dist/theme/index.js +2 -1
- package/dist/theme/wallpaper-gradients.d.ts +106 -0
- package/dist/theme/wallpaper-gradients.js +347 -0
- package/dist/theme/wallpapers.d.ts +23 -3
- package/dist/theme/wallpapers.js +53 -29
- package/dist/workspace/admin/project-admin-dashboard.js +1 -1
- package/dist/workspace/layout/project-home.js +1 -1
- package/dist/workspace/new/use-create-workspace.d.ts +5 -3
- package/dist/workspace/new/use-create-workspace.js +1 -1
- package/dist/workspace/projects/modal/project-icon-field.d.ts +3 -1
- package/dist/workspace/projects/modal/project-icon-field.js +3 -3
- package/dist/workspace/review/review-center.d.ts +9 -1
- package/dist/workspace/review/review-center.js +107 -14
- package/dist/workspace/review/review-detail.d.ts +19 -0
- package/dist/workspace/review/review-detail.js +18 -3
- package/dist/workspace/review/review-swipe-deck.d.ts +27 -0
- package/dist/workspace/review/review-swipe-deck.js +304 -0
- package/dist/workspace/review/review-swipe.d.ts +17 -0
- package/dist/workspace/review/review-swipe.js +10 -0
- package/dist/workspace/session-spaces/space-picker.js +3 -3
- package/dist/workspace/setup/setup-banner-snooze.d.ts +10 -0
- package/dist/workspace/setup/setup-banner-snooze.js +44 -0
- package/dist/workspace/setup/setup-banner.js +19 -36
- package/dist/workspace/setup/setup-steps.d.ts +0 -5
- package/dist/workspace/setup/setup-steps.js +0 -7
- package/dist/workspace/setup/workspace-setup-modal.d.ts +39 -0
- package/dist/workspace/setup/workspace-setup-modal.js +202 -0
- package/dist/workspace/sidebar/footer/project-review-nav.d.ts +13 -0
- package/dist/workspace/sidebar/footer/project-review-nav.js +29 -0
- package/dist/workspace/sidebar/project-nav-items.d.ts +3 -1
- package/dist/workspace/sidebar/project-nav-items.js +24 -5
- package/dist/workspace/sidebar/project-session-list.js +2 -1
- package/dist/workspace/sidebar/project-sidebar.js +6 -5
- package/dist/workspace/sidebar/project-spaces-nav.js +3 -10
- package/dist/workspace/sidebar/sidebar-more-group.js +1 -1
- package/package.json +14 -10
- package/skills/kortix-ui/SKILL.md +1 -1
- package/skills/kortix-ui/references/modules.md +3 -1
- package/dist/primitives/toast-clearance.d.ts +0 -36
- package/dist/primitives/toast-clearance.js +0 -94
- package/dist/workspace/setup/workspace-setup-page.d.ts +0 -10
- package/dist/workspace/setup/workspace-setup-page.js +0 -91
|
@@ -29,7 +29,7 @@ import { CaretLeftIcon as ChevronLeft, CaretRightIcon as ChevronRight, } from '@
|
|
|
29
29
|
import { AnimatePresence, m } from 'motion/react';
|
|
30
30
|
import { useReducedMotion } from '../../../internal/hooks/use-reduced-motion.js';
|
|
31
31
|
import { useEffect, useRef, useState, } from 'react';
|
|
32
|
-
import { ToolPartRenderer, ToolSurfaceContext } from '../../tool/tool-renderers.js';
|
|
32
|
+
import { isUnpresentedFailure, ToolPartRenderer, ToolSurfaceContext } from '../../tool/tool-renderers.js';
|
|
33
33
|
import { PanelWidthButton } from '../../../files/viewer/viewer-actions.js';
|
|
34
34
|
import { DOCKED_LAYER_CLASS, SESSION_BAR_CLASS } from '../../../internal/layout/panel-chrome.js';
|
|
35
35
|
import { CloseButton, DetailSidebarToggle } from '../../../files/viewer/viewer-chrome.js';
|
|
@@ -376,7 +376,8 @@ export function collapseSnapshots(calls) {
|
|
|
376
376
|
/** The real tool views for a set of calls — the escape hatch's payload. */
|
|
377
377
|
export function ToolParts({ calls, sessionId, summary, }) {
|
|
378
378
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
379
|
-
|
|
379
|
+
// A failed `show` presented nothing: no row, no failure banner, no full-height slot.
|
|
380
|
+
const visible = collapseSnapshots(calls).filter((call) => !isUnpresentedFailure(call));
|
|
380
381
|
// A step's own icon already went red for this (StepIcon, ContextCard) — but
|
|
381
382
|
// that glance lives on the panel's home, one screen back. Once the user has
|
|
382
383
|
// actually opened the failed step, the detail must say so too, not just show
|
|
@@ -386,7 +387,9 @@ export function ToolParts({ calls, sessionId, summary, }) {
|
|
|
386
387
|
// (`fillsPanel`), and that height only resolves if this column has one too.
|
|
387
388
|
// Without it the preview's iframe fell back to the browser's 150px default.
|
|
388
389
|
const fillsPanel = visible.length === 1 && (visible[0].name === 'show' || visible[0].name === 'show-user');
|
|
389
|
-
return (_jsx(ToolSurfaceContext.Provider, { value: "panel", children: _jsxs("div", { className: cn(
|
|
390
|
+
return (_jsx(ToolSurfaceContext.Provider, { value: "panel", children: _jsxs("div", { className: cn(
|
|
391
|
+
// One list: the rows' own hairlines space them.
|
|
392
|
+
'flex min-w-0 flex-col', fillsPanel && 'h-full',
|
|
390
393
|
// Tool views cap their own scroll height for the inline chat, where
|
|
391
394
|
// they're one item among many. Here the detail IS the tool — a web
|
|
392
395
|
// search that shows 5 of its 20 results behind an inner scrollbar is
|
|
@@ -395,5 +398,5 @@ export function ToolParts({ calls, sessionId, summary, }) {
|
|
|
395
398
|
// Height only, not overflow: overflow-visible kills the x-axis
|
|
396
399
|
// scrollbar ToolCodeCard needs for long mono lines, clipping
|
|
397
400
|
// memory/read/edit/write output at the card frame.
|
|
398
|
-
'[&_[data-scrollable]]:max-h-none'), children: [summary && _jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: summary }), failed && (_jsx("div", { className: "
|
|
401
|
+
'[&_[data-scrollable]]:max-h-none'), children: [summary && _jsx("p", { className: "text-muted-foreground px-2 pb-2 text-sm text-pretty", children: summary }), failed && (_jsx("div", { className: "bg-kortix-red/15 text-foreground mb-2 rounded-md px-3 py-2 text-sm", children: tI18nComplete.raw('text4e1c9bd64a7d') })), _jsx("div", { className: "flex flex-col gap-2", children: visible.map((call) => (_jsx(ToolPartRenderer, { call: call, sessionId: sessionId, defaultOpen: visible.length === 1 }, call.call_id))) })] }) }));
|
|
399
402
|
}
|
|
@@ -105,17 +105,6 @@ export declare function neighborOutputs(items: OutputItem[], currentKey: string)
|
|
|
105
105
|
next: OutputItem | null;
|
|
106
106
|
position: string;
|
|
107
107
|
};
|
|
108
|
-
/**
|
|
109
|
-
* Whether the Outputs card should flip open on this render — the "payoff"
|
|
110
|
-
* moment: a run just finished (`wasRunning` true, `isRunning` now false) and
|
|
111
|
-
* left something behind. Must be false on every other render, including:
|
|
112
|
-
* - every render while still running (no transition yet)
|
|
113
|
-
* - every render once idle and already settled (no transition this tick)
|
|
114
|
-
* - a run finishing with nothing to show (nothing to pay off)
|
|
115
|
-
* so the card only auto-opens exactly once, at the transition, never on
|
|
116
|
-
* every subsequent re-render of an already-finished run.
|
|
117
|
-
*/
|
|
118
|
-
export declare function shouldAutoExpandOutputs(wasRunning: boolean, isRunning: boolean, outputCount: number): boolean;
|
|
119
108
|
/**
|
|
120
109
|
* Whether the run should read as "still going", combining two signals:
|
|
121
110
|
*
|
|
@@ -129,8 +118,8 @@ export declare function shouldAutoExpandOutputs(wasRunning: boolean, isRunning:
|
|
|
129
118
|
* for the whole turn regardless of gaps between tool calls.
|
|
130
119
|
*
|
|
131
120
|
* ORing them closes the gap: the run reads as running for its entire actual
|
|
132
|
-
* duration, so
|
|
133
|
-
*
|
|
121
|
+
* duration, so the payoff only fires at the real finish (not at the first
|
|
122
|
+
* inter-tool pause), and the Progress card's shimmer/subtitle
|
|
134
123
|
* stop flickering at every tool boundary.
|
|
135
124
|
*/
|
|
136
125
|
export declare function deriveIsRunning(stepsRunning: boolean, sessionBusy: boolean): boolean;
|
|
@@ -165,8 +154,8 @@ export interface OutputKindGroup {
|
|
|
165
154
|
export declare function groupOutputsByKind(outputs: OutputItem[]): OutputKindGroup[] | null;
|
|
166
155
|
/**
|
|
167
156
|
* Whether the panel should present the primary deliverable on this render —
|
|
168
|
-
* the payoff screen (W2).
|
|
169
|
-
*
|
|
157
|
+
* the payoff screen (W2). It fires once, on the running -> idle transition,
|
|
158
|
+
* with four refusals: a failed or stopped
|
|
170
159
|
* run presents its outcome, not a payoff; an open detail is never replaced;
|
|
171
160
|
* a user who opened any detail during the run has shown they're driving —
|
|
172
161
|
* auto-opening would fight them; and the panel must actually be open — desktop
|
|
@@ -135,19 +135,6 @@ export function neighborOutputs(items, currentKey) {
|
|
|
135
135
|
position: `${index + 1} of ${items.length}`,
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
-
/**
|
|
139
|
-
* Whether the Outputs card should flip open on this render — the "payoff"
|
|
140
|
-
* moment: a run just finished (`wasRunning` true, `isRunning` now false) and
|
|
141
|
-
* left something behind. Must be false on every other render, including:
|
|
142
|
-
* - every render while still running (no transition yet)
|
|
143
|
-
* - every render once idle and already settled (no transition this tick)
|
|
144
|
-
* - a run finishing with nothing to show (nothing to pay off)
|
|
145
|
-
* so the card only auto-opens exactly once, at the transition, never on
|
|
146
|
-
* every subsequent re-render of an already-finished run.
|
|
147
|
-
*/
|
|
148
|
-
export function shouldAutoExpandOutputs(wasRunning, isRunning, outputCount) {
|
|
149
|
-
return wasRunning && !isRunning && outputCount > 0;
|
|
150
|
-
}
|
|
151
138
|
/**
|
|
152
139
|
* Whether the run should read as "still going", combining two signals:
|
|
153
140
|
*
|
|
@@ -161,8 +148,8 @@ export function shouldAutoExpandOutputs(wasRunning, isRunning, outputCount) {
|
|
|
161
148
|
* for the whole turn regardless of gaps between tool calls.
|
|
162
149
|
*
|
|
163
150
|
* ORing them closes the gap: the run reads as running for its entire actual
|
|
164
|
-
* duration, so
|
|
165
|
-
*
|
|
151
|
+
* duration, so the payoff only fires at the real finish (not at the first
|
|
152
|
+
* inter-tool pause), and the Progress card's shimmer/subtitle
|
|
166
153
|
* stop flickering at every tool boundary.
|
|
167
154
|
*/
|
|
168
155
|
export function deriveIsRunning(stepsRunning, sessionBusy) {
|
|
@@ -226,8 +213,8 @@ export function groupOutputsByKind(outputs) {
|
|
|
226
213
|
}
|
|
227
214
|
/**
|
|
228
215
|
* Whether the panel should present the primary deliverable on this render —
|
|
229
|
-
* the payoff screen (W2).
|
|
230
|
-
*
|
|
216
|
+
* the payoff screen (W2). It fires once, on the running -> idle transition,
|
|
217
|
+
* with four refusals: a failed or stopped
|
|
231
218
|
* run presents its outcome, not a payoff; an open detail is never replaced;
|
|
232
219
|
* a user who opened any detail during the run has shown they're driving —
|
|
233
220
|
* auto-opening would fight them; and the panel must actually be open — desktop
|
|
@@ -5,8 +5,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
* (Outputs / Context / Preview / Plan) over the same tool-call data the
|
|
6
6
|
* Advanced stepper renders one-at-a-time.
|
|
7
7
|
*
|
|
8
|
-
* It is the docked cards column's whole content: flat sections,
|
|
9
|
-
*
|
|
8
|
+
* It is the docked cards column's whole content: flat sections, an inset
|
|
9
|
+
* hairline between each, no header, no tab strip, no wrapper. The column draws the
|
|
10
10
|
* vertical rule beside the chat (`session-action-panel-column.tsx`).
|
|
11
11
|
*
|
|
12
12
|
* It owns no state — everything it reads (the derived outputs, the context
|
|
@@ -31,6 +31,7 @@ import { useOptionalSessionPanel } from '../session-panel-provider.js';
|
|
|
31
31
|
import { useSessionChangeRequestsPanel } from '../../outcomes/session-outcomes-bridge.js';
|
|
32
32
|
import { ChangeRequestsCard } from './change-requests-card.js';
|
|
33
33
|
import { AppsCard } from './apps-card.js';
|
|
34
|
+
import { BackgroundTasksCard } from './background-tasks-card.js';
|
|
34
35
|
import { ChangesCard } from './changes-card.js';
|
|
35
36
|
import { ContextCard } from './context-card.js';
|
|
36
37
|
import { useSessionContextUsage } from './context-meter.js';
|
|
@@ -52,7 +53,7 @@ export function EasyPanel() {
|
|
|
52
53
|
// read-only inside `legacy-subagent-chat.tsx`, which has no panel at all.
|
|
53
54
|
if (!panel)
|
|
54
55
|
return null;
|
|
55
|
-
const { files, context, apps,
|
|
56
|
+
const { files, context, apps, isSessionBusy, sessionId, handleOpenOutput, openDetail } = panel;
|
|
56
57
|
return (
|
|
57
58
|
// A fill-and-scroll column, not a scrolling stack.
|
|
58
59
|
//
|
|
@@ -67,5 +68,5 @@ export function EasyPanel() {
|
|
|
67
68
|
// Preview keep `shrink-0` and stay on screen at their full height, always.
|
|
68
69
|
// `min-h-0` is what lets this shrink at all — a flex container defaults to
|
|
69
70
|
// its content's minimum height and would otherwise refuse.
|
|
70
|
-
_jsxs("div", { className: "flex h-full min-h-0 flex-col", children: [_jsx(OutputsCard, { fill: !changeRequests?.requests.length, outputs: files,
|
|
71
|
+
_jsxs("div", { className: "flex h-full min-h-0 flex-col pb-2", children: [_jsx(OutputsCard, { fill: !changeRequests?.requests.length, outputs: files, onOpenOutput: (o) => handleOpenOutput(o, files) }), _jsx(ChangesCard, { onOpenDetail: openDetail, onOpenAll: () => panel.openFiles(true) }), _jsx(ContextCard, { usage: contextUsage, files: context.files, web: context.web, tools: context.tools, sessionId: sessionId, onOpenDetail: openDetail, onOpenFile: (path, allPaths) => handleOpenOutput(pathOutput(path), allPaths.map(pathOutput)), onAddContext: () => useSessionComposerPrefillStore.getState().requestAttach(sessionId) }), apps.length > 0 && _jsx(AppsCard, { apps: apps, onOpenApp: (a) => handleOpenOutput(a, apps) }), _jsx(BackgroundTasksCard, { projectId: panel.projectId, sessionId: panel.projectSessionId, live: isSessionBusy, onOpenDetail: openDetail }), !planInChat && _jsx(PlanPanelCard, { sessionId: sessionId }), changeRequests && _jsx(ChangeRequestsCard, { ...changeRequests })] }));
|
|
71
72
|
}
|
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
import type { OutputItem } from '../shared/derive-panels.js';
|
|
2
|
-
/** The chalk key: a file's extension, else its kind. */
|
|
3
|
-
export declare function chalkLabel(output: {
|
|
4
|
-
kind: string;
|
|
5
|
-
name: string;
|
|
6
|
-
}): string;
|
|
7
|
-
/** A 24px chalk tile, fill only (no border); the glyph takes the chalk ink, whatever its own color class. */
|
|
8
|
-
export declare function ChalkTile({ label, children }: {
|
|
9
|
-
label: string;
|
|
10
|
-
children: React.ReactNode;
|
|
11
|
-
}): import("react").JSX.Element;
|
|
12
2
|
export declare function OutputRows({ outputs, onOpenOutput, initialShowAll, }: {
|
|
13
3
|
outputs: OutputItem[];
|
|
14
4
|
/** Only called for outputs that are actually openable — see `isOpenable`. */
|
|
@@ -24,10 +14,8 @@ export declare function OutputRows({ outputs, onOpenOutput, initialShowAll, }: {
|
|
|
24
14
|
*/
|
|
25
15
|
initialShowAll?: boolean;
|
|
26
16
|
}): import("react").JSX.Element;
|
|
27
|
-
export declare function OutputsCard({ outputs,
|
|
17
|
+
export declare function OutputsCard({ outputs, onOpenOutput, fill, }: {
|
|
28
18
|
outputs: OutputItem[];
|
|
29
19
|
fill?: boolean;
|
|
30
|
-
/** Auto-expands when a run finishes with something to show — the payoff moment. */
|
|
31
|
-
defaultExpanded: boolean;
|
|
32
20
|
onOpenOutput: (output: OutputItem) => void;
|
|
33
21
|
}): import("react").JSX.Element;
|
|
@@ -23,11 +23,10 @@ import { ObjectUrlCache } from '../../../internal/lib/object-url-cache.js';
|
|
|
23
23
|
import { track } from '../../../lib/telemetry.js';
|
|
24
24
|
import { cn } from '../../../lib/utils.js';
|
|
25
25
|
import { AppWindowIcon as AppWindow, CaretDownIcon as ChevronDown, FileTextIcon as FileText, ImageIcon, PresentationIcon, VideoIcon, } from '@phosphor-icons/react';
|
|
26
|
-
import { chalkColors } from '../../../_vendor/kortix-shared.js';
|
|
27
26
|
import { useEffect, useState } from 'react';
|
|
28
27
|
import { deliverableKindLabel, isScaffoldingOutput } from '../shared/output-priority.js';
|
|
29
28
|
import { groupOutputsByKind, outputKey } from './easy-panel-logic.js';
|
|
30
|
-
import { PanelCard } from './panel-card.js';
|
|
29
|
+
import { PANEL_ROW, PANEL_ROW_ICON, PanelCard } from './panel-card.js';
|
|
31
30
|
import { Download } from '../../../internal/icons/download.js';
|
|
32
31
|
const KIND_ICON = {
|
|
33
32
|
file: FileText,
|
|
@@ -81,41 +80,25 @@ function ImageThumb({ path, callID, name }) {
|
|
|
81
80
|
// `size-4`, like every other leading glyph in this list — the fallback
|
|
82
81
|
// stands where the thumbnail will, so it must not be a smaller mark.
|
|
83
82
|
const Ico = KIND_ICON.image;
|
|
84
|
-
return _jsx(Ico, {
|
|
83
|
+
return _jsx(Ico, {});
|
|
85
84
|
}
|
|
86
85
|
return (
|
|
87
86
|
// eslint-disable-next-line @next/next/no-img-element
|
|
88
|
-
_jsx("img", { src: src, alt: name, className: "size-
|
|
87
|
+
_jsx("img", { src: src, alt: name, className: "outline-foreground/10 size-5 rounded-xs object-cover outline outline-1 -outline-offset-1" }));
|
|
89
88
|
}
|
|
90
89
|
/**
|
|
91
|
-
* A file gets its real per-extension glyph
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* so they keep their kind icon — except an image with a path, which gets a real
|
|
95
|
-
* thumbnail (W13): the icon says "picture," the thumb shows which one.
|
|
90
|
+
* A file gets its real per-extension glyph, the same one the files explorer
|
|
91
|
+
* uses, in meta ink. An image with a path shows its real pixels instead: the
|
|
92
|
+
* glyph says "picture", the thumbnail shows which one.
|
|
96
93
|
*/
|
|
97
94
|
function OutputIcon({ output }) {
|
|
98
|
-
const tile = 'flex size-6 shrink-0 items-center justify-center rounded-sm';
|
|
99
95
|
if (output.kind === 'image' && output.path) {
|
|
100
|
-
return
|
|
96
|
+
return _jsx(ImageThumb, { path: output.path, callID: output.callID, name: output.name });
|
|
101
97
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
// of eight outputs reads by color before a single name is read.
|
|
98
|
+
if (output.kind === 'file')
|
|
99
|
+
return getFileIcon(output.name, { variant: 'monochrome' });
|
|
105
100
|
const Ico = KIND_ICON[output.kind];
|
|
106
|
-
return
|
|
107
|
-
}
|
|
108
|
-
/** The chalk key: a file's extension, else its kind. */
|
|
109
|
-
export function chalkLabel(output) {
|
|
110
|
-
if (output.kind === 'file' && output.name.includes('.')) {
|
|
111
|
-
return output.name.slice(output.name.lastIndexOf('.') + 1).toUpperCase();
|
|
112
|
-
}
|
|
113
|
-
return output.kind.toUpperCase();
|
|
114
|
-
}
|
|
115
|
-
/** A 24px chalk tile, fill only (no border); the glyph takes the chalk ink, whatever its own color class. */
|
|
116
|
-
export function ChalkTile({ label, children }) {
|
|
117
|
-
const chalk = chalkColors(label);
|
|
118
|
-
return (_jsx("span", { className: "flex size-6 shrink-0 items-center justify-center rounded-sm [&_svg]:text-current!", style: { backgroundColor: chalk.background, color: chalk.foreground }, "aria-hidden": true, children: children }));
|
|
101
|
+
return _jsx(Ico, {});
|
|
119
102
|
}
|
|
120
103
|
/** An output leads somewhere only if there's something to open: a file has a
|
|
121
104
|
* path, a running app has a URL. Media the agent generated may have neither. */
|
|
@@ -140,11 +123,7 @@ const VISIBLE_LIMIT = 8;
|
|
|
140
123
|
* apart. */
|
|
141
124
|
function OutputRow({ output, onOpenOutput, }) {
|
|
142
125
|
const t = useTranslations('sessionUi.panel');
|
|
143
|
-
return (_jsx("li", { className: "flex
|
|
144
|
-
// Compact (~34px): a run can make dozens of outputs, and the chalk
|
|
145
|
-
// tile carries the type, so a row is the tile, the name and at most
|
|
146
|
-
// one state word. The kind label repeated what the tile already says.
|
|
147
|
-
title: `${output.title ?? output.name} · ${deliverableKindLabel(output)}`, className: "hover:bg-accent flex w-full items-center gap-2.5 px-4 py-1.5 text-left transition-[background-color,transform] active:scale-[0.998] disabled:cursor-default", children: [_jsx(OutputIcon, { output: output }), _jsx("span", { className: "text-foreground min-w-0 flex-1 truncate text-sm", children: output.title ?? output.name }), output.fresh === 'new' && (_jsx("span", { className: "text-kortix-green shrink-0 text-xs font-medium", children: t('outputNew') })), output.fresh === 'updated' && (_jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: t('outputUpdated') }))] }) }));
|
|
126
|
+
return (_jsx("li", { className: "flex", children: _jsxs("button", { type: "button", disabled: !isOpenable(output), onClick: () => isOpenable(output) && onOpenOutput(output), title: `${output.title ?? output.name} · ${deliverableKindLabel(output)}`, className: PANEL_ROW, children: [_jsx("span", { className: PANEL_ROW_ICON, children: _jsx(OutputIcon, { output: output }) }), _jsx("span", { className: "text-foreground min-w-0 flex-1 truncate", children: output.title ?? output.name }), output.fresh === 'new' && (_jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: t('outputNew') })), output.fresh === 'updated' && (_jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: t('outputUpdated') }))] }) }));
|
|
148
127
|
}
|
|
149
128
|
export function OutputRows({ outputs, onOpenOutput, initialShowAll, }) {
|
|
150
129
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
@@ -162,12 +141,7 @@ export function OutputRows({ outputs, onOpenOutput, initialShowAll, }) {
|
|
|
162
141
|
// `groupOutputsByKind`'s own doc comment) — the collapsed, pre-fold slice
|
|
163
142
|
// stays a flat list, so this is `null` whenever `showAll` is false.
|
|
164
143
|
const groups = showAll ? groupOutputsByKind(visible) : null;
|
|
165
|
-
return (_jsxs(FadedScrollArea, { fadeColor: "from-pane", rootClassName: "h-auto min-h-0 flex-1", className: "overscroll-contain", children: [groups ? (_jsx("div", { className: "flex flex-col gap-0", children: groups.map((group, i) => (_jsxs("div", { children: [_jsx("p", { className: cn('text-muted-foreground px-
|
|
166
|
-
// Same rhythm and press feedback as the rows above it. `color` rides
|
|
167
|
-
// along in the transition list because this row also lightens its
|
|
168
|
-
// label on hover — `transition-colors` would have swept in
|
|
169
|
-
// border-color and fill with it.
|
|
170
|
-
className: "text-muted-foreground hover:text-foreground hover:bg-accent mt-0.5 flex w-full cursor-pointer items-center gap-2.5 px-4 py-1.5 text-left text-sm transition-[background-color,color,transform] active:scale-[0.998]", children: [_jsx("span", { className: "flex size-6 shrink-0 items-center justify-center", children: _jsx(ChevronDown, { className: "size-3.5" }) }), _jsxs("span", { className: "truncate tabular-nums", children: [hidden, " ", tI18nComplete.raw('text187897ce0afc'), " ", hiddenNoun] })] }))] }));
|
|
144
|
+
return (_jsxs(FadedScrollArea, { fadeColor: "from-pane", rootClassName: "h-auto min-h-0 flex-1", className: "overscroll-contain", children: [groups ? (_jsx("div", { className: "flex flex-col gap-0", children: groups.map((group, i) => (_jsxs("div", { children: [_jsx("p", { className: cn('text-muted-foreground px-3 pb-1 text-xs', i > 0 && 'pt-3'), children: group.label }), _jsx("ul", { className: "flex flex-col gap-0", children: group.items.map((o) => (_jsx(OutputRow, { output: o, onOpenOutput: onOpenOutput }, outputKey(o)))) })] }, group.kind))) })) : (_jsx("ul", { className: "flex flex-col gap-0", children: visible.map((o) => (_jsx(OutputRow, { output: o, onOpenOutput: onOpenOutput }, outputKey(o)))) })), hidden > 0 && !showAll && (_jsx("div", { className: "flex", children: _jsxs("button", { type: "button", onClick: () => setShowAll(true), className: cn(PANEL_ROW, 'text-muted-foreground hover:text-foreground cursor-pointer'), children: [_jsx("span", { className: PANEL_ROW_ICON, children: _jsx(ChevronDown, { className: "size-3.5!" }) }), _jsxs("span", { className: "truncate tabular-nums", children: [hidden, " ", tI18nComplete.raw('text187897ce0afc'), " ", hiddenNoun] })] }) }))] }));
|
|
171
145
|
}
|
|
172
146
|
/**
|
|
173
147
|
* The card header's "download all" affordance (W15). Only worth offering once
|
|
@@ -202,7 +176,7 @@ function DownloadAllAction({ outputs }) {
|
|
|
202
176
|
};
|
|
203
177
|
return (_jsx(Hint, { label: tI18nComplete.raw('textf7917eced9c2'), side: "bottom", children: _jsx(Button, { variant: "ghost", size: "icon", onClick: () => void handleDownload(), disabled: busy, "aria-label": tI18nComplete.raw('textf7917eced9c2'), "aria-busy": busy, className: "size-7 active:scale-[0.96] disabled:opacity-100", children: busy ? (_jsx(Loading, { className: "text-muted-foreground size-3.5 motion-reduce:animate-none" })) : (_jsx(Download, { className: "size-3.5" })) }) }));
|
|
204
178
|
}
|
|
205
|
-
export function OutputsCard({ outputs,
|
|
179
|
+
export function OutputsCard({ outputs, onOpenOutput, fill = true, }) {
|
|
206
180
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
207
|
-
return (_jsx(PanelCard, { title: tI18nComplete.raw('texte7ce99764a2d'),
|
|
181
|
+
return (_jsx(PanelCard, { title: tI18nComplete.raw('texte7ce99764a2d'), isEmpty: outputs.length === 0, emptyText: tI18nComplete.raw('textd5f2ad00f99b'), contentClassName: cn('flex min-h-0 flex-col pb-2', !fill && 'max-h-40 overflow-y-auto'), fill: fill, headerAction: _jsx(DownloadAllAction, { outputs: outputs }), children: _jsx(OutputRows, { outputs: outputs, onOpenOutput: onOpenOutput }) }));
|
|
208
182
|
}
|
|
@@ -1,56 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** The row every section draws: one height, one hover, one text edge. Its
|
|
3
|
+
* parent is a flex row (`<li className="flex">`) so `flex-1` fills it. */
|
|
4
|
+
export declare const PANEL_ROW: string;
|
|
5
|
+
/** The fixed leading slot, so every row's label starts on one x. */
|
|
6
|
+
export declare const PANEL_ROW_ICON = "text-muted-foreground flex w-5 shrink-0 items-center justify-center [&_svg]:size-4";
|
|
2
7
|
export interface PanelCardProps {
|
|
3
8
|
title: string;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Stands in the count badge's slot for a card whose quantity is not a count.
|
|
7
|
-
*
|
|
8
|
-
* Plan is the only such card: "3 of 6, and here is the dial" is its size,
|
|
9
|
-
* the way "12" is Outputs'. Putting it HERE rather than beside the chevron
|
|
10
|
-
* is what keeps the column's headers parallel — every card states its size
|
|
11
|
-
* immediately after its title, so the eye reads one column of titles and one
|
|
12
|
-
* column of sizes rather than hunting a different edge per card.
|
|
13
|
-
*
|
|
14
|
-
* Mutually exclusive with `count` in practice: a card that has both is
|
|
15
|
-
* saying its size twice.
|
|
16
|
-
*/
|
|
9
|
+
/** Stands beside the title: Plan's "3 of 6" dial. */
|
|
17
10
|
indicator?: ReactNode;
|
|
18
11
|
/** Second line under the title — Plan uses it for its live step label. */
|
|
19
12
|
subtitle?: ReactNode;
|
|
20
13
|
children?: ReactNode;
|
|
21
|
-
/** Soft placeholder art shown above `emptyText` — the "promise" state. */
|
|
22
|
-
emptyArt?: ReactNode;
|
|
23
14
|
emptyText?: string;
|
|
24
|
-
/** Extra content under `emptyText` — the empty Context
|
|
25
|
-
* context" / "Connect apps" row (Task 5). Full-width, not the `Empty`
|
|
26
|
-
* primitive's own `max-w-sm` prose cap, since a connector strip needs the
|
|
27
|
-
* card's whole width to lay out its rows. */
|
|
15
|
+
/** Extra content under `emptyText` — the empty Context section's "Add context". */
|
|
28
16
|
emptyActions?: ReactNode;
|
|
29
17
|
isEmpty: boolean;
|
|
30
|
-
defaultExpanded?: boolean;
|
|
31
18
|
/** Override the body padding — a full-bleed list wants none. */
|
|
32
19
|
contentClassName?: string;
|
|
33
|
-
/** A control
|
|
34
|
-
* from the header's own expand/collapse toggle. */
|
|
20
|
+
/** A control on the title's right edge (Outputs' "download all"). */
|
|
35
21
|
headerAction?: ReactNode;
|
|
36
22
|
/**
|
|
37
|
-
* This
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* Exactly ONE card in the column may set it. The card still sizes to its
|
|
41
|
-
* content — it never stretches to fill space it does not need — but it is the
|
|
42
|
-
* only one the flex algorithm is allowed to shrink, and when it shrinks its
|
|
43
|
-
* BODY scrolls while its header stays put. Everything else in the column
|
|
44
|
-
* keeps `shrink-0` and stays wholly visible.
|
|
45
|
-
*
|
|
46
|
-
* That asymmetry is the whole design. A column where every card can shrink
|
|
47
|
-
* has no anchor and clips all three; a column where none can shrink pushes
|
|
48
|
-
* the lower cards out of sight the moment one list gets long. One flexible
|
|
49
|
-
* card, the rest fixed, is what keeps Context and Preview on screen while
|
|
50
|
-
* Outputs holds two hundred files.
|
|
51
|
-
*
|
|
52
|
-
* A `fill` card's `contentClassName` carries padding and scrolling only.
|
|
23
|
+
* This section absorbs the column's leftover height: it is the only one the
|
|
24
|
+
* flex algorithm may shrink, and when it shrinks its BODY scrolls while its
|
|
25
|
+
* title stays put. Exactly ONE section in the column may set it.
|
|
53
26
|
*/
|
|
54
27
|
fill?: boolean;
|
|
55
28
|
}
|
|
56
|
-
export declare function PanelCard({ title,
|
|
29
|
+
export declare function PanelCard({ title, indicator, subtitle, children, emptyText, emptyActions, isEmpty, contentClassName, headerAction, fill, }: PanelCardProps): import("react").JSX.Element;
|
|
@@ -1,62 +1,24 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
/**
|
|
4
|
-
* `PanelCard` —
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* `PanelCard` — one section of the session's docked column. Outputs, Changes,
|
|
5
|
+
* Context, Preview, Plan, Background tasks and Change requests are all this
|
|
6
|
+
* component with different contents.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* A section is a plain title over its rows, always open. No header button, no
|
|
9
|
+
* caret, no count chip: the rows ARE the count. Sections are divided by one
|
|
10
|
+
* hairline on the column's inset (`mx-3`), never full-bleed.
|
|
11
11
|
*
|
|
12
|
-
* The
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* The column's one text edge is `px-3`. Rows sit on `mx-1` and pad `px-2`, so
|
|
13
|
+
* their text starts on the same x as the title and their hover fill reaches a
|
|
14
|
+
* little past it — see `PANEL_ROW`.
|
|
15
15
|
*/
|
|
16
|
-
import { CountBadge } from '../../../primitives/count-badge.js';
|
|
17
|
-
import { Disclosure, DisclosureContent, DisclosureTrigger } from '../../../primitives/disclosure.js';
|
|
18
|
-
import { Empty, EmptyContent, EmptyDescription, EmptyMedia } from '../../../primitives/empty.js';
|
|
19
16
|
import { cn } from '../../../lib/utils.js';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// The same hover fill as the rows below: one hover token per column.
|
|
28
|
-
'hover:bg-accent');
|
|
29
|
-
function CardTitleRow({ title, count, indicator, subtitle, chevron, }) {
|
|
30
|
-
return (_jsxs(_Fragment, { children: [_jsxs("span", { className: "flex min-w-0 flex-col gap-0.5", children: [_jsxs("span", { className: "flex min-w-0 items-baseline gap-1.5", children: [_jsx("span", { className: "text-foreground truncate text-sm font-semibold", children: title }), typeof count === 'number' && count > 0 && (_jsx(CountBadge, { count: count })), indicator && _jsx("span", { className: "flex shrink-0 self-center", children: indicator })] }), subtitle] }), chevron] }));
|
|
31
|
-
}
|
|
32
|
-
export function PanelCard({ title, count, indicator, subtitle, children, emptyArt, emptyText, emptyActions, isEmpty, defaultExpanded = false, contentClassName = 'px-4 pb-4', headerAction, fill = false, }) {
|
|
33
|
-
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
34
|
-
const reduce = useReducedMotion();
|
|
35
|
-
const transition = reduce ? { duration: 0 } : { duration: 0.2, ease: 'easeOut' };
|
|
36
|
-
// `defaultExpanded` can flip true after mount (e.g. "auto-open Outputs the
|
|
37
|
-
// moment a run finishes with something to show"). One-way sync: force open
|
|
38
|
-
// when that happens, but never fight a user's manual collapse afterwards.
|
|
39
|
-
const [prevDefaultExpanded, setPrevDefaultExpanded] = useState(defaultExpanded);
|
|
40
|
-
if (defaultExpanded !== prevDefaultExpanded) {
|
|
41
|
-
setPrevDefaultExpanded(defaultExpanded);
|
|
42
|
-
if (defaultExpanded)
|
|
43
|
-
setExpanded(true);
|
|
44
|
-
}
|
|
45
|
-
return (
|
|
46
|
-
// A section of the docked column, not a card: no fill, no radius, no box.
|
|
47
|
-
// Sections divide with one hairline under each, the way the column itself
|
|
48
|
-
// is divided from the chat by one hairline (`panel-chrome.ts`).
|
|
49
|
-
_jsxs(Disclosure, { open: expanded, onOpenChange: setExpanded, className: cn(
|
|
50
|
-
// `last:border-b-0`: dividers sit BETWEEN sections, no stray rule
|
|
51
|
-
// under the last one.
|
|
52
|
-
'text-foreground border-border border-b last:border-b-0', fill ? 'flex min-h-0 flex-col' : 'shrink-0'), transition: transition, children: [_jsx(DisclosureTrigger, { children: _jsx("div", { className: cn(HEADER_CLASS, 'cursor-pointer'), children: _jsx(CardTitleRow, { title: title, count: count, indicator: indicator, subtitle: subtitle, chevron: _jsxs("span", { className: "flex shrink-0 items-center gap-0.5", children: [headerAction && (
|
|
53
|
-
// Isolated from the toggle on both input paths: `stopPropagation`
|
|
54
|
-
// on click covers the mouse/tap case, and on keydown stops the
|
|
55
|
-
// Enter/Space that activates the nested button from *also*
|
|
56
|
-
// bubbling up into the trigger's own Enter/Space handler.
|
|
57
|
-
_jsx("span", { onClick: (e) => e.stopPropagation(), onKeyDown: (e) => e.stopPropagation(), children: headerAction })), _jsx(m.span, { animate: { rotate: expanded ? 90 : 0 }, transition: transition, className: "text-muted-foreground shrink-0", children: _jsx(CaretRightSolidIcon, { className: "size-4" }) })] }) }) }) }), _jsx(DisclosureContent, { className: cn(fill && 'flex min-h-0 flex-col'), contentClassName: contentClassName, children: isEmpty && !emptyArt ? (
|
|
58
|
-
// Compact empty: one line in the section's own left edge, plus its
|
|
59
|
-
// action. The illustrated `Empty` below stays for callers that pass
|
|
60
|
-
// art; the session column's sections pass none.
|
|
61
|
-
_jsxs("div", { className: "flex flex-col items-start gap-2 px-4", children: [emptyText && _jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: emptyText }), emptyActions] })) : isEmpty ? (_jsxs(Empty, { className: "flex-none gap-3 rounded-none border-none p-0 text-center", children: [emptyArt && _jsx(EmptyMedia, { className: "mb-0", children: emptyArt }), emptyText && _jsx(EmptyDescription, { className: "text-pretty", children: emptyText }), emptyActions && (_jsx(EmptyContent, { className: "w-full max-w-none", children: emptyActions }))] })) : (children) })] }));
|
|
17
|
+
/** The row every section draws: one height, one hover, one text edge. Its
|
|
18
|
+
* parent is a flex row (`<li className="flex">`) so `flex-1` fills it. */
|
|
19
|
+
export const PANEL_ROW = cn('mx-1 flex h-8 flex-1 min-w-0 items-center gap-3 rounded-md px-2 text-left text-sm', 'hover:bg-hover transition-colors duration-(--duration-fast) ease-out', 'disabled:cursor-default disabled:hover:bg-transparent');
|
|
20
|
+
/** The fixed leading slot, so every row's label starts on one x. */
|
|
21
|
+
export const PANEL_ROW_ICON = 'text-muted-foreground flex w-5 shrink-0 items-center justify-center [&_svg]:size-4';
|
|
22
|
+
export function PanelCard({ title, indicator, subtitle, children, emptyText, emptyActions, isEmpty, contentClassName = 'pb-3', headerAction, fill = false, }) {
|
|
23
|
+
return (_jsxs("section", { "aria-label": title, className: cn('text-foreground group/section', fill ? 'flex min-h-0 flex-col' : 'shrink-0'), children: [_jsx("div", { className: "border-border mx-3 border-t group-first/section:hidden", "aria-hidden": true }), _jsxs("header", { className: "flex min-h-8 shrink-0 items-center justify-between gap-2 px-3 pt-4 pb-1.5", children: [_jsxs("span", { className: "flex min-w-0 flex-col gap-0.5", children: [_jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [_jsx("h3", { className: "text-foreground truncate text-sm font-medium", children: title }), indicator && _jsx("span", { className: "flex shrink-0", children: indicator })] }), subtitle] }), headerAction && _jsx("span", { className: "flex shrink-0 items-center", children: headerAction })] }), _jsx("div", { className: cn(fill && 'flex min-h-0 flex-col', contentClassName), children: isEmpty ? (_jsxs("div", { className: "flex flex-col items-start gap-2 px-3", children: [emptyText && _jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: emptyText }), emptyActions] })) : (children) })] }));
|
|
62
24
|
}
|
|
@@ -91,10 +91,7 @@ export function PlanPanelCard({ sessionId }) {
|
|
|
91
91
|
return null;
|
|
92
92
|
return (_jsx(PanelCard, { title: tI18nComplete.raw('textfa8ed0bdabdd'),
|
|
93
93
|
// Never the promise state — the card does not exist without a plan.
|
|
94
|
-
isEmpty: false,
|
|
95
|
-
// No `count`. `indicator` stands in its slot with the fraction, which is
|
|
96
|
-
// what "how big is this card" means for a plan.
|
|
97
|
-
indicator: _jsx(PlanProgress, { done: done, total: total, running: Boolean(current) }),
|
|
94
|
+
isEmpty: false, indicator: _jsx(PlanProgress, { done: done, total: total, running: Boolean(current) }),
|
|
98
95
|
// The live step, always visible — the panel's one advantage over the
|
|
99
96
|
// transcript is that it does not scroll away, and this is the line that
|
|
100
97
|
// makes that worth something. Undefined before the plan starts is
|
|
@@ -103,8 +100,8 @@ export function PlanPanelCard({ sessionId }) {
|
|
|
103
100
|
subtitle: label ? (_jsx("span", { className: cn(
|
|
104
101
|
// `block`, not a bare span: `truncate` needs a block box to
|
|
105
102
|
// clip against, and the header column already caps the width.
|
|
106
|
-
'block truncate text-xs', complete ? 'text-muted-foreground' : 'text-foreground
|
|
107
|
-
// `px-
|
|
103
|
+
'block truncate text-xs', complete ? 'text-muted-foreground' : 'text-foreground'), children: label })) : undefined,
|
|
104
|
+
// `px-3` matches the title's inset, so a step's glyph sits on the
|
|
108
105
|
// same left edge as the title above it.
|
|
109
|
-
contentClassName: "px-
|
|
106
|
+
contentClassName: "px-3 pb-3", children: _jsx(PlanSteps, { rows: rows }) }));
|
|
110
107
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** The canonical audit timeline keeps this record even after inbox delivery. */
|
|
2
|
-
export declare function ModelSwitchEvent({ summary }: {
|
|
2
|
+
export declare function ModelSwitchEvent({ summary, }: {
|
|
3
3
|
summary: Record<string, unknown> | null | undefined;
|
|
4
4
|
}): import("react").JSX.Element | null;
|
|
5
|
-
export declare function ModelSwitchHistory({ history, current }: {
|
|
5
|
+
export declare function ModelSwitchHistory({ history, current, }: {
|
|
6
6
|
history: unknown;
|
|
7
7
|
current?: unknown;
|
|
8
8
|
}): import("react").JSX.Element | null;
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslations } from '../../i18n/index.js';
|
|
3
3
|
/** The canonical audit timeline keeps this record even after inbox delivery. */
|
|
4
|
-
export function ModelSwitchEvent({ summary }) {
|
|
4
|
+
export function ModelSwitchEvent({ summary, }) {
|
|
5
5
|
const t = useTranslations('sessionModelSwitch');
|
|
6
6
|
if (typeof summary?.to !== 'string')
|
|
7
7
|
return null;
|
|
8
|
-
return (_jsxs("div", { className: "text-muted-foreground mt-1 space-y-1 text-xs", children: [_jsxs("p", { children: [typeof summary.from === 'string' ? summary.from : '—', " \u2192 ", summary.to] }), _jsx("p", {
|
|
8
|
+
return (_jsxs("div", { className: "text-muted-foreground mt-1 min-w-0 space-y-1 text-xs", children: [_jsxs("p", { className: "break-all font-mono text-foreground", children: [typeof summary.from === 'string' ? summary.from : '—', " \u2192 ", summary.to] }), _jsx("p", { className: "break-all", children: typeof summary.actor_session_id === 'string'
|
|
9
|
+
? t('agentSession', { id: summary.actor_session_id })
|
|
10
|
+
: t('human') }), typeof summary.prompt === 'string' ? (_jsx("p", { className: "whitespace-pre-wrap break-words", children: summary.prompt })) : null] }));
|
|
9
11
|
}
|
|
10
|
-
export function ModelSwitchHistory({ history, current }) {
|
|
12
|
+
export function ModelSwitchHistory({ history, current, }) {
|
|
11
13
|
const t = useTranslations('sessionModelSwitch');
|
|
12
14
|
if (!Array.isArray(history))
|
|
13
15
|
return null;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const entries = history.filter((item) => item !== null &&
|
|
17
|
+
typeof item === 'object' &&
|
|
18
|
+
typeof item.id === 'string' &&
|
|
19
|
+
typeof item.to === 'string');
|
|
20
|
+
if (entries.length === 0)
|
|
21
|
+
return null;
|
|
22
|
+
return (_jsxs("details", { className: "text-muted-foreground mx-auto w-full min-w-0 max-w-2xl px-4 text-xs", children: [_jsxs("summary", { className: "cursor-pointer py-2", children: [_jsxs("span", { children: [t('listLabel'), " \u00B7 ", entries.length] }), typeof current === 'string' ? (_jsx("span", { className: "block max-w-full truncate pl-4 font-mono", title: current, children: current })) : null] }), _jsx("ol", { "aria-label": t('listLabel'), className: "mb-2 max-h-64 space-y-2 overflow-y-auto overscroll-contain border-l border-border pl-3", children: entries.map((item) => (_jsxs("li", { className: "min-w-0", children: [_jsx(ModelSwitchEvent, { summary: item }), typeof item.at === 'string' ? (_jsx("time", { className: "break-all text-muted-foreground text-xs", dateTime: item.at, children: item.at })) : null] }, item.id))) })] }));
|
|
19
23
|
}
|
|
@@ -15,7 +15,8 @@ export interface SessionPanelValue {
|
|
|
15
15
|
files: OutputItem[];
|
|
16
16
|
context: ReturnType<typeof deriveContext>;
|
|
17
17
|
apps: OutputItem[];
|
|
18
|
-
|
|
18
|
+
/** The session works now: lists that poll (Background tasks) poll faster. */
|
|
19
|
+
isSessionBusy: boolean;
|
|
19
20
|
/** Detail-panel state — everything the side panel renders. */
|
|
20
21
|
detail: Detail | null;
|
|
21
22
|
terminalOpen: boolean;
|
|
@@ -485,7 +485,7 @@ export function SessionPanelProvider({ sessionId, isSessionBusy = false, project
|
|
|
485
485
|
: resumableFrameHistory(sessionId, apps.map((app) => app.url ?? ''));
|
|
486
486
|
handleOpenOutput(resumed && output.kind === 'app' ? { ...output, url: resumed.entries[resumed.index] ?? '' } : output, undefined, 'quick');
|
|
487
487
|
}, [apps, handleOpenOutput, sessionId]);
|
|
488
|
-
const {
|
|
488
|
+
const { pendingQuickView } = usePanelHandoffs({
|
|
489
489
|
sessionId, projectId, projectSessionId, isRunning, outcome, apps, files, steps, calls,
|
|
490
490
|
detail, handleOpenOutput, openDetail, closeDetail, openTerminal, openAudit, openReminders, openDesktop, openBrowser, openFiles,
|
|
491
491
|
});
|
|
@@ -605,7 +605,7 @@ export function SessionPanelProvider({ sessionId, isSessionBusy = false, project
|
|
|
605
605
|
files,
|
|
606
606
|
context,
|
|
607
607
|
apps,
|
|
608
|
-
|
|
608
|
+
isSessionBusy,
|
|
609
609
|
detail,
|
|
610
610
|
terminalOpen,
|
|
611
611
|
terminalSwap,
|
|
@@ -627,7 +627,7 @@ export function SessionPanelProvider({ sessionId, isSessionBusy = false, project
|
|
|
627
627
|
files,
|
|
628
628
|
context,
|
|
629
629
|
apps,
|
|
630
|
-
|
|
630
|
+
isSessionBusy,
|
|
631
631
|
detail,
|
|
632
632
|
terminalOpen,
|
|
633
633
|
terminalSwap,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { shouldShowToolPart } from '../../../internal/session-types/index.js';
|
|
2
2
|
import { sessionLogOpenCall } from '@kortix/sdk';
|
|
3
|
-
import { shouldShowToolPartInActionsPanel } from '../../tool/tool-renderers.js';
|
|
3
|
+
import { isUnpresentedFailure, shouldShowToolPartInActionsPanel } from '../../tool/tool-renderers.js';
|
|
4
4
|
/**
|
|
5
5
|
* Flatten a thread's messages into the ordered list of tool calls worth
|
|
6
6
|
* showing — the same set the chat transcript renders. Every message counts,
|
|
@@ -48,7 +48,7 @@ export function collectAllToolCalls(messages) {
|
|
|
48
48
|
if (block.type !== 'tool_call')
|
|
49
49
|
continue;
|
|
50
50
|
const call = sessionLogOpenCall(block);
|
|
51
|
-
if (shouldShowToolPart(call))
|
|
51
|
+
if (shouldShowToolPart(call) && !isUnpresentedFailure(call))
|
|
52
52
|
calls.push(call);
|
|
53
53
|
}
|
|
54
54
|
}
|