@kortix/ui 0.15.11 → 0.16.0
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 +478 -179
- package/dist/_vendor/shared/my-kortix-agent.d.ts +5 -3
- package/dist/_vendor/shared/session/attachment-tile.d.ts +8 -0
- package/dist/_vendor/shared/workspace-settings.d.ts +3 -0
- package/dist/access/access/copy-row.d.ts +7 -1
- package/dist/access/access/copy-row.js +2 -2
- package/dist/animated-copy-icon.js +2 -1
- package/dist/browser/sandbox-browser-chrome.d.ts +2 -1
- package/dist/browser/sandbox-browser-chrome.js +1 -1
- package/dist/customize/agents/agent-cover-card.d.ts +1 -1
- package/dist/customize/agents/agent-cover-card.js +10 -2
- package/dist/customize/agents/agent-filter.js +3 -1
- package/dist/customize/agents/agent-overview.d.ts +10 -0
- package/dist/customize/agents/agent-overview.js +5 -4
- package/dist/customize/agents/agent-page-chrome.d.ts +5 -6
- package/dist/customize/agents/agent-page-chrome.js +16 -13
- package/dist/customize/agents/agent-page.js +6 -28
- package/dist/customize/agents/agent-tabs.d.ts +1 -0
- package/dist/customize/agents/agent-tabs.js +1 -0
- package/dist/customize/agents/agents-page.js +3 -3
- package/dist/customize/agents/create-agent-modal.d.ts +9 -0
- package/dist/customize/agents/create-agent-modal.js +21 -3
- package/dist/customize/agents/use-default-agent.js +2 -2
- package/dist/customize/connectors/connector-identity.d.ts +11 -2
- package/dist/customize/connectors/connector-identity.js +16 -4
- package/dist/customize/connectors/connectors-page.js +10 -6
- package/dist/customize/connectors/detail/app-page.js +2 -2
- package/dist/customize/connectors/install/install-dialog.d.ts +2 -0
- package/dist/customize/connectors/install/install-dialog.js +6 -1
- package/dist/customize/connectors/use-agent-access.d.ts +1 -0
- package/dist/customize/evals/eval-compare-view.d.ts +10 -0
- package/dist/customize/evals/eval-compare-view.js +68 -0
- package/dist/customize/evals/eval-dataset-view.d.ts +20 -0
- package/dist/customize/evals/eval-dataset-view.js +81 -0
- package/dist/customize/evals/eval-datasets-page.d.ts +25 -0
- package/dist/customize/evals/eval-datasets-page.js +91 -0
- package/dist/customize/evals/eval-job-view.d.ts +12 -0
- package/dist/customize/evals/eval-job-view.js +360 -0
- package/dist/customize/evals/eval-jobs-page.d.ts +4 -0
- package/dist/customize/evals/eval-jobs-page.js +69 -0
- package/dist/customize/evals/eval-meta.d.ts +97 -0
- package/dist/customize/evals/eval-meta.js +228 -0
- package/dist/customize/evals/eval-task-view.d.ts +13 -0
- package/dist/customize/evals/eval-task-view.js +123 -0
- package/dist/customize/evals/eval-tasks-page.d.ts +8 -0
- package/dist/customize/evals/eval-tasks-page.js +56 -0
- package/dist/customize/evals/eval-ui.d.ts +97 -0
- package/dist/customize/evals/eval-ui.js +153 -0
- package/dist/customize/evals/evals-page.d.ts +10 -0
- package/dist/customize/evals/evals-page.js +56 -0
- package/dist/customize/evals/run-eval-modal.d.ts +28 -0
- package/dist/customize/evals/run-eval-modal.js +167 -0
- package/dist/customize/project-settings/project-admin-sections.d.ts +3 -2
- package/dist/customize/project-settings/project-admin-sections.js +6 -1
- package/dist/customize/providers/provider-connect.d.ts +13 -0
- package/dist/customize/providers/provider-connect.js +29 -5
- package/dist/customize/providers/provider-sheet.js +5 -4
- package/dist/customize/sections/view/gateway/gateway-overview.d.ts +5 -0
- package/dist/customize/sections/view/gateway/gateway-overview.js +32 -6
- package/dist/customize/sections/view/gateway/routing-parts.d.ts +6 -0
- package/dist/customize/sections/view/gateway/routing-parts.js +21 -13
- package/dist/customize/sections/view/git-view.d.ts +19 -1
- package/dist/customize/sections/view/git-view.js +7 -3
- package/dist/customize/sections/view/manifest-issue-list.d.ts +16 -0
- package/dist/customize/sections/view/manifest-issue-list.js +41 -0
- package/dist/customize/sections/view/manifest-issues-row.d.ts +24 -0
- package/dist/customize/sections/view/manifest-issues-row.js +39 -0
- package/dist/customize/sections/view/sandbox-provider-coverage.d.ts +7 -1
- package/dist/customize/sections/view/sandbox-provider-coverage.js +7 -5
- package/dist/customize/sections/view/secrets-view.d.ts +13 -0
- package/dist/customize/sections/view/secrets-view.js +10 -6
- package/dist/customize/sections/view/subscription-usage.d.ts +2 -7
- package/dist/customize/sections/view/subscription-usage.js +4 -8
- package/dist/customize/settings/settings-tab-header.js +12 -3
- package/dist/customize/settings/tabs/experimental-tab.d.ts +16 -5
- package/dist/customize/settings/tabs/experimental-tab.js +36 -11
- package/dist/customize/settings/tabs/general-tab.js +1 -1
- package/dist/customize/settings/tabs/sandbox-tab.d.ts +10 -0
- package/dist/customize/settings/tabs/sandbox-tab.js +27 -4
- package/dist/customize/settings/tabs/snapshots-tab.d.ts +31 -0
- package/dist/customize/settings/tabs/snapshots-tab.js +61 -5
- package/dist/customize/settings/tabs/workspace-keys.js +6 -3
- package/dist/customize/shared/capability-page-shell.js +9 -1
- package/dist/customize/shared/catalog/catalog-card.d.ts +1 -1
- package/dist/customize/shared/catalog/catalog-card.js +15 -5
- package/dist/customize/shared/customize-tab-bar.js +1 -1
- package/dist/customize/shared/new-entity-menu.d.ts +1 -1
- package/dist/customize/shared/new-entity-menu.js +38 -1
- package/dist/customize/triggers/runtime-triggers.d.ts +4 -0
- package/dist/customize/triggers/runtime-triggers.js +21 -2
- package/dist/customize/triggers/schedule/post-to-field.js +2 -2
- package/dist/customize/triggers/schedule-view.js +2 -1
- package/dist/files/project/components/drive-explorer.js +33 -70
- package/dist/files/project/components/drive-grid-view.d.ts +2 -31
- package/dist/files/project/components/drive-grid-view.js +12 -22
- package/dist/files/project/components/drive-list-view.d.ts +3 -30
- package/dist/files/project/components/drive-list-view.js +8 -18
- package/dist/files/project/components/drive-selection-bar.d.ts +4 -5
- package/dist/files/project/components/drive-selection-bar.js +13 -20
- package/dist/files/project/components/explorer-listing.d.ts +48 -0
- package/dist/files/project/components/explorer-listing.js +64 -0
- package/dist/files/project/components/file-explorer-page.js +7 -204
- package/dist/files/project/components/file-thumbnail.js +3 -1
- package/dist/files/project/components/manifest-issue-mark.d.ts +9 -0
- package/dist/files/project/components/manifest-issue-mark.js +26 -0
- package/dist/files/project/hooks/use-change-requests.d.ts +10 -0
- package/dist/files/project/hooks/use-change-requests.js +17 -0
- package/dist/files/project/manifest-annotations.d.ts +16 -0
- package/dist/files/project/manifest-annotations.js +19 -0
- package/dist/files/project/store/version-store.d.ts +1 -1
- package/dist/files/project/upload-batch.d.ts +20 -0
- package/dist/files/project/upload-batch.js +20 -0
- package/dist/files/runtime/hooks/use-binary-blob.js +3 -2
- package/dist/files/runtime/hooks/use-file-content.js +3 -2
- package/dist/files/runtime/hooks/use-file-list.js +1 -2
- package/dist/files/runtime/hooks/use-file-mutations.js +69 -6
- package/dist/files/runtime/hooks/use-file-refresh.d.ts +4 -0
- package/dist/files/runtime/hooks/use-file-refresh.js +6 -0
- package/dist/files/tree/components/file-tree-item.js +1 -4
- package/dist/files/viewer/file-annotations.d.ts +18 -0
- package/dist/files/viewer/file-annotations.js +21 -0
- package/dist/files/viewer/file-content-renderer.js +1 -1
- package/dist/files/viewer/file-viewer.js +2 -1
- package/dist/files/viewer/index.d.ts +1 -0
- package/dist/files/viewer/index.js +1 -0
- package/dist/files/viewer/use-file-content-state.js +8 -1
- package/dist/i18n/en.d.ts +495 -46
- package/dist/i18n/en.js +536 -87
- package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +0 -4
- package/dist/icons/caret-right-solid.d.ts +11 -0
- package/dist/icons/caret-right-solid.js +15 -0
- package/dist/internal/auth/auth-art.d.ts +12 -0
- package/dist/internal/auth/auth-art.js +118 -0
- package/dist/internal/auth/auth-card-shell.d.ts +14 -10
- package/dist/internal/auth/auth-card-shell.js +20 -31
- package/dist/internal/auth/auth-consent.d.ts +3 -1
- package/dist/internal/auth/auth-consent.js +2 -2
- package/dist/internal/auth/auth-primitives.d.ts +26 -1
- package/dist/internal/auth/auth-primitives.js +37 -8
- package/dist/internal/connector-logo/connector-logo.d.ts +2 -1
- package/dist/internal/connector-logo/connector-logo.js +11 -2
- package/dist/internal/files/file-read-retry.d.ts +18 -2
- package/dist/internal/files/file-read-retry.js +42 -4
- package/dist/internal/hooks/projects/use-new-project-session.js +5 -10
- package/dist/internal/hooks/use-auto-scroll-physics.d.ts +1 -1
- package/dist/internal/hooks/use-auto-scroll-physics.js +2 -10
- package/dist/internal/hooks/use-reduced-motion.d.ts +4 -0
- package/dist/internal/hooks/use-reduced-motion.js +12 -0
- package/dist/internal/hooks/use-save-shortcut.d.ts +8 -0
- package/dist/internal/hooks/use-save-shortcut.js +28 -0
- package/dist/internal/layout/connect-mcp-modal.d.ts +1 -1
- package/dist/internal/layout/connect-mcp-modal.js +9 -4
- package/dist/internal/layout/panel-chrome.d.ts +28 -0
- package/dist/internal/layout/panel-chrome.js +27 -0
- package/dist/internal/layout/project-page-header.js +5 -1
- package/dist/internal/lib/browser-noise/rules/webview.js +16 -0
- package/dist/internal/lib/manifest-health.d.ts +25 -1
- package/dist/internal/lib/manifest-health.js +56 -0
- package/dist/internal/lib/project-preamble.js +1 -1
- package/dist/internal/lib/web-notifications.d.ts +1 -1
- package/dist/internal/lib/web-notifications.js +3 -0
- package/dist/internal/notifications/notification-inbox.js +2 -1
- package/dist/internal/notifications/notification-rows.d.ts +1 -1
- package/dist/internal/notifications/notification-rows.js +15 -1
- package/dist/internal/selection/selection-bar.d.ts +2 -8
- package/dist/internal/selection/selection-bar.js +15 -38
- package/dist/internal/stores/active-space-store.d.ts +1 -1
- package/dist/internal/stores/browser-recents-store.d.ts +1 -1
- package/dist/internal/stores/current-account-store.d.ts +1 -1
- package/dist/internal/stores/first-chat-store.d.ts +1 -1
- package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
- package/dist/internal/stores/session-browser-store.d.ts +1 -1
- package/dist/internal/stores/session-expanded-store.d.ts +1 -1
- package/dist/internal/stores/session-filter-store.d.ts +1 -1
- package/dist/internal/stores/session-history-view-store.d.ts +1 -1
- package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
- package/dist/internal/stores/sound-store.d.ts +1 -1
- package/dist/internal/stores/tab-store.d.ts +1 -1
- package/dist/internal/stores/user-preferences-store.d.ts +9 -1
- package/dist/internal/stores/user-preferences-store.js +2 -0
- package/dist/internal/stores/web-notification-store.d.ts +1 -1
- package/dist/lib/base-ui-compat.js +28 -1
- package/dist/lib/dotmatrix-hooks.d.ts +1 -0
- package/dist/lib/dotmatrix-hooks.js +3 -13
- package/dist/lib/reduced-motion.d.ts +10 -0
- package/dist/lib/reduced-motion.js +104 -0
- package/dist/lib/routes.d.ts +9 -0
- package/dist/lib/routes.js +7 -4
- package/dist/markdown/artifact-link.d.ts +11 -0
- package/dist/markdown/artifact-link.js +62 -0
- package/dist/markdown/code/index.d.ts +1 -1
- package/dist/markdown/code/index.js +1 -1
- package/dist/markdown/code/inline-code.d.ts +1 -1
- package/dist/markdown/code/inline-code.js +1 -1
- package/dist/markdown/genui/components/map-canvas.js +2 -1
- package/dist/markdown/index.d.ts +3 -1
- package/dist/markdown/index.js +2 -1
- package/dist/markdown/{code/inline-chip.js → inline-chip.js} +2 -2
- package/dist/markdown/inline-code-text.d.ts +34 -0
- package/dist/markdown/inline-code-text.js +68 -0
- package/dist/markdown/setup-links/approval-decision.js +3 -3
- package/dist/markdown/soft-breaks.d.ts +21 -0
- package/dist/markdown/soft-breaks.js +33 -0
- package/dist/markdown/unified-markdown.d.ts +9 -1
- package/dist/markdown/unified-markdown.js +31 -9
- package/dist/primitives/action-bar.d.ts +50 -0
- package/dist/primitives/action-bar.js +87 -0
- package/dist/primitives/calendar.js +4 -2
- package/dist/primitives/inline-meta.js +2 -2
- package/dist/primitives/kortix-loader.js +2 -1
- package/dist/primitives/modal.d.ts +1 -1
- package/dist/primitives/paper-wallpaper-shaders.d.ts +1 -0
- package/dist/primitives/paper-wallpaper-shaders.js +6 -0
- package/dist/primitives/resizable.d.ts +1 -1
- package/dist/primitives/resize-seam.d.ts +3 -2
- package/dist/primitives/resize-seam.js +4 -3
- package/dist/primitives/settings-section-header.d.ts +30 -1
- package/dist/primitives/settings-section-header.js +37 -0
- package/dist/primitives/sliding-tab-indicator.js +2 -1
- package/dist/primitives/switch.js +15 -8
- package/dist/primitives/text-shimmer.js +6 -0
- package/dist/primitives/toast-clearance.d.ts +52 -0
- package/dist/primitives/toast-clearance.js +116 -0
- package/dist/primitives/toast.d.ts +3 -1
- package/dist/primitives/toast.js +2 -0
- package/dist/primitives/typed-title.js +1 -1
- package/dist/primitives/wallpaper-shaders.js +1 -1
- package/dist/session/actions/project-session-list-helpers.d.ts +16 -0
- package/dist/session/actions/project-session-list-helpers.js +18 -0
- package/dist/session/agents/agent-model.d.ts +1 -0
- package/dist/session/agents/agent-model.js +2 -1
- package/dist/session/agents/agent-strip.js +10 -4
- package/dist/session/agents/workflow-run-controls.d.ts +27 -4
- package/dist/session/agents/workflow-run-controls.js +63 -10
- package/dist/session/composer/ComposerCard.js +3 -0
- package/dist/session/composer/agent-selector.js +6 -4
- package/dist/session/composer/animated-placeholder.js +2 -1
- package/dist/session/composer/attachment-tile.d.ts +2 -2
- package/dist/session/composer/attachment-tile.js +25 -3
- package/dist/session/composer/composer-agent-access.d.ts +10 -1
- package/dist/session/composer/composer-agent-access.js +18 -4
- package/dist/session/composer/composer-chat-input.js +7 -2
- package/dist/session/composer/composer.d.ts +2 -2
- package/dist/session/composer/composer.js +7 -6
- package/dist/session/composer/hooks/use-file-search.d.ts +12 -2
- package/dist/session/composer/hooks/use-file-search.js +71 -7
- package/dist/session/composer/menus/menu-items.js +6 -2
- package/dist/session/composer/menus/menu-shell.d.ts +3 -1
- package/dist/session/composer/menus/menu-shell.js +2 -2
- package/dist/session/composer/menus/slash-menu.d.ts +7 -0
- package/dist/session/composer/menus/slash-menu.js +48 -1
- package/dist/session/composer/use-instant-session-send.js +7 -1
- package/dist/session/header/session-reminders-indicator.js +3 -2
- package/dist/session/header/session-site-header.js +24 -6
- package/dist/session/media/sandbox-url-detector.js +1 -1
- package/dist/session/models/model-connection-gate.js +2 -1
- package/dist/session/models/model-selector.js +1 -1
- package/dist/session/models/subscription-switcher.d.ts +7 -0
- package/dist/session/models/subscription-switcher.js +52 -10
- package/dist/session/models/subscription-windows.d.ts +2 -0
- package/dist/session/models/subscription-windows.js +2 -0
- package/dist/session/outcomes/session-outcomes-provider.js +14 -7
- package/dist/session/panel/action-panel.js +8 -19
- package/dist/session/panel/easy/app-preview.d.ts +4 -1
- package/dist/session/panel/easy/app-preview.js +95 -33
- package/dist/session/panel/easy/apps-card.js +6 -11
- package/dist/session/panel/easy/change-requests-card.js +1 -1
- package/dist/session/panel/easy/changes-card.d.ts +14 -0
- package/dist/session/panel/easy/changes-card.js +60 -0
- package/dist/session/panel/easy/context-card.d.ts +5 -1
- package/dist/session/panel/easy/context-card.js +13 -28
- package/dist/session/panel/easy/context-meter.d.ts +18 -0
- package/dist/session/panel/easy/context-meter.js +73 -0
- package/dist/session/panel/easy/detail-view.d.ts +1 -1
- package/dist/session/panel/easy/detail-view.js +24 -21
- package/dist/session/panel/easy/easy-panel.js +7 -5
- package/dist/session/panel/easy/file-preview.js +3 -1
- package/dist/session/panel/easy/frame-history.d.ts +91 -0
- package/dist/session/panel/easy/frame-history.js +198 -0
- package/dist/session/panel/easy/outputs-card.d.ts +10 -0
- package/dist/session/panel/easy/outputs-card.js +28 -31
- package/dist/session/panel/easy/panel-card.d.ts +1 -3
- package/dist/session/panel/easy/panel-card.js +24 -8
- package/dist/session/panel/easy/plan-card.js +2 -2
- package/dist/session/panel/easy/step-icon.d.ts +4 -1
- package/dist/session/panel/easy/step-icon.js +2 -2
- package/dist/session/panel/session-action-panel-column.d.ts +5 -0
- package/dist/session/panel/session-action-panel-column.js +198 -101
- package/dist/session/panel/session-desktop.js +5 -1
- package/dist/session/panel/session-diff-viewer.d.ts +3 -1
- package/dist/session/panel/session-diff-viewer.js +7 -4
- package/dist/session/panel/session-panel-provider.js +29 -5
- package/dist/session/panel/shared/derive-panels.js +64 -4
- package/dist/session/status/session-busy-indicator.js +2 -1
- package/dist/session/status/session-error-banner.js +1 -1
- package/dist/session/thread/chat-minimap.js +2 -1
- package/dist/session/thread/session-body.js +4 -1
- package/dist/session/thread/session-chat.js +18 -3
- package/dist/session/thread/session-turn-meta-rows.d.ts +13 -5
- package/dist/session/thread/session-turn-meta-rows.js +33 -5
- package/dist/session/thread/transcript.d.ts +1 -2
- package/dist/session/thread/transcript.js +26 -24
- package/dist/session/thread/typing-indicator.d.ts +2 -2
- package/dist/session/thread/typing-indicator.js +10 -3
- package/dist/session/tool/tools/session-spawn-tool.js +3 -3
- package/dist/session/tool/tools/workflow-run-card.d.ts +11 -1
- package/dist/session/tool/tools/workflow-run-card.js +31 -7
- package/dist/session/tool/tools/workflow-run-cost.d.ts +29 -0
- package/dist/session/tool/tools/workflow-run-cost.js +75 -0
- package/dist/session/tool/tools/workflow-tool.d.ts +1 -1
- package/dist/session/tool/tools/workflow-tool.js +40 -15
- package/dist/session/turn/peer-message-row.js +1 -1
- package/dist/session/turn/queued-prompt-bubbles.d.ts +3 -2
- package/dist/session/turn/queued-prompt-bubbles.js +1 -1
- package/dist/session/turn/throttled-markdown.js +1 -1
- package/dist/styles/theme.css +68 -0
- package/dist/styles.css +1 -1
- package/dist/terminal/pty-terminal.js +1 -1
- package/dist/terminal/session-terminal-connect-bar.js +2 -1
- package/dist/test-utils/intl.d.ts +495 -46
- package/dist/workspace/admin/project-admin-dashboard.js +21 -7
- package/dist/workspace/admin/settings-search-landing.js +2 -1
- package/dist/workspace/calendar/calendar-dates.d.ts +31 -0
- package/dist/workspace/calendar/calendar-dates.js +64 -0
- package/dist/workspace/calendar/calendar-new-item.d.ts +11 -0
- package/dist/workspace/calendar/calendar-new-item.js +47 -0
- package/dist/workspace/calendar/calendar-page.d.ts +3 -0
- package/dist/workspace/calendar/calendar-page.js +177 -0
- package/dist/workspace/calendar/calendar-panel.d.ts +13 -0
- package/dist/workspace/calendar/calendar-panel.js +103 -0
- package/dist/workspace/calendar/calendar-people.d.ts +52 -0
- package/dist/workspace/calendar/calendar-people.js +117 -0
- package/dist/workspace/calendar/calendar-scheduled.d.ts +29 -0
- package/dist/workspace/calendar/calendar-scheduled.js +118 -0
- package/dist/workspace/calendar/calendar-views.d.ts +32 -0
- package/dist/workspace/calendar/calendar-views.js +124 -0
- package/dist/workspace/calendar/calendar-when.d.ts +14 -0
- package/dist/workspace/calendar/calendar-when.js +81 -0
- package/dist/workspace/calendar/mention-textarea.d.ts +19 -0
- package/dist/workspace/calendar/mention-textarea.js +84 -0
- package/dist/workspace/home/access-requests-bell.js +2 -1
- package/dist/workspace/inbox/workspace-inbox.d.ts +1 -1
- package/dist/workspace/inbox/workspace-inbox.js +1 -1
- package/dist/workspace/layout/project-files-view.js +2 -1
- package/dist/workspace/memory/memory-page-list.js +1 -1
- package/dist/workspace/new/workspace-handoff.js +2 -1
- package/dist/workspace/projects/modal/project-icon-field.js +2 -1
- package/dist/workspace/session-workspace.js +13 -12
- package/dist/workspace/setup/setup-steps.d.ts +43 -0
- package/dist/workspace/setup/setup-steps.js +38 -0
- package/dist/workspace/setup/workspace-setup-page.d.ts +10 -0
- package/dist/workspace/setup/workspace-setup-page.js +124 -0
- package/dist/workspace/sidebar/footer/project-artifacts-nav.js +5 -1
- package/dist/workspace/sidebar/footer/project-calendar-nav.d.ts +8 -0
- package/dist/workspace/sidebar/footer/project-calendar-nav.js +31 -0
- package/dist/workspace/sidebar/footer/project-chrome-nav.d.ts +14 -6
- package/dist/workspace/sidebar/footer/project-chrome-nav.js +37 -25
- package/dist/workspace/sidebar/footer/project-computer-nav.d.ts +17 -9
- package/dist/workspace/sidebar/footer/project-computer-nav.js +36 -26
- package/dist/workspace/sidebar/footer/project-download-app-nav.d.ts +7 -7
- package/dist/workspace/sidebar/footer/project-download-app-nav.js +25 -13
- package/dist/workspace/sidebar/footer/project-inbox-nav.d.ts +8 -0
- package/dist/workspace/sidebar/footer/project-inbox-nav.js +29 -0
- package/dist/workspace/sidebar/footer/project-manifest-issues-alert.d.ts +3 -13
- package/dist/workspace/sidebar/footer/project-manifest-issues-alert.js +6 -48
- package/dist/workspace/sidebar/footer/project-mcp-nav.d.ts +7 -7
- package/dist/workspace/sidebar/footer/project-mcp-nav.js +31 -13
- package/dist/workspace/sidebar/footer/project-phone-app-nav.d.ts +10 -0
- package/dist/workspace/sidebar/footer/project-phone-app-nav.js +61 -0
- package/dist/workspace/sidebar/footer/project-promo-cards.d.ts +21 -0
- package/dist/workspace/sidebar/footer/project-promo-cards.js +33 -0
- package/dist/workspace/sidebar/footer/promo-card.d.ts +41 -0
- package/dist/workspace/sidebar/footer/promo-card.js +47 -0
- package/dist/workspace/sidebar/project-nav-items.d.ts +3 -1
- package/dist/workspace/sidebar/project-nav-items.js +12 -4
- package/dist/workspace/sidebar/project-session-list.js +58 -26
- package/dist/workspace/sidebar/project-sidebar.js +2 -5
- package/dist/workspace/sidebar/project-spaces-nav.js +2 -1
- package/dist/workspace/sidebar/session-brief-hover-card.d.ts +24 -0
- package/dist/workspace/sidebar/session-brief-hover-card.js +4 -3
- package/dist/workspace/sidebar/session-group-sections.d.ts +26 -7
- package/dist/workspace/sidebar/session-group-sections.js +121 -41
- package/dist/workspace/sidebar/sidebar-drill.js +6 -0
- package/dist/workspace/sidebar/sidebar-more-group.js +3 -2
- package/dist/workspace/sidebar/use-workspace-list.d.ts +7 -0
- package/dist/workspace/sidebar/use-workspace-list.js +11 -1
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.d.ts +14 -0
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +46 -2
- package/dist/workspace/space/space-tab-panels.js +1 -1
- package/dist/workspace/spaces/space-timeline.js +2 -2
- package/package.json +67 -10
- package/skills/kortix-ui/SKILL.md +2 -2
- package/skills/kortix-ui/references/modules.md +5 -3
- package/dist/session/thread/turn-share.d.ts +0 -16
- package/dist/session/thread/turn-share.js +0 -161
- package/dist/workspace/sidebar/footer/promo-nav-row.d.ts +0 -11
- package/dist/workspace/sidebar/footer/promo-nav-row.js +0 -7
- /package/dist/markdown/{code/inline-chip.d.ts → inline-chip.d.ts} +0 -0
|
@@ -40,12 +40,15 @@ import { getSessionDisplayTitle } from '../actions/project-session-list-helpers.
|
|
|
40
40
|
import { useReloadSessionConfig } from '../../internal/hooks/projects/use-session-config-freshness.js';
|
|
41
41
|
import { cn } from '../../lib/utils.js';
|
|
42
42
|
import { useSessionHistoryViewStore } from '../../internal/stores/session-history-view-store.js';
|
|
43
|
-
import { useIsActionPanelOpen, useReadyChip, useToggleActionPanel, } from '../../internal/stores/kortix-computer-store.js';
|
|
43
|
+
import { useIsActionPanelOpen, useIsSidePanelOpen, useReadyChip, useToggleActionPanel, useToggleRightPanel, } from '../../internal/stores/kortix-computer-store.js';
|
|
44
|
+
import { SESSION_BAR_CLASS } from '../../internal/layout/panel-chrome.js';
|
|
45
|
+
import { Kbd, KbdGroup } from '../../primitives/kbd.js';
|
|
44
46
|
import { createProjectSession, directSubsessions, restartProjectSession, stopProjectSession } from '@kortix/sdk';
|
|
45
47
|
import { qk, useHasSessionDesktop, useProjectSession, useRuntimeSupports, useSessionChildren, useSessionParticipants, useSessionWatch, } from '@kortix/sdk/react';
|
|
46
|
-
import { ArchiveIcon, ArrowsClockwiseIcon, BellIcon, BellSlashIcon,
|
|
48
|
+
import { ArchiveIcon, ArrowsClockwiseIcon, BellIcon, BellSlashIcon, GitForkIcon, LinkSimpleIcon, ListBulletsIcon, CaretDownIcon, CodeSimpleIcon as Code2, FileArrowDownIcon as FileDown, FolderSimpleIcon, GlobeSimpleIcon, MonitorIcon, StackIcon as Layers, PencilSimpleIcon, PushPinIcon, PushPinSlashIcon, ArrowCounterClockwiseIcon as RotateCcw, ShareIcon as Share, SquareIcon as Square, TerminalIcon, TrashIcon, } from '@phosphor-icons/react';
|
|
47
49
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
48
50
|
import { useMemo, useRef, useState } from 'react';
|
|
51
|
+
const modKey = typeof navigator !== 'undefined' && /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? '⌘' : 'Ctrl';
|
|
49
52
|
/** Sandbox surfaces reachable from the header. One list drives both the
|
|
50
53
|
* desktop segment and the mobile sheet, so growing to 4-5 is a one-line add.
|
|
51
54
|
* Every entry fires the same `openSessionQuickView(view, 'header')` call. */
|
|
@@ -229,7 +232,15 @@ export function SessionSiteHeader({ sessionId, sessionTitle, isMobileView, leadi
|
|
|
229
232
|
// Mobile-only action-panel toggle — see its render site below.
|
|
230
233
|
const isActionPanelOpen = useIsActionPanelOpen();
|
|
231
234
|
const toggleActionPanel = useToggleActionPanel();
|
|
235
|
+
const toggleRightPanel = useToggleRightPanel();
|
|
236
|
+
const isDetailPanelOpen = useIsSidePanelOpen();
|
|
232
237
|
const readyChip = useReadyChip();
|
|
238
|
+
// Something is docked on the right: the sections column or a detail panel.
|
|
239
|
+
// On a phone only the sections drawer answers to this control.
|
|
240
|
+
const rightPaneOpen = isMobileViewport
|
|
241
|
+
? isActionPanelOpen
|
|
242
|
+
: isActionPanelOpen || isDetailPanelOpen;
|
|
243
|
+
const rightPaneLabel = tI18nHardcoded.raw(rightPaneOpen ? 'i18nComplete.text40cd6293d193' : 'i18nComplete.text2534086de9fe');
|
|
233
244
|
// P5.6: show or hide the messages outside the agent's context (a failed attempt), per
|
|
234
245
|
// session. Listed only while the transcript on screen holds one: otherwise it changes nothing.
|
|
235
246
|
const historyKey = projectSessionId || sessionId;
|
|
@@ -270,14 +281,21 @@ export function SessionSiteHeader({ sessionId, sessionTitle, isMobileView, leadi
|
|
|
270
281
|
: tI18nHardcoded.raw('i18nComplete.text32ad3abe4479'));
|
|
271
282
|
},
|
|
272
283
|
}), children: [forkSession.isPending ? _jsx(Loading, {}) : _jsx(GitForkIcon, {}), tI18nHardcoded.raw('i18nComplete.text0e5f7f6732e0')] }))] })), outOfContextPresent && (_jsx(DropdownMenuCheckboxItem, { className: "cursor-pointer", checked: !outOfContextHidden, onCheckedChange: (checked) => setOutOfContextHidden(historyKey, !checked), children: tHistory('showOutOfContext') })), _jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => setExportOpen(true), children: [_jsx(FileDown, {}), tI18nHardcoded.raw('i18nComplete.text5d974f9e80c3')] }), canCompact && (_jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => setCompactOpen(true), children: [_jsx(Layers, {}), contextRecord ? tReset('dialogAction') : tI18nHardcoded.raw('i18nComplete.textca838377bb5a')] })), isProjectSession && canManageLifecycle && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => setDeleteOpen(true), children: [_jsx(TrashIcon, {}), tI18nHardcoded.raw('i18nComplete.texte2d0a54968ea')] })] }))] }));
|
|
273
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "relative z-50 w-full", children: [_jsxs("div", { className: cn(
|
|
284
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "relative z-50 w-full", children: [_jsxs("div", { className: cn(
|
|
285
|
+
// The shared bar: same height and bottom rule as the detail
|
|
286
|
+
// panel's bar, so the two rules meet as one line (`panel-chrome.ts`).
|
|
287
|
+
SESSION_BAR_CLASS, 'justify-between px-3.5 pr-4',
|
|
288
|
+
// A phone's notch inset adds to the bar instead of squeezing the
|
|
289
|
+
// 28px controls against its rule. Phones have no pane beside the
|
|
290
|
+
// chat, so a taller bar there breaks no line.
|
|
291
|
+
'max-md:h-auto max-md:min-h-[calc(var(--spacing)*11+env(safe-area-inset-top))] max-md:pt-[env(safe-area-inset-top)]', // audit:allow device safe-area inset, not a spacing step
|
|
274
292
|
// Unconditional on the shell. The LEFT indent depends on the
|
|
275
293
|
// sidebar (expanded, it covers the macOS lights itself) and is
|
|
276
294
|
// gated by the data attribute — but the RIGHT one does not: this
|
|
277
295
|
// column's right edge is the window's right edge whatever the
|
|
278
296
|
// sidebar does, so on Win/Linux the trailing dev-tools cluster
|
|
279
297
|
// sits under min/max/close either way.
|
|
280
|
-
desktopShell !== null && 'kx-titlebar-row'
|
|
298
|
+
desktopShell !== null && 'kx-titlebar-row'), "data-sidebar-collapsed": sidebarHidden || undefined, children: [_jsxs("div", { className: cn('pointer-events-auto flex min-w-0 items-center gap-0.5', sidebarHidden && 'h-[var(--kx-titlebar-control-size)]'), children: [_jsx(SidebarToggle, {}), parent && (_jsxs(_Fragment, { children: [_jsxs(Button, { type: "button", variant: "ghost", onClick: parent.onOpen, className: "text-foreground h-7 shrink-0 gap-1.5 rounded-md px-2 py-1 transition-[color,background-color] duration-(--duration-normal) ease-out", children: [_jsx(Home, { className: "size-3.5 shrink-0" }), tI18nHardcoded.raw('i18nComplete.text3a78695388b3')] }), _jsx("span", { "aria-hidden": true, className: "text-muted-foreground shrink-0 text-sm select-none", children: "/" })] })), _jsxs("div", { className: "flex min-w-0 items-center gap-0.5", children: [isRenaming && projectSession ? (
|
|
281
299
|
// Starts from the name on screen, not `sessionDisplayLabel`:
|
|
282
300
|
// that one falls back to a uuid slice for an untitled session.
|
|
283
301
|
_jsx(SessionTitleInput, { initialValue: headerTitle, ariaLabel: tI18nHardcoded.raw('autoFeaturesCoWorkerProjectSidebarModalRenameSessionModalJsx265e123d'), onCommit: (name) => {
|
|
@@ -293,12 +311,12 @@ export function SessionSiteHeader({ sessionId, sessionTitle, isMobileView, leadi
|
|
|
293
311
|
_jsx(SubagentHoverCard, { projectId: projectId, projectSessionId: projectSessionId, subsessions: subsessions, spawnedSessions: childSessions.sessions, onLoadMore: childSessions.hasNextPage ? () => { void childSessions.fetchNextPage(); } : undefined, loadingMore: childSessions.isFetchingNextPage, children: titleButton })) : canRename ? (_jsx(Hint, { side: "bottom", sideOffset: 4, delayDuration: 300, label: tI18nHardcoded.raw('autoFeaturesCoWorkerProjectSidebarModalRenameSessionModalJsx265e123d'), children: titleButton })) : (
|
|
294
312
|
// Share viewer and instant shell: no project session row, so
|
|
295
313
|
// nothing to rename. The name is plain text.
|
|
296
|
-
_jsx("span", { className: "text-foreground min-w-0 truncate px-2.5 text-sm font-medium", children: headerTitle })), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": tI18nHardcoded.raw('componentsProjectsProjectSessionList.line312JsxAttrAriaLabelSessionActions'), className: "text-
|
|
314
|
+
_jsx("span", { className: "text-foreground min-w-0 truncate px-2.5 text-sm font-medium", children: headerTitle })), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": tI18nHardcoded.raw('componentsProjectsProjectSessionList.line312JsxAttrAriaLabelSessionActions'), className: "text-foreground data-[state=open]:bg-card shrink-0 rounded-md transition-[color,background-color,transform] duration-(--duration-normal) ease-out active:scale-[0.96]", children: _jsx(CaretDownIcon, { className: "size-3.5" }) }) }), _jsx(DropdownMenuContent, { align: "start", className: "w-56", onCloseAutoFocus: (e) => {
|
|
297
315
|
if (!renameFromMenu.current)
|
|
298
316
|
return;
|
|
299
317
|
renameFromMenu.current = false;
|
|
300
318
|
e.preventDefault();
|
|
301
|
-
}, children: sessionActionItems })] })] }), leadingAction] }), _jsxs("div", { className: cn('pointer-events-auto flex items-center gap-1.5', sidebarHidden && 'h-[var(--kx-titlebar-control-size)]'), children: [_jsx(SessionChangesIndicator, { sessionId: sessionId }), _jsx(SessionPendingApprovalsIndicator, { sessionId: sessionId }), isProjectSession ? _jsx(SessionGoalIndicator, {}) : null, isProjectSession ? _jsx(SessionRemindersIndicator, { runtimeSessionId: sessionId }) : null, isProjectSession && (_jsx(SessionConfigIndicator, { projectId: projectId, sessionId: projectSessionId, chatSessionId: sessionId, baseRef: projectSession?.base_ref, reload: reloadConfig.reload, isPending: reloadConfig.isPending, phase: reloadConfig.phase, canReload: canManageLifecycle })), _jsx("div", { className: "hidden items-center gap-1.5 lg:flex", children: devTools.map(({ view, label, Icon }) => (_jsx(Hint, { side: "bottom", sideOffset: 4, delayDuration: 300, label: label, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": label, onClick: () => openSessionQuickView(view, 'header'), className: "text-
|
|
319
|
+
}, children: sessionActionItems })] })] }), leadingAction] }), _jsxs("div", { className: cn('pointer-events-auto flex items-center gap-1.5', sidebarHidden && 'h-[var(--kx-titlebar-control-size)]'), children: [_jsx(SessionChangesIndicator, { sessionId: sessionId }), _jsx(SessionPendingApprovalsIndicator, { sessionId: sessionId }), isProjectSession ? _jsx(SessionGoalIndicator, {}) : null, isProjectSession ? _jsx(SessionRemindersIndicator, { runtimeSessionId: sessionId }) : null, isProjectSession && (_jsx(SessionConfigIndicator, { projectId: projectId, sessionId: projectSessionId, chatSessionId: sessionId, baseRef: projectSession?.base_ref, reload: reloadConfig.reload, isPending: reloadConfig.isPending, phase: reloadConfig.phase, canReload: canManageLifecycle })), _jsx(Hint, { side: "bottom", sideOffset: 4, delayDuration: 300, label: _jsxs("span", { className: "flex items-center gap-1.5", children: [rightPaneLabel, !isMobileViewport && (_jsxs(KbdGroup, { children: [_jsx(Kbd, { className: "font-mono", children: modKey }), _jsx(Kbd, { className: "font-mono", children: "I" })] }))] }), children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": rightPaneLabel, "aria-expanded": rightPaneOpen, "aria-keyshortcuts": isMobileViewport ? undefined : 'Meta+I Control+I', onClick: !isMobileViewport && isDetailPanelOpen ? toggleRightPanel : toggleActionPanel, "data-state": rightPaneOpen ? 'open' : 'closed', className: "text-foreground data-[state=open]:bg-card cursor-pointer transition-colors active:scale-[0.96]", children: _jsxs("span", { className: "relative inline-flex", children: [_jsx(ListBulletsIcon, { className: "size-4" }), readyChip?.sessionId === sessionId && !rightPaneOpen && (_jsx("span", { className: "bg-kortix-green ring-background absolute -top-1 -right-1 size-2 rounded-full ring-2", "aria-hidden": true }))] }) }) }), _jsx("div", { className: "hidden items-center gap-1.5 lg:flex", children: devTools.map(({ view, label, Icon }) => (_jsx(Hint, { side: "bottom", sideOffset: 4, delayDuration: 300, label: label, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": label, onClick: () => openSessionQuickView(view, 'header'), className: "text-foreground cursor-pointer transition-colors active:scale-[0.96]", children: _jsx(Icon, { className: "h-4 w-4" }) }) }, view))) }), _jsxs(DropdownMenu, { children: [_jsx(Hint, { side: "bottom", sideOffset: 4, delayDuration: 300, label: tI18nHardcoded.raw('i18nComplete.text96f0c06bbcb7'), children: _jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": tI18nHardcoded.raw('i18nComplete.text96f0c06bbcb7'), className: "text-foreground cursor-pointer transition-colors active:scale-[0.96] lg:hidden", children: _jsx(Code2, { className: "h-4 w-4" }) }) }) }), _jsx(DropdownMenuContent, { align: "end", className: "w-44", children: devTools.map(({ view, label, Icon }) => (_jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => openSessionQuickView(view, 'header'), children: [_jsx(Icon, {}), label] }, view))) })] }), isProjectSession && projectSession && (_jsx(SessionParticipantStack, { participants: sessionParticipants })), isProjectSession && projectSession && ShareSessionModal && (_jsx(Hint, { side: "bottom", sideOffset: 4, delayDuration: 300, label: shareLabel, open: isMobileViewport ? undefined : false, children: _jsxs(Button, { variant: "ghost", size: "xs", "aria-label": shareLabel, onClick: () => setShareOpen(true), className: "cursor-pointer rounded-md active:scale-[0.96] max-md:w-7 max-md:has-[>svg]:px-0", children: [_jsx(Share, {}), _jsx("span", { className: "hidden md:inline", children: tI18nHardcoded.raw('i18nComplete.text29887a5ff984') })] }) }))] })] }), isProjectSession && _jsx(PreviousRepositoryNotice, {})] }), _jsx(ExportTranscriptModal, { sessionId: sessionId, kortixSessionScope: isProjectSession ? `${projectId}/${projectSessionId}` : undefined, open: exportOpen, onOpenChange: setExportOpen }), _jsx(CompactModal, { sessionId: sessionId, open: compactOpen, onOpenChange: setCompactOpen }), isProjectSession && (_jsxs(_Fragment, { children: [_jsx(SessionConfigReloadConfirm, { busyReason: reloadConfig.busyReason, isPending: reloadConfig.isPending, onConfirm: () => reloadConfig.reload({ force: true }), onDismiss: reloadConfig.clearBusy }), ShareSessionModal && (_jsx(ShareSessionModal, { projectId: projectId, session: projectSession, open: shareOpen, onOpenChange: setShareOpen, onSaved: () => queryClient.invalidateQueries({
|
|
302
320
|
queryKey: qk.project.sessionsScope(projectId ?? ''),
|
|
303
321
|
}) })), _jsx(SessionDeleteModal, { projectId: projectId, sessionId: projectSessionId, sessionLabel: projectTitle, open: deleteOpen, onOpenChange: setDeleteOpen, onDeleted: () => router.push(uiRoutes().project(projectId)) })] }))] }));
|
|
304
322
|
}
|
|
@@ -169,5 +169,5 @@ export const SandboxUrlDetector = ({ content, isStreaming = false, genui = false
|
|
|
169
169
|
// that should not appear in the UI.
|
|
170
170
|
const rawContent = typeof content === 'string' ? content : content ? String(content) : '';
|
|
171
171
|
const safeContent = stripKortixSystemTags(rawContent);
|
|
172
|
-
return _jsx(UnifiedMarkdown, { content: safeContent, trust: "agent", isStreaming: isStreaming, genui: genui });
|
|
172
|
+
return _jsx(UnifiedMarkdown, { content: safeContent, trust: "agent", isStreaming: isStreaming, genui: genui, lineBreaks: "chat" });
|
|
173
173
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { CreditCardIcon, ImageBrokenIcon, KeyIcon } from '@phosphor-icons/react';
|
|
4
|
-
import { AnimatePresence, m
|
|
4
|
+
import { AnimatePresence, m } from 'motion/react';
|
|
5
|
+
import { useReducedMotion } from '../../internal/hooks/use-reduced-motion.js';
|
|
5
6
|
import { useContext, useState } from 'react';
|
|
6
7
|
import { useTranslations } from '../../i18n/index.js';
|
|
7
8
|
import { Button } from '../../primitives/button.js';
|
|
@@ -391,7 +391,7 @@ export function ModelSelector({ models, selectedModel, onSelect, defaultControls
|
|
|
391
391
|
// model name truncates; the controls beside it keep their width.
|
|
392
392
|
className: cn('min-w-0 shrink rounded-lg hit-area-y-3', triggerVariant === 'ghost' && 'text-muted-foreground'), children: [_jsx("span", { className: cn('max-w-30 truncate', triggerLabelClassName), children: triggerLabel }), showEffort && (_jsx("span", { className: "shrink-0", children: currentEffort ? effortLabel(currentEffort) : t('auto') })), _jsx(ChevronDown, { className: cn('duration-moderate size-3 transition-transform ease-out', open && 'rotate-180') })] })) }), _jsx(CommandPopoverContent, { side: "top", align: "start", sideOffset: 8, className: showEffort
|
|
393
393
|
? 'w-[min(38rem,calc(100vw-1.5rem))]'
|
|
394
|
-
: 'w-[min(28rem,calc(100vw-1.5rem))]', children: _jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx(ModelPickerPanel, { browseModels: browseModels, pickableModels: pickableModels, searchModels: visibleModels, search: search, onSearchChange: setSearch, searchRight: searchRight, selected: availableSelectedModel ?? null, onPick: handleSelect, isFavorite: pickerModelStore.isFavorite, setFavorite: pickerModelStore.setFavorite, loading: modelsLoading || entitlementsPending, emptyState: noModelsState, searchEmpty: searchEmptyState, onConnectChatGpt: chatGptAvailable ? handleOpenChatGpt : undefined, onForeignDialog: closePicker, connectLabel: tPooled('connect'), effort: showEffort
|
|
394
|
+
: 'w-[min(28rem,calc(100vw-1.5rem))]', children: _jsxs("div", { className: "bg-surface flex min-w-0 flex-col", children: [_jsx(ModelPickerPanel, { browseModels: browseModels, pickableModels: pickableModels, searchModels: visibleModels, search: search, onSearchChange: setSearch, searchRight: searchRight, selected: availableSelectedModel ?? null, onPick: handleSelect, isFavorite: pickerModelStore.isFavorite, setFavorite: pickerModelStore.setFavorite, loading: modelsLoading || entitlementsPending, emptyState: noModelsState, searchEmpty: searchEmptyState, onConnectChatGpt: chatGptAvailable ? handleOpenChatGpt : undefined, onForeignDialog: closePicker, connectLabel: tPooled('connect'), effort: showEffort
|
|
395
395
|
? {
|
|
396
396
|
choices: effortChoices,
|
|
397
397
|
selectedVariant: reasoning?.selectedVariant,
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import type { SubscriptionUsage, SubscriptionUsageWindow } from '@kortix/sdk';
|
|
24
24
|
import { type FlatModel } from '@kortix/sdk/react';
|
|
25
|
+
import { type UsageTone } from './subscription-windows.js';
|
|
25
26
|
/** The provider whose pooled logins pay for a subscription model. Null for every other model. */
|
|
26
27
|
export declare function subscriptionProviderOf(model: Pick<FlatModel, 'providerID' | 'modelID'> & {
|
|
27
28
|
provider?: string | null;
|
|
@@ -35,3 +36,9 @@ export declare function peakBlockingWindow(usage: SubscriptionUsage | null | und
|
|
|
35
36
|
export declare function SubscriptionSwitcher({ providerId }: {
|
|
36
37
|
providerId: 'codex' | 'claude-agent';
|
|
37
38
|
}): import("react").JSX.Element | null;
|
|
39
|
+
/** A login's usage at a glance: a short bar in the tone's hue, then its label. */
|
|
40
|
+
export declare function SubscriptionRowMeter({ text, percent, tone }: {
|
|
41
|
+
text: string;
|
|
42
|
+
percent: number;
|
|
43
|
+
tone: UsageTone;
|
|
44
|
+
}): import("react").JSX.Element;
|
|
@@ -7,7 +7,8 @@ import { SolidCheckIcon } from '../../internal/icons/solid-check-icon.js';
|
|
|
7
7
|
import { cn } from '../../lib/utils.js';
|
|
8
8
|
import { useSessionIds } from '../../providers/session-ids.js';
|
|
9
9
|
import { isClaudeSubscriptionModel, isSubscriptionModel } from './model-tags.js';
|
|
10
|
-
import
|
|
10
|
+
import Loading from '../../primitives/loading.js';
|
|
11
|
+
import { accountLine, isBlockingWindow, loginLimit, USAGE_TONE_BAR, usageTone, windowLabel, } from './subscription-windows.js';
|
|
11
12
|
import { useProviderKeyChoices } from '../overrides/provider-secret-pool-editor.js';
|
|
12
13
|
/** The provider whose pooled logins pay for a subscription model. Null for every other model. */
|
|
13
14
|
export function subscriptionProviderOf(model) {
|
|
@@ -58,6 +59,8 @@ export function SubscriptionSwitcher({ providerId }) {
|
|
|
58
59
|
const pick = (secretId) => {
|
|
59
60
|
void pools.setPool.mutateAsync({ providerId, secretIds: secretId ? [secretId] : null });
|
|
60
61
|
};
|
|
62
|
+
// The row a save is applying: it shows the pending glyph in its check slot.
|
|
63
|
+
const pendingId = pending ? (pools.setPool.variables?.secretIds?.[0] ?? null) : undefined;
|
|
61
64
|
const rows = [
|
|
62
65
|
{ secretId: null, label: t('projectDefaultShort'), line: t('subscriptionSwitcherDefault'), window: null, limited: false, broken: false },
|
|
63
66
|
...logins.map((secret) => {
|
|
@@ -81,17 +84,56 @@ export function SubscriptionSwitcher({ providerId }) {
|
|
|
81
84
|
if (event.metaKey || event.ctrlKey || event.altKey)
|
|
82
85
|
return;
|
|
83
86
|
event.stopPropagation();
|
|
84
|
-
if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp')
|
|
85
|
-
return;
|
|
86
|
-
event.preventDefault();
|
|
87
87
|
const radios = Array.from(event.currentTarget.querySelectorAll('[role="radio"]'));
|
|
88
88
|
const index = radios.indexOf(document.activeElement);
|
|
89
|
-
const
|
|
90
|
-
|
|
89
|
+
const next = event.key === 'ArrowDown' ? (index + 1) % radios.length
|
|
90
|
+
: event.key === 'ArrowUp' ? (index - 1 + radios.length) % radios.length
|
|
91
|
+
: event.key === 'Home' ? 0
|
|
92
|
+
: event.key === 'End' ? radios.length - 1
|
|
93
|
+
: null;
|
|
94
|
+
if (next === null)
|
|
95
|
+
return;
|
|
96
|
+
event.preventDefault();
|
|
97
|
+
radios[next]?.focus();
|
|
91
98
|
};
|
|
92
|
-
return (
|
|
99
|
+
return (
|
|
100
|
+
// `border-t`: the pane spans the picker's full width under the rail, the
|
|
101
|
+
// list and the effort pane, so one rule closes all three above it.
|
|
102
|
+
_jsxs("div", { className: "border-t", children: [_jsx("div", { className: "text-muted-foreground flex h-9 shrink-0 items-center border-b px-3 text-sm", children: t('subscriptionSwitcher') }), _jsx("div", { role: "radiogroup", "aria-label": t('subscriptionSwitcher'), onKeyDown: onKeyDown, className: "flex flex-col gap-px p-1.5", children: rows.map((row) => {
|
|
93
103
|
const checked = row.secretId === pinnedId || (row.secretId === null && pinnedId === null);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
104
|
+
// A limit outranks the window: a provider can refuse a login while
|
|
105
|
+
// no window it reports is still in force.
|
|
106
|
+
const meter = row.limited
|
|
107
|
+
? { percent: 100, tone: 'limited', text: tUsage('limitReached') }
|
|
108
|
+
: row.window
|
|
109
|
+
? {
|
|
110
|
+
percent: Math.round(row.window.used_percent),
|
|
111
|
+
tone: usageTone(row.window, false),
|
|
112
|
+
text: `${windowLabel(row.window.id, tUsage)} · ${tUsage('percent', { percent: Math.round(row.window.used_percent) })}`,
|
|
113
|
+
}
|
|
114
|
+
: null;
|
|
115
|
+
// One status per row, in one right-hand slot: a broken login cannot
|
|
116
|
+
// run a turn, so that outranks its last usage.
|
|
117
|
+
const status = row.broken ? (_jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: t('needsReconnection') })) : meter ? (_jsx(SubscriptionRowMeter, { ...meter })) : row.secretId ? (_jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: tUsage('notReported') })) : null;
|
|
118
|
+
return (_jsxs("button", { type: "button", role: "radio", "aria-checked": checked, "aria-label": row.secretId ? t('subscriptionSwitcherUse', { label: row.label }) : undefined, "aria-busy": pendingId === row.secretId || undefined, tabIndex: checked ? 0 : -1,
|
|
119
|
+
// A save in flight blocks a second pick with `aria-disabled`, not
|
|
120
|
+
// `disabled`: a disabled button drops the keyboard focus it holds.
|
|
121
|
+
disabled: !canEdit, "aria-disabled": pending || undefined, onClick: () => {
|
|
122
|
+
if (!pending)
|
|
123
|
+
pick(row.secretId);
|
|
124
|
+
}, className: cn(
|
|
125
|
+
// One line per row, the model rows' shape: the name in ink, its
|
|
126
|
+
// account line muted after it, the status and the check in
|
|
127
|
+
// fixed slots so every meter lines up. `h-12` (44px) is the touch row.
|
|
128
|
+
'flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-left text-sm outline-none sm:h-9', 'hover:bg-hover focus-visible:bg-hover focus-visible:ring-kortix-base transition-colors duration-fast focus-visible:ring-2',
|
|
129
|
+
// Read-only rows dim; a save in flight keeps full ink, and
|
|
130
|
+
// the spinner says which row it applies.
|
|
131
|
+
'disabled:pointer-events-none disabled:opacity-50', checked && 'bg-active hover:bg-active'), children: [_jsxs("span", { className: "min-w-0 flex-1 truncate", title: row.line ?? undefined, children: [_jsx("span", { className: "text-foreground font-medium", children: row.label }), row.line ? _jsxs("span", { className: "text-muted-foreground", children: [" ", row.line] }) : null] }), status, _jsx("span", { className: "flex size-4 shrink-0 items-center justify-center", children: pendingId === row.secretId ? (
|
|
132
|
+
// `!`: Loading paints itself `text-background` inside a button (a filled one); this row is transparent.
|
|
133
|
+
_jsx(Loading, { className: "text-muted-foreground! size-3.5" })) : checked ? (_jsx(SolidCheckIcon, { className: "text-ring size-4" })) : null })] }, row.secretId ?? 'default'));
|
|
134
|
+
}) }), canEdit ? null : _jsx("p", { className: "text-muted-foreground px-3 pb-2 text-xs", children: t('readOnlyPool') })] }));
|
|
135
|
+
}
|
|
136
|
+
/** A login's usage at a glance: a short bar in the tone's hue, then its label. */
|
|
137
|
+
export function SubscriptionRowMeter({ text, percent, tone }) {
|
|
138
|
+
return (_jsxs("span", { className: "text-muted-foreground flex shrink-0 items-center gap-2 text-xs tabular-nums", "data-subscription-usage-row": "", children: [_jsx("span", { className: "bg-muted block h-1 w-10 overflow-hidden rounded-full", "aria-hidden": true, children: _jsx("span", { className: cn('block h-full', USAGE_TONE_BAR[tone]), style: { width: `${Math.min(100, percent)}%` } }) }), _jsx("span", { className: "max-w-72 truncate", children: text })] }));
|
|
97
139
|
}
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
import type { SubscriptionAccount, SubscriptionUsage, SubscriptionUsageWindow } from '@kortix/sdk';
|
|
8
8
|
import type { useTranslations } from '../../i18n/index.js';
|
|
9
9
|
export type UsageTone = 'ok' | 'near' | 'critical' | 'limited';
|
|
10
|
+
/** The bar fill of each tone: the provider sheet's meters and the picker's subscription rows. */
|
|
11
|
+
export declare const USAGE_TONE_BAR: Record<UsageTone, string>;
|
|
10
12
|
/** Warn at 80%, turn red at 95%, and distinguish a provider-enforced limit. */
|
|
11
13
|
export declare function usageTone(window: SubscriptionUsageWindow, limited: boolean): UsageTone;
|
|
12
14
|
/**
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** The bar fill of each tone: the provider sheet's meters and the picker's subscription rows. */
|
|
2
|
+
export const USAGE_TONE_BAR = { ok: 'bg-primary', near: 'bg-kortix-orange', critical: 'bg-kortix-red', limited: 'bg-kortix-red' };
|
|
1
3
|
/** Warn at 80%, turn red at 95%, and distinguish a provider-enforced limit. */
|
|
2
4
|
export function usageTone(window, limited) {
|
|
3
5
|
if (window.used_percent >= 100 || (limited && window.used_percent >= 90))
|
|
@@ -44,7 +44,7 @@ import { createContext, useCallback, useContext, useEffect, useMemo, useRef } fr
|
|
|
44
44
|
import { useProjectContext } from '../../files/project/context.js';
|
|
45
45
|
// NOT `@kortix/sdk/react`'s change-request hook. See the note above — this is
|
|
46
46
|
// a cache-coherence requirement, not a style preference.
|
|
47
|
-
import {
|
|
47
|
+
import { changeRequestKeys, invalidateTurnChangeRequestReads, useSessionChangeRequests, } from '../../files/project/hooks/use-change-requests.js';
|
|
48
48
|
import { usePublishSessionChangeRequests } from './session-outcomes-bridge.js';
|
|
49
49
|
import { useProjectCan } from '../../internal/lib/use-project-can.js';
|
|
50
50
|
import { PROJECT_ACTIONS } from '../../internal/lib/project-actions.js';
|
|
@@ -67,7 +67,7 @@ export function SessionOutcomesProvider({ projectSessionId, turnSpans, busy, onO
|
|
|
67
67
|
const { allowed } = useProjectCan(projectId, PROJECT_ACTIONS.PROJECT_GITOPS_READ);
|
|
68
68
|
const { data } = useSessionChangeRequests(projectSessionId, { refetchInterval: busy ? 5_000 : 60_000, enabled: allowed });
|
|
69
69
|
const requests = useMemo(() => allowed ? (data?.change_requests ?? []) : [], [allowed, data?.change_requests]);
|
|
70
|
-
useRefreshChangeRequestsOnTurnEnd(busy);
|
|
70
|
+
useRefreshChangeRequestsOnTurnEnd(busy, projectSessionId);
|
|
71
71
|
const all = useMemo(
|
|
72
72
|
// Change requests are the only outcome a turn produces. The derived
|
|
73
73
|
// pipeline (files, schedules, background tasks, connector links) was built
|
|
@@ -109,20 +109,27 @@ export function SessionOutcomesProvider({ projectSessionId, turnSpans, busy, onO
|
|
|
109
109
|
* (KRTX-3009, KRTX-3010). Only the busy -> idle edge reads: mounting an idle
|
|
110
110
|
* session already fetches.
|
|
111
111
|
*/
|
|
112
|
-
function useRefreshChangeRequestsOnTurnEnd(busy) {
|
|
112
|
+
function useRefreshChangeRequestsOnTurnEnd(busy, sessionId) {
|
|
113
113
|
const qc = useQueryClient();
|
|
114
114
|
const projectId = useProjectContext()?.projectId ?? '';
|
|
115
|
-
|
|
115
|
+
// Now: this session's cards. After the settle delay, once, while the session
|
|
116
|
+
// stays idle: the cards again, the sidebar list and the review summary. A
|
|
117
|
+
// busy flicker cancels the settle read, so it costs only the cards' read.
|
|
118
|
+
const refreshCards = useCallback(() => {
|
|
119
|
+
if (projectId && sessionId)
|
|
120
|
+
void qc.invalidateQueries({ queryKey: changeRequestKeys.sessionList(projectId, sessionId), exact: true });
|
|
121
|
+
}, [qc, projectId, sessionId]);
|
|
122
|
+
const refreshAll = useCallback(() => invalidateTurnChangeRequestReads(qc, projectId, sessionId), [qc, projectId, sessionId]);
|
|
116
123
|
const wasBusy = useRef(busy);
|
|
117
124
|
useEffect(() => {
|
|
118
125
|
const ended = wasBusy.current && !busy;
|
|
119
126
|
wasBusy.current = busy;
|
|
120
127
|
if (!ended)
|
|
121
128
|
return;
|
|
122
|
-
|
|
123
|
-
const timer = setTimeout(
|
|
129
|
+
refreshCards();
|
|
130
|
+
const timer = setTimeout(refreshAll, CHANGE_REQUEST_SETTLE_MS);
|
|
124
131
|
return () => clearTimeout(timer);
|
|
125
|
-
}, [busy,
|
|
132
|
+
}, [busy, refreshCards, refreshAll]);
|
|
126
133
|
}
|
|
127
134
|
/** A turn's outcomes, oldest first. `EMPTY` is a module constant so a turn with
|
|
128
135
|
* no outcomes gets the SAME array every render and never re-renders for it. */
|
|
@@ -1,28 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* The action panel column's root (`session-action-panel-column.tsx` renders it
|
|
5
|
+
* beside the chat). It takes no props: everything the sections below need
|
|
6
|
+
* comes from `SessionPanelProvider`, which owns the session's panel state for
|
|
7
|
+
* both surfaces.
|
|
5
8
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* ADVANCED PANEL TEMPORARILY DISABLED: Easy is the one panel presentation
|
|
10
|
+
* (Easy Panel v2 spec, 2026-07-17). On desktop the Easy panel is the plan's
|
|
11
|
+
* ONLY surface (`planBelongsToChat` in turn/plan-anchor.ts): restoring
|
|
12
|
+
* `AdvancedPanel` without a Plan card of its own hides the plan.
|
|
10
13
|
*/
|
|
11
|
-
// import { AdvancedPanel } from './advanced/advanced-panel.js'; // ADVANCED PANEL TEMPORARILY DISABLED
|
|
12
14
|
import { EasyPanel } from './easy/easy-panel.js';
|
|
13
15
|
export function ActionPanel() {
|
|
14
|
-
// ADVANCED PANEL TEMPORARILY DISABLED — Easy is the one panel presentation
|
|
15
|
-
// (Easy Panel v2 spec, 2026-07-17). AdvancedPanel and the panelMode
|
|
16
|
-
// preference remain; do not restore the old request-discard effects.
|
|
17
|
-
//
|
|
18
|
-
// RE-ENABLING THIS LOSES THE PLAN unless Advanced grows a Plan card too.
|
|
19
|
-
// On desktop the Easy panel is the plan's ONLY surface — the transcript no
|
|
20
|
-
// longer takes it back when the panel is not drawing it (`planBelongsToChat`
|
|
21
|
-
// in turn/plan-anchor.ts, which explains why). `AdvancedPanel` is a
|
|
22
|
-
// tool-call stepper with no cards, so an advanced-mode user would see no
|
|
23
|
-
// plan anywhere. Give Advanced its own `PlanPanelCard`, or make this a
|
|
24
|
-
// condition in `planBelongsToChat` as a deliberate product call.
|
|
25
|
-
//
|
|
26
|
-
// return mode === 'advanced' ? <AdvancedPanel … /> : (
|
|
27
16
|
return _jsx(EasyPanel, {});
|
|
28
17
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type ShareContext } from '../../../files/viewer/viewer-actions.js';
|
|
3
|
-
export declare function AppPreview({ url, name, projectId, shareContext, onClose, onSendToAgent, }: {
|
|
3
|
+
export declare function AppPreview({ url, name, projectId, shareContext, onClose, onSendToAgent, historyKey, }: {
|
|
4
4
|
/** The internal sandbox URL the agent handed over, e.g. http://localhost:3000. */
|
|
5
5
|
url: string;
|
|
6
|
+
/** Keeps the page and its Back/Forward across remounts (a switch to
|
|
7
|
+
* Terminal and back), per session. See `frame-history.ts`. */
|
|
8
|
+
historyKey?: string;
|
|
6
9
|
name: string;
|
|
7
10
|
/** Lists the project's Apps on the no-app landing. */
|
|
8
11
|
projectId?: string;
|
|
@@ -36,12 +36,15 @@ import { useBrowserRecentsStore } from '../../../internal/stores/browser-recents
|
|
|
36
36
|
import { probePreviewPort } from '@kortix/sdk';
|
|
37
37
|
import { useRuntimeConnectionStore } from '@kortix/sdk/react';
|
|
38
38
|
import { ArrowSquareOutIcon, GlobeIcon as Globe, SparkleIcon as SparklesSolid, WarningIcon, } from '@phosphor-icons/react';
|
|
39
|
-
import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore, } from 'react';
|
|
39
|
+
import { useCallback, useEffect, useMemo, useLayoutEffect, useRef, useState, useSyncExternalStore, } from 'react';
|
|
40
40
|
import { PreviewLoadingOverlay, SandboxAddressBar, } from '../../../browser/sandbox-browser-chrome.js';
|
|
41
41
|
import { BrowserLanding } from '../../../browser/browser-landing.js';
|
|
42
42
|
import { CloseButton, DetailSidebarToggle } from './detail-view.js';
|
|
43
43
|
import { PREVIEW_MAX_WAIT_MS, PREVIEW_SLOW_MS, PREVIEW_PROBE_INTERVAL_MS, previewErrorReason, previewSlowReason, previewLoadSuccessState, previewLoadVerdict, runtimeSandboxHealth, sandboxRecents, shouldArmLoadTimeout, shouldKeepProbingPort, } from './easy-panel-logic.js';
|
|
44
44
|
import { PanelWidthButton, ViewerActions } from '../../../files/viewer/viewer-actions.js';
|
|
45
|
+
import { currentEntry, frameReportOf, initialFrameHistory, NEW_FRAME_TRACKER, pushEntry, reduceFrameReport, rememberFrameHistory, reportedFrameUrl, retargetPreviewUrl, } from './frame-history.js';
|
|
46
|
+
import { SESSION_BAR_CLASS } from '../../../internal/layout/panel-chrome.js';
|
|
47
|
+
import { cn } from '../../../lib/utils.js';
|
|
45
48
|
// zustand v5's own hook feeds React's `useSyncExternalStore` a
|
|
46
49
|
// `getServerSnapshot` pinned to `getInitialState()` — correct for real SSR
|
|
47
50
|
// (sandbox health can only ever be learned from a client-side poll, so it is
|
|
@@ -58,26 +61,41 @@ const getSandboxHealthSnapshot = () => {
|
|
|
58
61
|
initialCheckDone: s.initialCheckDone,
|
|
59
62
|
});
|
|
60
63
|
};
|
|
61
|
-
export function AppPreview({ url, name, projectId, shareContext, onClose, onSendToAgent, }) {
|
|
64
|
+
export function AppPreview({ url, name, projectId, shareContext, onClose, onSendToAgent, historyKey, }) {
|
|
62
65
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
63
66
|
// The app runs on localhost *inside the sandbox*, which the browser cannot
|
|
64
67
|
// reach. The proxy is what makes it openable at all.
|
|
65
68
|
const { proxyUrl } = useSandboxProxy();
|
|
66
|
-
// History of internal (localhost) URLs. Back/forward are real, not decorative
|
|
67
|
-
|
|
68
|
-
const [
|
|
69
|
-
const current =
|
|
69
|
+
// History of internal (localhost) URLs. Back/forward are real, not decorative:
|
|
70
|
+
// the frame's own navigations land here through the preview bridge (D-05).
|
|
71
|
+
const [frameHistory, setFrameHistory] = useState(() => initialFrameHistory(historyKey, url));
|
|
72
|
+
const current = currentEntry(frameHistory);
|
|
73
|
+
// The address the frame was LOADED with. It differs from `current` after a
|
|
74
|
+
// navigation inside the frame: the frame got there itself, so its `src`
|
|
75
|
+
// must not change, or the panel would reload the page it is already on.
|
|
76
|
+
const [frameUrl, setFrameUrl] = useState(current);
|
|
77
|
+
// True until the frame reports the address of the page the panel loaded.
|
|
78
|
+
const settlingRef = useRef(true);
|
|
79
|
+
// What `reduceFrameReport` remembers between this frame's reports, and the
|
|
80
|
+
// history it last produced (reports can outrun a render).
|
|
81
|
+
const trackerRef = useRef(NEW_FRAME_TRACKER);
|
|
82
|
+
const historyRef = useRef(frameHistory);
|
|
83
|
+
const iframeRef = useRef(null);
|
|
70
84
|
// The quick-view "Open Browser" with no running app hands over url: '' —
|
|
71
85
|
// no port to load, nothing to spin on. Land on the address bar instead.
|
|
72
|
-
const noApp = !
|
|
86
|
+
const noApp = !frameUrl;
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (historyKey)
|
|
89
|
+
rememberFrameHistory(historyKey, frameHistory);
|
|
90
|
+
}, [historyKey, frameHistory]);
|
|
73
91
|
// The landing's "Recents" — the shared history BrowserPanel also shows,
|
|
74
92
|
// filtered to sandbox ports (the only URLs this address bar will open).
|
|
75
93
|
const recents = useBrowserRecentsStore((s) => s.recents);
|
|
76
94
|
const localhostRecents = useMemo(() => sandboxRecents(recents), [recents]);
|
|
77
95
|
const port = useMemo(() => parseLocalhostUrl(current)?.port ?? 0, [current]);
|
|
78
|
-
const proxied = useMemo(() => proxyUrl(
|
|
96
|
+
const proxied = useMemo(() => proxyUrl(frameUrl) ?? frameUrl, [proxyUrl, frameUrl]);
|
|
79
97
|
// Null while the token or the host's URL (`UiProvider resolvePreviewUrl`) resolves.
|
|
80
|
-
const hostPreview = usePreviewFrameUrl(
|
|
98
|
+
const hostPreview = usePreviewFrameUrl(frameUrl, proxied, shareContext ?? (projectId ? { projectId } : undefined));
|
|
81
99
|
const authenticatedUrl = hostPreview.url;
|
|
82
100
|
// A project App frames signed in, on its own origin (`useAppInBrowser`).
|
|
83
101
|
const { app, apps, src: previewUrl } = useAppInBrowser(projectId, authenticatedUrl);
|
|
@@ -207,34 +225,78 @@ export function AppPreview({ url, name, projectId, shareContext, onClose, onSend
|
|
|
207
225
|
if (noApp)
|
|
208
226
|
focusWithoutScroll(addressRef.current);
|
|
209
227
|
}, [noApp]);
|
|
210
|
-
|
|
228
|
+
// Every load the panel starts goes through here. The frame is keyed on its
|
|
229
|
+
// resolved `src` (below), so a new address mounts a fresh frame once its
|
|
230
|
+
// authenticated URL resolves. Only the SAME address needs `refreshKey`.
|
|
231
|
+
// Bumping it for a new address remounted the OLD `src` while the new one
|
|
232
|
+
// resolved: two requests for one Refresh or Back. A fresh frame, never a
|
|
233
|
+
// `src` change, also keeps the tab's own history free of frame entries.
|
|
234
|
+
const frameUrlRef = useRef(frameUrl);
|
|
235
|
+
// Mirror the latest state for the callbacks above, after each commit.
|
|
236
|
+
useLayoutEffect(() => {
|
|
237
|
+
historyRef.current = frameHistory;
|
|
238
|
+
frameUrlRef.current = frameUrl;
|
|
239
|
+
}, [frameHistory, frameUrl]);
|
|
240
|
+
const load = useCallback((next) => {
|
|
241
|
+
settlingRef.current = true;
|
|
211
242
|
setIsLoading(true);
|
|
212
243
|
setHasError(false);
|
|
213
|
-
|
|
244
|
+
if (next === frameUrlRef.current)
|
|
245
|
+
setRefreshKey((k) => k + 1);
|
|
246
|
+
else
|
|
247
|
+
setFrameUrl(next);
|
|
214
248
|
}, []);
|
|
249
|
+
// Reload the page on screen, which can be one the frame navigated to.
|
|
250
|
+
const reload = useCallback(() => load(current), [load, current]);
|
|
251
|
+
// The bridge in the framed page reports each address it reaches
|
|
252
|
+
// (`apps/api/src/sandbox-proxy/preview-bridge.ts`). Only the frame this
|
|
253
|
+
// panel mounted is heard. A page without the bridge (a strict CSP, a Kortix
|
|
254
|
+
// App on its own origin) reports nothing, and the address stays on what the
|
|
255
|
+
// panel loaded.
|
|
256
|
+
useEffect(() => {
|
|
257
|
+
const onMessage = (event) => {
|
|
258
|
+
const frame = iframeRef.current?.contentWindow;
|
|
259
|
+
if (!frame || event.source !== frame)
|
|
260
|
+
return;
|
|
261
|
+
const reported = reportedFrameUrl(event.data, frameUrl);
|
|
262
|
+
if (!reported)
|
|
263
|
+
return;
|
|
264
|
+
const result = reduceFrameReport(historyRef.current, trackerRef.current, frameReportOf(event.data, reported, settlingRef.current));
|
|
265
|
+
settlingRef.current = false;
|
|
266
|
+
trackerRef.current = result.tracker;
|
|
267
|
+
historyRef.current = result.history;
|
|
268
|
+
setFrameHistory(result.history);
|
|
269
|
+
};
|
|
270
|
+
window.addEventListener('message', onMessage);
|
|
271
|
+
return () => window.removeEventListener('message', onMessage);
|
|
272
|
+
}, [frameUrl]);
|
|
215
273
|
const navigateTo = useCallback((next) => {
|
|
216
274
|
// Feed the shared recents (the same list BrowserPanel's landing shows)
|
|
217
275
|
// so the port map builds up from either surface.
|
|
218
276
|
useBrowserRecentsStore.getState().addRecent(next);
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
277
|
+
setFrameHistory((history) => pushEntry(history, next));
|
|
278
|
+
load(next);
|
|
279
|
+
}, [load]);
|
|
280
|
+
const canGoBack = frameHistory.index > 0;
|
|
281
|
+
const canGoForward = frameHistory.index < frameHistory.entries.length - 1;
|
|
282
|
+
// Back/Forward reload the frame at the remembered address. A cross-origin
|
|
283
|
+
// frame's own `history` is not reachable from here.
|
|
284
|
+
const goTo = useCallback((index) => {
|
|
285
|
+
const target = frameHistory.entries[index];
|
|
286
|
+
if (target === undefined)
|
|
227
287
|
return;
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}, [
|
|
288
|
+
setFrameHistory((history) => ({ ...history, index }));
|
|
289
|
+
load(target);
|
|
290
|
+
}, [frameHistory.entries, load]);
|
|
291
|
+
const goBack = useCallback(() => {
|
|
292
|
+
if (canGoBack)
|
|
293
|
+
goTo(frameHistory.index - 1);
|
|
294
|
+
}, [canGoBack, goTo, frameHistory.index]);
|
|
231
295
|
const goForward = useCallback(() => {
|
|
232
|
-
if (
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}, [canGoForward, reload]);
|
|
237
|
-
return (_jsxs("div", { className: "bg-background flex h-full min-h-0 min-w-0 flex-col", children: [_jsx(AppPreviewToolbar, { previewUrl: previewUrl, onClose: onClose, displayValue: current, isLoading: isLoading, canGoBack: canGoBack, canGoForward: canGoForward, onBack: goBack, onForward: goForward, onReload: reload, onHome: () => navigateTo(''), onNavigate: navigateTo, suggestions: suggestions, inputRef: addressRef, trailing:
|
|
296
|
+
if (canGoForward)
|
|
297
|
+
goTo(frameHistory.index + 1);
|
|
298
|
+
}, [canGoForward, goTo, frameHistory.index]);
|
|
299
|
+
return (_jsxs("div", { className: "bg-background flex h-full min-h-0 min-w-0 flex-col", children: [_jsx(AppPreviewToolbar, { previewUrl: previewUrl, openUrl: previewUrl ? retargetPreviewUrl(previewUrl, frameUrl, current) : previewUrl, onClose: onClose, displayValue: current, isLoading: isLoading, canGoBack: canGoBack, canGoForward: canGoForward, onBack: goBack, onForward: goForward, onReload: reload, onHome: () => navigateTo(''), onNavigate: navigateTo, suggestions: suggestions, inputRef: addressRef, trailing:
|
|
238
300
|
// An app has no file to save and no text to put on a clipboard, so
|
|
239
301
|
// `Copy link` is the one copy action — the thing you can hand
|
|
240
302
|
// someone for a running port.
|
|
@@ -249,7 +311,7 @@ export function AppPreview({ url, name, projectId, shareContext, onClose, onSend
|
|
|
249
311
|
_jsx("div", { className: "flex h-full flex-col overflow-y-auto", children: _jsx(BrowserLanding, { projectId: projectId, recents: localhostRecents, empty: _jsx(SearchHint, {}), onOpen: (url) => {
|
|
250
312
|
const parsed = parseLocalhostUrl(url);
|
|
251
313
|
navigateTo(parsed ? toInternalUrl(parsed.port, parsed.path) : url);
|
|
252
|
-
} }) })) : hasPreview ? (_jsx("iframe", { src: previewUrl, title: title, className: "h-full w-full border-0", sandbox: framePolicy('app', previewUrl).sandbox, onLoad: () => {
|
|
314
|
+
} }) })) : hasPreview ? (_jsx("iframe", { ref: iframeRef, src: previewUrl, title: title, className: "h-full w-full border-0", sandbox: framePolicy('app', previewUrl).sandbox, onLoad: () => {
|
|
253
315
|
// A load is positive evidence the app is up, which overrides a
|
|
254
316
|
// `hasError` an earlier verdict set — otherwise the error card
|
|
255
317
|
// (absolute inset-0 z-10) keeps covering a working app until a
|
|
@@ -263,7 +325,7 @@ export function AppPreview({ url, name, projectId, shareContext, onClose, onSend
|
|
|
263
325
|
// A real error event is its own evidence — no probe needed.
|
|
264
326
|
setIsLoading(false);
|
|
265
327
|
setHasError(true);
|
|
266
|
-
} }, refreshKey)) : (
|
|
328
|
+
} }, `${refreshKey}:${previewUrl}`)) : (
|
|
267
329
|
// Auth token still resolving. A spinner, not an empty frame — an empty
|
|
268
330
|
// frame reads as "your app is broken".
|
|
269
331
|
_jsx("div", { className: "flex h-full items-center justify-center", children: _jsx(Loading, { className: "size-4" }) }))] })] }));
|
|
@@ -273,14 +335,14 @@ export function AppPreview({ url, name, projectId, shareContext, onClose, onSend
|
|
|
273
335
|
* width, close. Shared by the live preview and the booting card, so the two
|
|
274
336
|
* cannot drift.
|
|
275
337
|
*/
|
|
276
|
-
function AppPreviewToolbar({ previewUrl, onClose, ...address }) {
|
|
338
|
+
function AppPreviewToolbar({ previewUrl, openUrl, onClose, ...address }) {
|
|
277
339
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
278
340
|
const isMobile = useIsMobile();
|
|
279
|
-
return (_jsxs("div", { className:
|
|
341
|
+
return (_jsxs("div", { className: cn(SESSION_BAR_CLASS, 'gap-0.5 px-2'), children: [_jsx(DetailSidebarToggle, {}), _jsx(SandboxAddressBar, { ...address, hasPreview: !!previewUrl, placeholder: tI18nComplete.raw('text878abd024f27') }), _jsxs(ButtonGroup, { className: "shrink-0", children: [_jsx(Hint, { label: tI18nComplete.raw('text306ef19c8ac3'), side: "bottom", children: _jsx(Button, { variant: "secondary", size: "icon", disabled: !previewUrl, "aria-label": tI18nComplete.raw('text306ef19c8ac3'), onClick: () => {
|
|
280
342
|
if (!previewUrl)
|
|
281
343
|
return;
|
|
282
344
|
track('app_opened_new_tab');
|
|
283
|
-
window.open(previewUrl, '_blank', 'noopener,noreferrer');
|
|
345
|
+
window.open(openUrl || previewUrl, '_blank', 'noopener,noreferrer');
|
|
284
346
|
}, className: "size-7 shrink-0 active:scale-[0.96]", children: _jsx(ArrowSquareOutIcon, { className: "size-3.5" }) }) }), _jsx(PanelWidthButton, { isMobile: isMobile }), _jsx(CloseButton, { onClose: onClose })] })] }));
|
|
285
347
|
}
|
|
286
348
|
const noop = () => { };
|