@zyro-sec/app 0.0.0-stage → 1.0.1
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/AGENTS.md +234 -0
- package/README.md +106 -2
- package/bunfig.toml +3 -0
- package/component-tests/activity-chips.spec.ts +47 -0
- package/component-tests/browser-pane-restore.spec.ts +1294 -0
- package/component-tests/browser-pane.spec.ts +2338 -0
- package/component-tests/browser-settings.spec.ts +315 -0
- package/component-tests/browser-site-chooser.spec.ts +628 -0
- package/component-tests/components-lab.spec.ts +24 -0
- package/component-tests/composer.spec.ts +876 -0
- package/component-tests/debug-bar.spec.ts +237 -0
- package/component-tests/dialog-popups.spec.ts +49 -0
- package/component-tests/file-icon.spec.ts +14 -0
- package/component-tests/focus-rescue.fixture.tsx +30 -0
- package/component-tests/focus-rescue.spec.ts +83 -0
- package/component-tests/focus-ring.spec.ts +112 -0
- package/component-tests/fork-dialog.spec.ts +61 -0
- package/component-tests/grow.fixture.tsx +42 -0
- package/component-tests/grow.spec.ts +74 -0
- package/component-tests/image-preview.spec.ts +157 -0
- package/component-tests/input-surfaces.spec.ts +351 -0
- package/component-tests/line-comment.spec.ts +118 -0
- package/component-tests/list.spec.ts +7 -0
- package/component-tests/model-picker.spec.ts +45 -0
- package/component-tests/new-session-wordmark.spec.ts +135 -0
- package/component-tests/open-in-border.spec.ts +18 -0
- package/component-tests/pairing.spec.ts +40 -0
- package/component-tests/panel-sidebar-side.spec.ts +103 -0
- package/component-tests/plugin-graph.spec.ts +61 -0
- package/component-tests/plugin-host.fixture.tsx +995 -0
- package/component-tests/plugin-host.spec.ts +2362 -0
- package/component-tests/presence.fixture.tsx +59 -0
- package/component-tests/presence.spec.ts +104 -0
- package/component-tests/session-containment.fixture.tsx +79 -0
- package/component-tests/session-containment.spec.ts +145 -0
- package/component-tests/session-location-missing.spec.ts +52 -0
- package/component-tests/session-question-dock.spec.ts +1655 -0
- package/component-tests/sources-experiment.spec.ts +98 -0
- package/component-tests/ssh-reconnect.spec.ts +97 -0
- package/component-tests/subagent-bar.spec.ts +29 -0
- package/component-tests/terminal.spec.ts +148 -0
- package/component-tests/timeline-detail.spec.ts +311 -0
- package/component-tests/timeline-virtualizer.fixture.tsx +272 -0
- package/component-tests/timeline-virtualizer.spec.ts +269 -0
- package/component-tests/toast.spec.ts +23 -0
- package/component-tests/tooltip.spec.ts +169 -0
- package/component-tests/websearch.spec.ts +86 -0
- package/e2e/AGENTS.md +25 -0
- package/e2e/QUARANTINE.md +12 -0
- package/e2e/regression/background-read-failure.spec.ts +43 -0
- package/e2e/regression/btw-sidebar.spec.ts +339 -0
- package/e2e/regression/command-palette.spec.ts +822 -0
- package/e2e/regression/composer.spec.ts +1727 -0
- package/e2e/regression/directory-picker.spec.ts +133 -0
- package/e2e/regression/home.spec.ts +779 -0
- package/e2e/regression/mcp-workspace-toggle.spec.ts +695 -0
- package/e2e/regression/menu-scrollbars.spec.ts +78 -0
- package/e2e/regression/mobile-composer-submit-focus.spec.ts +88 -0
- package/e2e/regression/mobile-model-pickers.spec.ts +433 -0
- package/e2e/regression/mobile-plugin-drawers.spec.ts +194 -0
- package/e2e/regression/mobile-plugins.spec.ts +309 -0
- package/e2e/regression/mobile-session-options.spec.ts +101 -0
- package/e2e/regression/mobile-session.spec.ts +442 -0
- package/e2e/regression/mobile-timeline-scroll.spec.ts +919 -0
- package/e2e/regression/multi-server.spec.ts +498 -0
- package/e2e/regression/new-session.spec.ts +1666 -0
- package/e2e/regression/panel-edges.spec.ts +79 -0
- package/e2e/regression/patch-border.spec.ts +69 -0
- package/e2e/regression/patch-sticky-header.spec.ts +320 -0
- package/e2e/regression/review.spec.ts +2397 -0
- package/e2e/regression/session-header.spec.ts +1020 -0
- package/e2e/regression/session-location-sync.spec.ts +412 -0
- package/e2e/regression/session-notice-truncation.spec.ts +92 -0
- package/e2e/regression/session-panel-scrollbar.spec.ts +46 -0
- package/e2e/regression/session-queue.spec.ts +1704 -0
- package/e2e/regression/session-request-docks.spec.ts +719 -0
- package/e2e/regression/session-summary.spec.ts +1092 -0
- package/e2e/regression/session-timeline-accessibility.spec.ts +216 -0
- package/e2e/regression/session-timeline-locale-projection.spec.ts +24 -0
- package/e2e/regression/session-timeline-reducer-projection.spec.ts +53 -0
- package/e2e/regression/session-timeline-tool-projection.spec.ts +94 -0
- package/e2e/regression/session-websearch-dock.spec.ts +122 -0
- package/e2e/regression/settings-search.spec.ts +516 -0
- package/e2e/regression/settings-wsl.spec.ts +433 -0
- package/e2e/regression/settings.spec.ts +2901 -0
- package/e2e/regression/shell-panel-spacing.spec.ts +95 -0
- package/e2e/regression/side-panels.spec.ts +524 -0
- package/e2e/regression/subagent-child-navigation.spec.ts +540 -0
- package/e2e/regression/tabs.spec.ts +3294 -0
- package/e2e/regression/terminal.spec.ts +691 -0
- package/e2e/regression/timeline-cache.spec.ts +798 -0
- package/e2e/regression/timeline-geometry.spec.ts +1204 -0
- package/e2e/regression/timeline-history.spec.ts +1073 -0
- package/e2e/regression/timeline-stream.spec.ts +3409 -0
- package/e2e/regression/whats-new.spec.ts +242 -0
- package/e2e/reproduction/timeline-suspense/index.html +34 -0
- package/e2e/reproduction/timeline-suspense/main.tsx +335 -0
- package/e2e/reproduction/timeline-suspense/playwright.config.ts +34 -0
- package/e2e/reproduction/timeline-suspense/timeline-suspense.repro.ts +182 -0
- package/e2e/reproduction/timeline-suspense/vite.config.ts +7 -0
- package/e2e/screenshots/session-project-menu.png +0 -0
- package/e2e/service-worker/cache.spec.ts +573 -0
- package/e2e/service-worker/playwright.config.ts +14 -0
- package/e2e/stability/README.md +61 -0
- package/e2e/stability/adverse.spec.ts +279 -0
- package/e2e/stability/environment-matrix.spec.ts +128 -0
- package/e2e/stability/file-matrix.spec.ts +133 -0
- package/e2e/stability/file-mutation.spec.ts +126 -0
- package/e2e/stability/fixture.test.ts +80 -0
- package/e2e/stability/interaction.spec.ts +232 -0
- package/e2e/stability/lifecycle.spec.ts +175 -0
- package/e2e/stability/oracle-browser.spec.ts +81 -0
- package/e2e/stability/oracle.test.ts +388 -0
- package/e2e/stability/playwright.config.ts +31 -0
- package/e2e/stability/scroll-interaction.spec.ts +520 -0
- package/e2e/stability/shell-matrix.spec.ts +299 -0
- package/e2e/stability/tool-mutation.spec.ts +58 -0
- package/e2e/stability/tools.spec.ts +232 -0
- package/e2e/stability/transition-matrix.spec.ts +214 -0
- package/e2e/tsconfig.json +11 -0
- package/e2e/user-story/model-selection-flow.spec.ts +216 -0
- package/e2e/utils/app-direction.fixture.tsx +105 -0
- package/e2e/utils/app-direction.html +25 -0
- package/e2e/utils/app.ts +227 -0
- package/e2e/utils/command-palette.ts +62 -0
- package/e2e/utils/console.ts +23 -0
- package/e2e/utils/direction.ts +28 -0
- package/e2e/utils/drafts.ts +52 -0
- package/e2e/utils/errors.ts +14 -0
- package/e2e/utils/markdown-sessions.ts +120 -0
- package/e2e/utils/mock-api.ts +570 -0
- package/e2e/utils/mock-server.ts +1726 -0
- package/e2e/utils/notifications.ts +51 -0
- package/e2e/utils/persistent-pty.ts +546 -0
- package/e2e/utils/prompt-motion.ts +116 -0
- package/e2e/utils/serve.ts +65 -0
- package/e2e/utils/session-fixture.ts +472 -0
- package/e2e/utils/settings-wsl.fixture.tsx +416 -0
- package/e2e/utils/settings-wsl.html +27 -0
- package/e2e/utils/side-panel.ts +41 -0
- package/e2e/utils/sse-transport.ts +352 -0
- package/e2e/utils/terminal.ts +31 -0
- package/e2e/utils/timeline.ts +1141 -0
- package/e2e/utils/visual-stability/analyzer.ts +259 -0
- package/e2e/utils/visual-stability/capture.ts +57 -0
- package/e2e/utils/visual-stability/index.ts +15 -0
- package/e2e/utils/visual-stability/invariant.ts +113 -0
- package/e2e/utils/visual-stability/model.ts +47 -0
- package/e2e/utils/visual-stability/probe.ts +261 -0
- package/e2e/utils/visual-stability/regions.ts +18 -0
- package/e2e/utils/visual-stability/reporter.ts +71 -0
- package/e2e/utils/visual-stability/scenario.ts +21 -0
- package/e2e/utils/visual-stability.ts +52 -0
- package/e2e/utils/waits.ts +25 -0
- package/e2e/utils/windows-menu.fixture.tsx +99 -0
- package/e2e/utils/windows-menu.html +22 -0
- package/e2e/utils/workspace.ts +222 -0
- package/happydom.ts +77 -0
- package/index.html +29 -0
- package/manifest.json +36 -0
- package/package.json +83 -4
- package/perf/README.md +190 -0
- package/perf/composer.bench.ts +107 -0
- package/perf/desktop.bench.ts +22 -0
- package/perf/diff.bench.ts +104 -0
- package/perf/docks.bench.ts +109 -0
- package/perf/fixtures/composer.ts +166 -0
- package/perf/fixtures/diffs.ts +165 -0
- package/perf/fixtures/drag.ts +73 -0
- package/perf/fixtures/events.ts +106 -0
- package/perf/fixtures/home.ts +274 -0
- package/perf/fixtures/mock.ts +118 -0
- package/perf/fixtures/review.ts +33 -0
- package/perf/fixtures/scripts.ts +37 -0
- package/perf/fixtures/storage.ts +29 -0
- package/perf/fixtures/tabs.ts +21 -0
- package/perf/fixtures/timeline.ts +458 -0
- package/perf/home.bench.ts +74 -0
- package/perf/model-picker.bench.ts +168 -0
- package/perf/navigation.bench.ts +310 -0
- package/perf/question.bench.ts +85 -0
- package/perf/review.bench.ts +109 -0
- package/perf/send.bench.ts +54 -0
- package/perf/stream.bench.ts +108 -0
- package/perf/subagent-pill.bench.ts +348 -0
- package/perf/tabs.bench.ts +229 -0
- package/perf/timeline.bench.ts +167 -0
- package/playwright.components.config.ts +7 -0
- package/playwright.config.ts +85 -0
- package/public/_headers +28 -0
- package/public/assets/Inter.ttf +0 -0
- package/public/assets/JetBrainsMonoNerdFontMono-Bold.woff2 +0 -0
- package/public/assets/JetBrainsMonoNerdFontMono-Regular.woff2 +0 -0
- package/public/oc-theme-preload.js +33 -0
- package/src/app.tsx +142 -0
- package/src/components-lab/browser.tsx +745 -0
- package/src/components-lab/catalog.test.ts +58 -0
- package/src/components-lab/catalog.ts +195 -0
- package/src/components-lab/dialog-story-runtime.tsx +840 -0
- package/src/components-lab/focus-rings.stories.tsx +710 -0
- package/src/components-lab/focus-visibility.stories.tsx +2669 -0
- package/src/components-lab/force-focus.ts +52 -0
- package/src/components-lab/inspector.css +28 -0
- package/src/components-lab/lab.tsx +114 -0
- package/src/components-lab/machine.test.ts +177 -0
- package/src/components-lab/machine.ts +229 -0
- package/src/components-lab/motion.test.ts +17 -0
- package/src/components-lab/motion.ts +100 -0
- package/src/composer/adapter.ts +151 -0
- package/src/composer/attachments/attachments.css +123 -0
- package/src/composer/attachments/attachments.ts +363 -0
- package/src/composer/attachments/destination.ts +81 -0
- package/src/composer/attachments/upload-machine.ts +185 -0
- package/src/composer/attachments/uploads.test.ts +127 -0
- package/src/composer/attachments/uploads.tsx +228 -0
- package/src/composer/client-slash-command.test.ts +20 -0
- package/src/composer/client-slash-command.ts +28 -0
- package/src/composer/commands.tsx +175 -0
- package/src/composer/comment-focus-machine.test.ts +112 -0
- package/src/composer/comment-focus-machine.ts +141 -0
- package/src/composer/comment-note.test.ts +82 -0
- package/src/composer/comment-note.ts +127 -0
- package/src/composer/comments.test.ts +109 -0
- package/src/composer/comments.tsx +279 -0
- package/src/composer/composer-touch.stories.tsx +298 -0
- package/src/composer/composer.stories.tsx +765 -0
- package/src/composer/composer.tsx +244 -0
- package/src/composer/dropzone.tsx +92 -0
- package/src/composer/editor/actions.test.ts +176 -0
- package/src/composer/editor/actions.ts +191 -0
- package/src/composer/editor/dom.test.ts +168 -0
- package/src/composer/editor/dom.ts +274 -0
- package/src/composer/editor/editor.css +101 -0
- package/src/composer/editor/editor.tsx +1764 -0
- package/src/composer/editor/interaction.test.ts +13 -0
- package/src/composer/editor/interaction.ts +838 -0
- package/src/composer/editor/machine.test.ts +47 -0
- package/src/composer/editor/machine.ts +63 -0
- package/src/composer/editor/mention-search-machine.test.ts +111 -0
- package/src/composer/editor/mention-search-machine.ts +226 -0
- package/src/composer/editor/quote-comment.stories.tsx +133 -0
- package/src/composer/editor/quote-comment.tsx +191 -0
- package/src/composer/history/entry.test.ts +100 -0
- package/src/composer/history/entry.ts +140 -0
- package/src/composer/history/store.ts +83 -0
- package/src/composer/machine.test.ts +459 -0
- package/src/composer/machine.ts +561 -0
- package/src/composer/media.ts +18 -0
- package/src/composer/model-chip-machine.test.ts +96 -0
- package/src/composer/model-chip-machine.ts +82 -0
- package/src/composer/model-label.test.ts +177 -0
- package/src/composer/model-label.ts +120 -0
- package/src/composer/model.ts +683 -0
- package/src/composer/persistence.tsx +163 -0
- package/src/composer/prompt-parts.ts +52 -0
- package/src/composer/prompt-status-machine.test.ts +76 -0
- package/src/composer/prompt-status-machine.ts +48 -0
- package/src/composer/prompt.test.ts +320 -0
- package/src/composer/prompt.ts +334 -0
- package/src/composer/quote-comment-machine.test.ts +154 -0
- package/src/composer/quote-comment-machine.ts +211 -0
- package/src/composer/quote-position.ts +32 -0
- package/src/composer/quote-source.ts +48 -0
- package/src/composer/reload-machine.ts +51 -0
- package/src/composer/request.test.ts +360 -0
- package/src/composer/request.ts +245 -0
- package/src/composer/retry.test.ts +107 -0
- package/src/composer/retry.ts +63 -0
- package/src/composer/schema.test.ts +317 -0
- package/src/composer/schema.ts +424 -0
- package/src/composer/selection.ts +354 -0
- package/src/composer/session-match.test.ts +20 -0
- package/src/composer/session-match.ts +18 -0
- package/src/composer/state.ts +271 -0
- package/src/composer/submission-state.ts +3 -0
- package/src/composer/submit.test.ts +1785 -0
- package/src/composer/submit.ts +1073 -0
- package/src/composer/suggestions/machine.test.ts +420 -0
- package/src/composer/suggestions/machine.ts +573 -0
- package/src/composer/types.ts +60 -0
- package/src/desktop.ts +25 -0
- package/src/entry.tsx +119 -0
- package/src/env.d.ts +41 -0
- package/src/home/home.standalone.stories.tsx +260 -0
- package/src/home/machine.test.ts +286 -0
- package/src/home/machine.ts +344 -0
- package/src/home/model.ts +162 -0
- package/src/home/projects/actions.tsx +189 -0
- package/src/home/projects/add.ts +10 -0
- package/src/home/projects/browse-view.tsx +264 -0
- package/src/home/projects/browse.tsx +33 -0
- package/src/home/projects/controller.tsx +109 -0
- package/src/home/projects/file-manager.ts +26 -0
- package/src/home/projects/import-machine.test.ts +117 -0
- package/src/home/projects/import-machine.ts +133 -0
- package/src/home/projects/landing.tsx +77 -0
- package/src/home/projects/menu.tsx +70 -0
- package/src/home/projects/region.tsx +63 -0
- package/src/home/projects/reveal.ts +39 -0
- package/src/home/projects/start.ts +114 -0
- package/src/home/projects/view.css +79 -0
- package/src/home/projects/view.tsx +763 -0
- package/src/home/route.tsx +177 -0
- package/src/home/scroll.ts +180 -0
- package/src/home/sessions/alt-hold.test.ts +45 -0
- package/src/home/sessions/alt-hold.ts +20 -0
- package/src/home/sessions/archive.test.ts +51 -0
- package/src/home/sessions/archive.ts +25 -0
- package/src/home/sessions/controller.tsx +669 -0
- package/src/home/sessions/delete-dialog.stories.tsx +70 -0
- package/src/home/sessions/index.test.ts +171 -0
- package/src/home/sessions/index.ts +60 -0
- package/src/home/sessions/load-machine.test.ts +223 -0
- package/src/home/sessions/load-machine.ts +430 -0
- package/src/home/sessions/open.test.ts +16 -0
- package/src/home/sessions/open.ts +18 -0
- package/src/home/sessions/queries.ts +95 -0
- package/src/home/sessions/records.test.ts +85 -0
- package/src/home/sessions/records.ts +58 -0
- package/src/home/sessions/region.tsx +66 -0
- package/src/home/sessions/row-machine.test.ts +203 -0
- package/src/home/sessions/row-machine.ts +365 -0
- package/src/home/sessions/search-machine.test.ts +117 -0
- package/src/home/sessions/search-machine.ts +181 -0
- package/src/home/sessions/search.ts +218 -0
- package/src/home/sessions/view.css +101 -0
- package/src/home/sessions/view.tsx +1123 -0
- package/src/home/start/command-palette.tsx +88 -0
- package/src/index.css +419 -0
- package/src/index.ts +5 -0
- package/src/new-session/brick-breaker-machine.test.ts +120 -0
- package/src/new-session/brick-breaker-machine.ts +110 -0
- package/src/new-session/brick-breaker.tsx +551 -0
- package/src/new-session/commands.tsx +61 -0
- package/src/new-session/composer-adapter.ts +309 -0
- package/src/new-session/draft.standalone.stories.tsx +214 -0
- package/src/new-session/layout.ts +2 -0
- package/src/new-session/location/dialog.css +204 -0
- package/src/new-session/location/dialog.standalone.stories.tsx +122 -0
- package/src/new-session/location/dialog.tsx +677 -0
- package/src/new-session/location/machine.test.ts +180 -0
- package/src/new-session/location/machine.ts +239 -0
- package/src/new-session/machine.test.ts +344 -0
- package/src/new-session/machine.ts +293 -0
- package/src/new-session/mcp.ts +132 -0
- package/src/new-session/pin-board-machine.test.ts +116 -0
- package/src/new-session/pin-board-machine.ts +188 -0
- package/src/new-session/pin-board.tsx +1072 -0
- package/src/new-session/pin-quads.ts +252 -0
- package/src/new-session/pin-sound.ts +193 -0
- package/src/new-session/project/controller.ts +111 -0
- package/src/new-session/project/selector.test.tsx +101 -0
- package/src/new-session/project/selector.tsx +108 -0
- package/src/new-session/route.tsx +115 -0
- package/src/new-session/screen.tsx +107 -0
- package/src/new-session/view.tsx +424 -0
- package/src/new-session/wordmark-machine.test.ts +236 -0
- package/src/new-session/wordmark-machine.ts +237 -0
- package/src/new-session/wordmark.css +71 -0
- package/src/new-session/wordmark.stories.tsx +109 -0
- package/src/new-session/wordmark.tsx +1222 -0
- package/src/new-session/workspace/branch-machine.test.ts +243 -0
- package/src/new-session/workspace/branch-machine.ts +233 -0
- package/src/new-session/workspace/checkout-machine.test.ts +73 -0
- package/src/new-session/workspace/checkout-machine.ts +69 -0
- package/src/new-session/workspace/controller.test.ts +82 -0
- package/src/new-session/workspace/controller.ts +291 -0
- package/src/new-session/workspace/selector.tsx +230 -0
- package/src/providers/catalog/console-settle.ts +80 -0
- package/src/providers/catalog/console.test.ts +21 -0
- package/src/providers/catalog/console.ts +37 -0
- package/src/providers/catalog/integrations.ts +30 -0
- package/src/providers/catalog/order.ts +10 -0
- package/src/providers/catalog/plugin.ts +15 -0
- package/src/providers/catalog/providers.ts +111 -0
- package/src/providers/catalog/settle-machine.test.ts +123 -0
- package/src/providers/catalog/settle-machine.ts +109 -0
- package/src/providers/connect/chatgpt-usage-limit.stories.tsx +25 -0
- package/src/providers/connect/chatgpt-usage-limit.tsx +83 -0
- package/src/providers/connect/chatgpt-welcome.stories.tsx +23 -0
- package/src/providers/connect/chatgpt-welcome.tsx +37 -0
- package/src/providers/connect/console.tsx +67 -0
- package/src/providers/connect/controller.ts +672 -0
- package/src/providers/connect/dialog-machine.test.ts +654 -0
- package/src/providers/connect/dialog-machine.ts +875 -0
- package/src/providers/connect/dialog.standalone.stories.tsx +187 -0
- package/src/providers/connect/dialog.tsx +1564 -0
- package/src/providers/connect/form-machine.test.ts +200 -0
- package/src/providers/connect/form-machine.ts +419 -0
- package/src/providers/connect/go-upsell-hero-art.test.ts +194 -0
- package/src/providers/connect/go-upsell-hero-art.ts +749 -0
- package/src/providers/connect/go-upsell-hero-machine.test.ts +88 -0
- package/src/providers/connect/go-upsell-hero-machine.ts +68 -0
- package/src/providers/connect/go-upsell-hero.tsx +17 -0
- package/src/providers/connect/machine.test.ts +513 -0
- package/src/providers/connect/machine.ts +644 -0
- package/src/providers/connect/mcp-dialog.stories.tsx +89 -0
- package/src/providers/connect/mcp-dialog.tsx +316 -0
- package/src/providers/connect/mcp-machine.test.ts +239 -0
- package/src/providers/connect/mcp-machine.ts +328 -0
- package/src/providers/connect/mcp-sign-in.tsx +112 -0
- package/src/providers/connect/mcp.tsx +298 -0
- package/src/providers/connect/models.css +71 -0
- package/src/providers/connect/remote.test.ts +50 -0
- package/src/providers/connect/remote.tsx +10 -0
- package/src/providers/connect/step-actions.tsx +18 -0
- package/src/providers/connect/tip.tsx +110 -0
- package/src/providers/connect/usage-exceeded.tsx +62 -0
- package/src/providers/custom-managed-provider.svg +31 -0
- package/src/providers/models/agent.test.ts +25 -0
- package/src/providers/models/agent.ts +7 -0
- package/src/providers/models/configured.ts +33 -0
- package/src/providers/models/details.tsx +168 -0
- package/src/providers/models/manage.css +97 -0
- package/src/providers/models/manage.standalone.stories.tsx +59 -0
- package/src/providers/models/manage.tsx +170 -0
- package/src/providers/models/models.test.ts +55 -0
- package/src/providers/models/models.tsx +279 -0
- package/src/providers/models/provider-group.tsx +293 -0
- package/src/providers/models/search.test.ts +13 -0
- package/src/providers/models/search.ts +20 -0
- package/src/providers/models/select-dialog-machine.test.ts +455 -0
- package/src/providers/models/select-dialog-machine.ts +702 -0
- package/src/providers/models/select-dialog.css +240 -0
- package/src/providers/models/select-dialog.standalone.stories.tsx +225 -0
- package/src/providers/models/select-dialog.tsx +1359 -0
- package/src/providers/models/selection-machine.test.ts +290 -0
- package/src/providers/models/selection-machine.ts +408 -0
- package/src/providers/models/selection.tsx +787 -0
- package/src/providers/models/speed.test.ts +17 -0
- package/src/providers/models/speed.ts +17 -0
- package/src/providers/models/tooltip.tsx +152 -0
- package/src/providers/models/unpaid.standalone.stories.tsx +76 -0
- package/src/providers/models/unpaid.tsx +199 -0
- package/src/providers/models/variant.test.ts +79 -0
- package/src/providers/models/variant.ts +74 -0
- package/src/providers/opencode-logo.tsx +17 -0
- package/src/runtime/animated-presence.ts +66 -0
- package/src/runtime/array-move.test.ts +19 -0
- package/src/runtime/array-move.ts +8 -0
- package/src/runtime/i18n/am.ts +1409 -0
- package/src/runtime/i18n/ar.ts +1560 -0
- package/src/runtime/i18n/az.ts +1481 -0
- package/src/runtime/i18n/bg.ts +1491 -0
- package/src/runtime/i18n/bn.ts +1477 -0
- package/src/runtime/i18n/br.ts +1527 -0
- package/src/runtime/i18n/bs.ts +1561 -0
- package/src/runtime/i18n/ca.ts +1523 -0
- package/src/runtime/i18n/cs.ts +1520 -0
- package/src/runtime/i18n/da.ts +1527 -0
- package/src/runtime/i18n/de.ts +1517 -0
- package/src/runtime/i18n/desktop-native.test.ts +84 -0
- package/src/runtime/i18n/desktop-native.ts +366 -0
- package/src/runtime/i18n/dv.ts +1519 -0
- package/src/runtime/i18n/dz.ts +1504 -0
- package/src/runtime/i18n/el.ts +1509 -0
- package/src/runtime/i18n/en.ts +1560 -0
- package/src/runtime/i18n/es.ts +1583 -0
- package/src/runtime/i18n/et.ts +1456 -0
- package/src/runtime/i18n/fa.ts +1470 -0
- package/src/runtime/i18n/fi.ts +1472 -0
- package/src/runtime/i18n/fo.ts +1469 -0
- package/src/runtime/i18n/fr.ts +1543 -0
- package/src/runtime/i18n/he.ts +1455 -0
- package/src/runtime/i18n/hi.ts +1475 -0
- package/src/runtime/i18n/hr.ts +1506 -0
- package/src/runtime/i18n/hu.ts +1492 -0
- package/src/runtime/i18n/hy.ts +1478 -0
- package/src/runtime/i18n/id.ts +1541 -0
- package/src/runtime/i18n/is.ts +1468 -0
- package/src/runtime/i18n/it.ts +1517 -0
- package/src/runtime/i18n/ja.ts +1484 -0
- package/src/runtime/i18n/ka.ts +1476 -0
- package/src/runtime/i18n/km.ts +1461 -0
- package/src/runtime/i18n/ko.ts +1469 -0
- package/src/runtime/i18n/language.test.ts +35 -0
- package/src/runtime/i18n/language.tsx +468 -0
- package/src/runtime/i18n/lo.ts +1454 -0
- package/src/runtime/i18n/lt.ts +1529 -0
- package/src/runtime/i18n/lv.ts +1509 -0
- package/src/runtime/i18n/machine.test.ts +148 -0
- package/src/runtime/i18n/machine.ts +164 -0
- package/src/runtime/i18n/mk.ts +1488 -0
- package/src/runtime/i18n/mn.ts +1485 -0
- package/src/runtime/i18n/ms.ts +1480 -0
- package/src/runtime/i18n/my.ts +1489 -0
- package/src/runtime/i18n/ne.ts +1478 -0
- package/src/runtime/i18n/nl.ts +1491 -0
- package/src/runtime/i18n/no.ts +1536 -0
- package/src/runtime/i18n/pa.ts +1478 -0
- package/src/runtime/i18n/pl.ts +1540 -0
- package/src/runtime/i18n/ro.ts +1511 -0
- package/src/runtime/i18n/ru.ts +1596 -0
- package/src/runtime/i18n/si.ts +1477 -0
- package/src/runtime/i18n/sk.ts +1526 -0
- package/src/runtime/i18n/sl.ts +1527 -0
- package/src/runtime/i18n/sq.ts +1480 -0
- package/src/runtime/i18n/sr.ts +1502 -0
- package/src/runtime/i18n/sv.ts +1478 -0
- package/src/runtime/i18n/tg.ts +1493 -0
- package/src/runtime/i18n/th.ts +1505 -0
- package/src/runtime/i18n/tk.ts +1472 -0
- package/src/runtime/i18n/tr.ts +1550 -0
- package/src/runtime/i18n/uk.ts +1598 -0
- package/src/runtime/i18n/ur.ts +1488 -0
- package/src/runtime/i18n/uz.ts +1490 -0
- package/src/runtime/i18n/vi.ts +1473 -0
- package/src/runtime/i18n/zh.ts +1474 -0
- package/src/runtime/i18n/zht.ts +1468 -0
- package/src/runtime/persistence/README.md +151 -0
- package/src/runtime/persistence/base64.ts +11 -0
- package/src/runtime/persistence/consumers.test.ts +168 -0
- package/src/runtime/persistence/drafts-machine.test.ts +214 -0
- package/src/runtime/persistence/drafts-machine.ts +385 -0
- package/src/runtime/persistence/drafts.test.ts +515 -0
- package/src/runtime/persistence/drafts.ts +687 -0
- package/src/runtime/persistence/equality.ts +9 -0
- package/src/runtime/persistence/namespace-machine.test.ts +232 -0
- package/src/runtime/persistence/namespace-machine.ts +304 -0
- package/src/runtime/persistence/namespace.test.ts +304 -0
- package/src/runtime/persistence/namespace.ts +126 -0
- package/src/runtime/persistence/persist-machine.test.ts +185 -0
- package/src/runtime/persistence/persist-machine.ts +192 -0
- package/src/runtime/persistence/persist.test.ts +243 -0
- package/src/runtime/persistence/persist.ts +159 -0
- package/src/runtime/persistence/schema.test.ts +208 -0
- package/src/runtime/persistence/schema.ts +130 -0
- package/src/runtime/persistence/storage-machine.test.ts +61 -0
- package/src/runtime/persistence/storage-machine.ts +57 -0
- package/src/runtime/persistence/storage.test.ts +70 -0
- package/src/runtime/persistence/storage.ts +707 -0
- package/src/runtime/platform/base-path-router.tsx +66 -0
- package/src/runtime/platform/base-path.test.ts +50 -0
- package/src/runtime/platform/base-path.ts +28 -0
- package/src/runtime/platform/drag-out.test.ts +58 -0
- package/src/runtime/platform/drag-out.ts +53 -0
- package/src/runtime/platform/external-link.tsx +21 -0
- package/src/runtime/platform/keyboard.ts +41 -0
- package/src/runtime/platform/platform.tsx +185 -0
- package/src/runtime/platform/pwa.ts +50 -0
- package/src/runtime/platform/web.ts +63 -0
- package/src/runtime/plugin/app-links.test.ts +17 -0
- package/src/runtime/plugin/app-links.ts +88 -0
- package/src/runtime/plugin/attach-machine.test.ts +174 -0
- package/src/runtime/plugin/attach-machine.ts +152 -0
- package/src/runtime/plugin/attachment.ts +15 -0
- package/src/runtime/plugin/builtins.ts +15 -0
- package/src/runtime/plugin/closed-tabs-view.tsx +315 -0
- package/src/runtime/plugin/closed-tabs.test.ts +82 -0
- package/src/runtime/plugin/closed-tabs.ts +196 -0
- package/src/runtime/plugin/commands.test.ts +23 -0
- package/src/runtime/plugin/commands.tsx +86 -0
- package/src/runtime/plugin/composer-write-machine.test.ts +151 -0
- package/src/runtime/plugin/composer-write-machine.ts +111 -0
- package/src/runtime/plugin/deferred-menu-machine.test.ts +127 -0
- package/src/runtime/plugin/deferred-menu-machine.ts +163 -0
- package/src/runtime/plugin/dialog-machine.test.ts +62 -0
- package/src/runtime/plugin/dialog-machine.ts +81 -0
- package/src/runtime/plugin/dialogs.stories.tsx +66 -0
- package/src/runtime/plugin/dialogs.tsx +177 -0
- package/src/runtime/plugin/embed-flight-machine.test.ts +350 -0
- package/src/runtime/plugin/embed-flight-machine.ts +468 -0
- package/src/runtime/plugin/embed-geometry.test.ts +18 -0
- package/src/runtime/plugin/embed-geometry.ts +19 -0
- package/src/runtime/plugin/embed-snapshot-machine.test.ts +242 -0
- package/src/runtime/plugin/embed-snapshot-machine.ts +267 -0
- package/src/runtime/plugin/embeds.tsx +773 -0
- package/src/runtime/plugin/extension-plugins.tsx +299 -0
- package/src/runtime/plugin/hmr.tsx +33 -0
- package/src/runtime/plugin/host-apis.tsx +1315 -0
- package/src/runtime/plugin/host-layout-machine.test.ts +214 -0
- package/src/runtime/plugin/host-layout-machine.ts +269 -0
- package/src/runtime/plugin/host.tsx +1106 -0
- package/src/runtime/plugin/instance-machine.test.ts +387 -0
- package/src/runtime/plugin/instance-machine.ts +409 -0
- package/src/runtime/plugin/ipc-machine.test.ts +172 -0
- package/src/runtime/plugin/ipc-machine.ts +213 -0
- package/src/runtime/plugin/ipc.test.ts +166 -0
- package/src/runtime/plugin/ipc.ts +220 -0
- package/src/runtime/plugin/link-check-machine.test.ts +115 -0
- package/src/runtime/plugin/link-check-machine.ts +142 -0
- package/src/runtime/plugin/link-check.ts +82 -0
- package/src/runtime/plugin/located-machine.test.ts +124 -0
- package/src/runtime/plugin/located-machine.ts +125 -0
- package/src/runtime/plugin/located.ts +82 -0
- package/src/runtime/plugin/machine.test.ts +222 -0
- package/src/runtime/plugin/machine.ts +318 -0
- package/src/runtime/plugin/menubar-items.ts +28 -0
- package/src/runtime/plugin/mobile.tsx +199 -0
- package/src/runtime/plugin/module.test.ts +57 -0
- package/src/runtime/plugin/module.ts +64 -0
- package/src/runtime/plugin/mounted-session.ts +420 -0
- package/src/runtime/plugin/new-tab-machine.test.ts +207 -0
- package/src/runtime/plugin/new-tab-machine.ts +240 -0
- package/src/runtime/plugin/pane-drag-machine.test.ts +217 -0
- package/src/runtime/plugin/pane-drag-machine.ts +263 -0
- package/src/runtime/plugin/pane-drag.tsx +290 -0
- package/src/runtime/plugin/panel-keys.ts +15 -0
- package/src/runtime/plugin/panel-menu.ts +29 -0
- package/src/runtime/plugin/panel-trigger.tsx +180 -0
- package/src/runtime/plugin/panels.tsx +733 -0
- package/src/runtime/plugin/plugin-gui-machine.test.ts +186 -0
- package/src/runtime/plugin/plugin-gui-machine.ts +178 -0
- package/src/runtime/plugin/plugins.tsx +137 -0
- package/src/runtime/plugin/prompt-gate.test.ts +113 -0
- package/src/runtime/plugin/prompt-gate.ts +36 -0
- package/src/runtime/plugin/render.tsx +348 -0
- package/src/runtime/plugin/root.tsx +141 -0
- package/src/runtime/plugin/server-shell.tsx +113 -0
- package/src/runtime/plugin/servers.tsx +270 -0
- package/src/runtime/plugin/session-store-machine.test.ts +82 -0
- package/src/runtime/plugin/session-store-machine.ts +140 -0
- package/src/runtime/plugin/settings-page-view.tsx +53 -0
- package/src/runtime/plugin/settings-pages.ts +23 -0
- package/src/runtime/plugin/side-region.tsx +635 -0
- package/src/runtime/plugin/startup.ts +107 -0
- package/src/runtime/plugin/store-machine.test.ts +69 -0
- package/src/runtime/plugin/store-machine.ts +139 -0
- package/src/runtime/plugin/stores.ts +339 -0
- package/src/runtime/plugin/tab-strip-scroll.test.ts +40 -0
- package/src/runtime/plugin/tab-strip-scroll.ts +130 -0
- package/src/runtime/plugin/titlebar-items.css +20 -0
- package/src/runtime/plugin/titlebar-items.stories.tsx +97 -0
- package/src/runtime/plugin/titlebar-items.tsx +96 -0
- package/src/runtime/plugin/ui.tsx +292 -0
- package/src/runtime/plugin/web-href.test.ts +11 -0
- package/src/runtime/plugin/web-href.ts +10 -0
- package/src/runtime/polyfills.test.ts +61 -0
- package/src/runtime/polyfills.ts +39 -0
- package/src/runtime/presence-machine.test.ts +260 -0
- package/src/runtime/presence-machine.ts +329 -0
- package/src/runtime/presence.ts +165 -0
- package/src/runtime/server/api.test.ts +64 -0
- package/src/runtime/server/api.ts +58 -0
- package/src/runtime/server/client.test.ts +131 -0
- package/src/runtime/server/client.tsx +308 -0
- package/src/runtime/server/current.tsx +55 -0
- package/src/runtime/server/data.test.ts +440 -0
- package/src/runtime/server/data.ts +286 -0
- package/src/runtime/server/errors.test.ts +151 -0
- package/src/runtime/server/errors.ts +135 -0
- package/src/runtime/server/global-sync/bootstrap.test.ts +179 -0
- package/src/runtime/server/global-sync/bootstrap.ts +96 -0
- package/src/runtime/server/global-sync/child-store.test.ts +47 -0
- package/src/runtime/server/global-sync/child-store.ts +206 -0
- package/src/runtime/server/global-sync/machine.test.ts +96 -0
- package/src/runtime/server/global-sync/machine.ts +84 -0
- package/src/runtime/server/global-sync/types.ts +46 -0
- package/src/runtime/server/global-sync/utils.test.ts +154 -0
- package/src/runtime/server/global-sync/utils.ts +165 -0
- package/src/runtime/server/health-machine.test.ts +227 -0
- package/src/runtime/server/health-machine.ts +357 -0
- package/src/runtime/server/health.test.ts +169 -0
- package/src/runtime/server/health.ts +236 -0
- package/src/runtime/server/image.test.ts +214 -0
- package/src/runtime/server/image.ts +40 -0
- package/src/runtime/server/loopback.test.ts +17 -0
- package/src/runtime/server/loopback.ts +22 -0
- package/src/runtime/server/machine.test.ts +162 -0
- package/src/runtime/server/machine.ts +275 -0
- package/src/runtime/server/media.ts +88 -0
- package/src/runtime/server/persistence.test.ts +117 -0
- package/src/runtime/server/persistence.ts +105 -0
- package/src/runtime/server/plugin-machine.test.ts +128 -0
- package/src/runtime/server/plugin-machine.ts +170 -0
- package/src/runtime/server/refcount.test.ts +30 -0
- package/src/runtime/server/refcount.ts +37 -0
- package/src/runtime/server/registry.test.ts +152 -0
- package/src/runtime/server/registry.tsx +363 -0
- package/src/runtime/server/request-queue-machine.test.ts +151 -0
- package/src/runtime/server/request-queue-machine.ts +307 -0
- package/src/runtime/server/request-queue.test.ts +315 -0
- package/src/runtime/server/request-queue.ts +173 -0
- package/src/runtime/server/runtime.tsx +396 -0
- package/src/runtime/server/scope.test.ts +52 -0
- package/src/runtime/server/scope.ts +69 -0
- package/src/runtime/server/scoped-cache.test.ts +72 -0
- package/src/runtime/server/scoped-cache.ts +119 -0
- package/src/runtime/server/server-sync/connection.ts +34 -0
- package/src/runtime/server/server-sync/endpoint-machine.test.ts +87 -0
- package/src/runtime/server/server-sync/endpoint-machine.ts +62 -0
- package/src/runtime/server/server-sync/machine.test.ts +86 -0
- package/src/runtime/server/server-sync/machine.ts +70 -0
- package/src/runtime/server/session-index.ts +23 -0
- package/src/runtime/server/sync.tsx +206 -0
- package/src/runtime/server/types.ts +151 -0
- package/src/servers/connect/browser.ts +15 -0
- package/src/servers/connect/connect.fixture.tsx +222 -0
- package/src/servers/connect/controller.ts +237 -0
- package/src/servers/connect/dialog.stories.tsx +67 -0
- package/src/servers/connect/dialog.tsx +255 -0
- package/src/servers/connect/machine.test.ts +487 -0
- package/src/servers/connect/machine.ts +427 -0
- package/src/servers/connect/method.tsx +31 -0
- package/src/servers/connect/pairing.test.ts +67 -0
- package/src/servers/connect/pairing.ts +134 -0
- package/src/servers/connect/redeem.ts +50 -0
- package/src/servers/connect/scanner-machine.test.ts +114 -0
- package/src/servers/connect/scanner-machine.ts +164 -0
- package/src/servers/connect/scanner.css +47 -0
- package/src/servers/connect/scanner.tsx +173 -0
- package/src/servers/connect/screen.css +108 -0
- package/src/servers/connect/screen.stories.tsx +63 -0
- package/src/servers/connect/screen.tsx +164 -0
- package/src/servers/registry/add-menu.tsx +62 -0
- package/src/servers/registry/controller.test.ts +26 -0
- package/src/servers/registry/controller.ts +86 -0
- package/src/servers/registry/label.tsx +23 -0
- package/src/servers/registry/management.test.ts +40 -0
- package/src/servers/registry/management.ts +17 -0
- package/src/servers/registry/plugin-row.tsx +57 -0
- package/src/servers/registry/row-items.tsx +18 -0
- package/src/servers/registry/row-menu.tsx +152 -0
- package/src/servers/registry/row.stories.tsx +51 -0
- package/src/servers/registry/row.tsx +47 -0
- package/src/session/commands/dialog-jump-to-message.tsx +197 -0
- package/src/session/commands/export-machine.test.ts +99 -0
- package/src/session/commands/export-machine.ts +117 -0
- package/src/session/commands/export-session.tsx +108 -0
- package/src/session/commands/export.test.ts +105 -0
- package/src/session/commands/export.ts +89 -0
- package/src/session/commands/fork-dialog.stories.tsx +68 -0
- package/src/session/commands/fork-dialog.tsx +198 -0
- package/src/session/commands/jump-to-message-machine.test.ts +123 -0
- package/src/session/commands/jump-to-message-machine.ts +161 -0
- package/src/session/commands/jump-to-message.stories.tsx +226 -0
- package/src/session/commands/jump-to-message.tsx +161 -0
- package/src/session/commands/machine.test.ts +305 -0
- package/src/session/commands/machine.ts +272 -0
- package/src/session/commands/rename-session.ts +31 -0
- package/src/session/commands/use-session-commands.tsx +813 -0
- package/src/session/composer/activity-chips.css +242 -0
- package/src/session/composer/activity-chips.stories.tsx +280 -0
- package/src/session/composer/activity-chips.tsx +485 -0
- package/src/session/composer/adapter.ts +74 -0
- package/src/session/composer/composer-docks.stories.tsx +278 -0
- package/src/session/composer/composer-lane.css +93 -0
- package/src/session/composer/composer-lane.tsx +45 -0
- package/src/session/composer/controller.ts +86 -0
- package/src/session/composer/focus-machine.test.ts +285 -0
- package/src/session/composer/focus-machine.ts +212 -0
- package/src/session/composer/focus.tsx +161 -0
- package/src/session/composer/free-limit-panel.standalone.stories.tsx +45 -0
- package/src/session/composer/free-limit-panel.tsx +133 -0
- package/src/session/composer/go-limit-tray.tsx +137 -0
- package/src/session/composer/location-missing-machine.test.ts +97 -0
- package/src/session/composer/location-missing-machine.ts +144 -0
- package/src/session/composer/location-missing.css +73 -0
- package/src/session/composer/location-missing.standalone.stories.tsx +161 -0
- package/src/session/composer/location-missing.tsx +193 -0
- package/src/session/composer/plugin-pills.tsx +215 -0
- package/src/session/composer/queue-machine.test.ts +565 -0
- package/src/session/composer/queue-machine.ts +934 -0
- package/src/session/composer/queue-panel-machine.test.ts +121 -0
- package/src/session/composer/queue-panel-machine.ts +229 -0
- package/src/session/composer/queue-panel.css +10 -0
- package/src/session/composer/queue-panel.stories.tsx +86 -0
- package/src/session/composer/queue-panel.tsx +314 -0
- package/src/session/composer/queue.test.ts +314 -0
- package/src/session/composer/queue.ts +610 -0
- package/src/session/composer/recovery-story.tsx +38 -0
- package/src/session/composer/region.tsx +689 -0
- package/src/session/composer/selection.test.ts +28 -0
- package/src/session/composer/selection.ts +28 -0
- package/src/session/composer/session-composer-region-controller.ts +28 -0
- package/src/session/composer/session-composer-region.tsx +115 -0
- package/src/session/composer/shell-panel-machine.test.ts +261 -0
- package/src/session/composer/shell-panel-machine.ts +338 -0
- package/src/session/composer/shell-panel.ts +181 -0
- package/src/session/composer/spring-height-machine.test.ts +380 -0
- package/src/session/composer/spring-height-machine.ts +489 -0
- package/src/session/composer/spring-height.tsx +586 -0
- package/src/session/composer/subagent-bar.tsx +116 -0
- package/src/session/composer/timeline-actions.ts +49 -0
- package/src/session/composer/todo-pill.css +32 -0
- package/src/session/composer/todo-pill.stories.tsx +158 -0
- package/src/session/composer/todo-pill.tsx +157 -0
- package/src/session/composer/todos.ts +43 -0
- package/src/session/delete-machine.test.ts +83 -0
- package/src/session/delete-machine.ts +128 -0
- package/src/session/fork-machine.test.ts +152 -0
- package/src/session/fork-machine.ts +169 -0
- package/src/session/fork.ts +164 -0
- package/src/session/handoff-machine.test.ts +262 -0
- package/src/session/handoff-machine.ts +256 -0
- package/src/session/handoff.ts +112 -0
- package/src/session/header/drag-area.tsx +86 -0
- package/src/session/header/fit-machine.test.ts +143 -0
- package/src/session/header/fit-machine.ts +95 -0
- package/src/session/header/fit.ts +134 -0
- package/src/session/header/separator.tsx +22 -0
- package/src/session/header/session-header-actions.stories.tsx +45 -0
- package/src/session/header/session-header-actions.tsx +89 -0
- package/src/session/header/session-header.tsx +12 -0
- package/src/session/header/session-working-indicator.tsx +44 -0
- package/src/session/helpers.ts +42 -0
- package/src/session/list.test.ts +64 -0
- package/src/session/list.ts +18 -0
- package/src/session/message-id-from-hash.test.ts +10 -0
- package/src/session/message-id-from-hash.ts +8 -0
- package/src/session/model.ts +150 -0
- package/src/session/preparing-composer.tsx +72 -0
- package/src/session/question-switch.stories.tsx +380 -0
- package/src/session/requests/auto-approve-machine.test.ts +345 -0
- package/src/session/requests/auto-approve-machine.ts +247 -0
- package/src/session/requests/auto-approve.ts +274 -0
- package/src/session/requests/background.ts +312 -0
- package/src/session/requests/elicitation-controller.ts +129 -0
- package/src/session/requests/elicitation-machine.test.ts +209 -0
- package/src/session/requests/elicitation-machine.ts +277 -0
- package/src/session/requests/job-list.test.ts +18 -0
- package/src/session/requests/model.ts +348 -0
- package/src/session/requests/permission-machine.test.ts +130 -0
- package/src/session/requests/permission-machine.ts +105 -0
- package/src/session/requests/question-controller.ts +130 -0
- package/src/session/requests/question-keys.test.ts +106 -0
- package/src/session/requests/question-keys.ts +81 -0
- package/src/session/requests/question-machine.test.ts +257 -0
- package/src/session/requests/question-machine.ts +293 -0
- package/src/session/requests/question-motion.ts +26 -0
- package/src/session/requests/question-state.ts +21 -0
- package/src/session/requests/question-switch-machine.test.ts +114 -0
- package/src/session/requests/question-switch-machine.ts +130 -0
- package/src/session/requests/session-elicitation-dock.css +49 -0
- package/src/session/requests/session-elicitation-dock.tsx +223 -0
- package/src/session/requests/session-permission-dock.tsx +108 -0
- package/src/session/requests/session-question-dock-classic.tsx +726 -0
- package/src/session/requests/session-question-dock-experimental.tsx +1510 -0
- package/src/session/requests/session-question-dock.tsx +15 -0
- package/src/session/requests/session-request-tree.test.ts +119 -0
- package/src/session/requests/session-request-tree.ts +87 -0
- package/src/session/requests/session-websearch-dock.css +61 -0
- package/src/session/requests/session-websearch-dock.tsx +112 -0
- package/src/session/requests/steer-background.test.ts +66 -0
- package/src/session/requests/steer-background.ts +28 -0
- package/src/session/requests/websearch-machine.test.ts +425 -0
- package/src/session/requests/websearch-machine.ts +627 -0
- package/src/session/requests/websearch.ts +152 -0
- package/src/session/resolution-machine.test.ts +414 -0
- package/src/session/resolution-machine.ts +330 -0
- package/src/session/revert-machine.test.ts +365 -0
- package/src/session/revert-machine.ts +345 -0
- package/src/session/revert.ts +340 -0
- package/src/session/route-error.tsx +73 -0
- package/src/session/route.tsx +299 -0
- package/src/session/screen-layout.ts +147 -0
- package/src/session/screen.tsx +625 -0
- package/src/session/search.ts +3 -0
- package/src/session/server-unavailable-panel.standalone.stories.tsx +88 -0
- package/src/session/server-unavailable-panel.tsx +86 -0
- package/src/session/session-domain.test.ts +57 -0
- package/src/session/session-domain.ts +33 -0
- package/src/session/session-frame.tsx +28 -0
- package/src/session/session-identity-header.css +142 -0
- package/src/session/session-identity-header.tsx +674 -0
- package/src/session/session-layout.ts +73 -0
- package/src/session/session-model-helpers.test.ts +29 -0
- package/src/session/session-model-helpers.ts +33 -0
- package/src/session/session-panel-width.test.ts +25 -0
- package/src/session/session-panel-width.ts +58 -0
- package/src/session/session-read-menu-item.tsx +54 -0
- package/src/session/session-reference-menu.tsx +106 -0
- package/src/session/session-resolution.ts +141 -0
- package/src/session/session-screen.stories.tsx +363 -0
- package/src/session/sizing-machine.test.ts +89 -0
- package/src/session/sizing-machine.ts +74 -0
- package/src/session/story-model.tsx +420 -0
- package/src/session/timeline/background-work.stories.tsx +27 -0
- package/src/session/timeline/cache-machine.test.ts +50 -0
- package/src/session/timeline/cache-machine.ts +37 -0
- package/src/session/timeline/cache.ts +200 -0
- package/src/session/timeline/cold-mount.test.ts +162 -0
- package/src/session/timeline/cold-mount.ts +179 -0
- package/src/session/timeline/controller-projection.test.ts +305 -0
- package/src/session/timeline/controller-projection.ts +131 -0
- package/src/session/timeline/controller.tsx +467 -0
- package/src/session/timeline/cursor-machine.test.ts +398 -0
- package/src/session/timeline/cursor-machine.ts +433 -0
- package/src/session/timeline/cursor.ts +207 -0
- package/src/session/timeline/follow.ts +40 -0
- package/src/session/timeline/header-actions-machine.test.ts +126 -0
- package/src/session/timeline/header-actions-machine.ts +204 -0
- package/src/session/timeline/history-machine.test.ts +304 -0
- package/src/session/timeline/history-machine.ts +296 -0
- package/src/session/timeline/inline-quotes.ts +4 -0
- package/src/session/timeline/interaction.ts +474 -0
- package/src/session/timeline/machine.test.ts +290 -0
- package/src/session/timeline/machine.ts +271 -0
- package/src/session/timeline/message-timeline.tsx +779 -0
- package/src/session/timeline/model.test.ts +393 -0
- package/src/session/timeline/model.ts +201 -0
- package/src/session/timeline/observe-element-offset.test.ts +323 -0
- package/src/session/timeline/observe-element-offset.ts +106 -0
- package/src/session/timeline/projection.ts +7 -0
- package/src/session/timeline/quote-background.ts +141 -0
- package/src/session/timeline/quote-highlight.ts +203 -0
- package/src/session/timeline/quote-machine.test.ts +277 -0
- package/src/session/timeline/quote-machine.ts +360 -0
- package/src/session/timeline/quote-text.ts +332 -0
- package/src/session/timeline/quote.stories.tsx +88 -0
- package/src/session/timeline/quote.tsx +547 -0
- package/src/session/timeline/reconnect-machine.test.ts +115 -0
- package/src/session/timeline/reconnect-machine.ts +130 -0
- package/src/session/timeline/search-bar.css +19 -0
- package/src/session/timeline/search-bar.stories.tsx +122 -0
- package/src/session/timeline/search-bar.tsx +94 -0
- package/src/session/timeline/search-controller.ts +364 -0
- package/src/session/timeline/search-machine.test.ts +320 -0
- package/src/session/timeline/search-machine.ts +342 -0
- package/src/session/timeline/selected-effect.ts +19 -0
- package/src/session/timeline/sources.stories.tsx +352 -0
- package/src/session/timeline/sync-machine.ts +265 -0
- package/src/session/timeline/turn-diff-machine.ts +115 -0
- package/src/session/timeline/turn-diffs.test.ts +178 -0
- package/src/session/timeline/turn-diffs.ts +67 -0
- package/src/session/timeline/virtual-items.ts +3 -0
- package/src/session/timeline/virtualizer.tsx +1321 -0
- package/src/session/timeline/voice-delegation.test.ts +69 -0
- package/src/session/timeline/voice-delegation.ts +38 -0
- package/src/session/title.ts +15 -0
- package/src/session/usage-exceeded-dialogs.test.ts +41 -0
- package/src/session/usage-exceeded-dialogs.tsx +158 -0
- package/src/session/viewed-machine.test.ts +27 -0
- package/src/session/viewed-machine.ts +24 -0
- package/src/settings/about/about.tsx +199 -0
- package/src/settings/about/animated-wordmark.tsx +85 -0
- package/src/settings/about/anomaly-brush.svg +1 -0
- package/src/settings/about/contributors.test.ts +17 -0
- package/src/settings/about/contributors.ts +27 -0
- package/src/settings/about/legal.svg +9 -0
- package/src/settings/about/machine.test.ts +90 -0
- package/src/settings/about/machine.ts +119 -0
- package/src/settings/about/notices/apache-2.0.txt +201 -0
- package/src/settings/about/notices/betteroffice-notice.txt +2 -0
- package/src/settings/about/notices/crates.ts +770 -0
- package/src/settings/about/notices/dialog.tsx +113 -0
- package/src/settings/about/notices/fonts/OFL-1.1.txt +91 -0
- package/src/settings/about/notices/fonts.ts +107 -0
- package/src/settings/about/notices/notices.ts +37 -0
- package/src/settings/appearance/appearance.tsx +176 -0
- package/src/settings/command.tsx +29 -0
- package/src/settings/experimental/experimental.tsx +93 -0
- package/src/settings/extension-load-machine.test.ts +117 -0
- package/src/settings/extension-load-machine.ts +158 -0
- package/src/settings/extension-load.tsx +85 -0
- package/src/settings/general/behavior.ts +102 -0
- package/src/settings/general/controllers.test.ts +56 -0
- package/src/settings/general/controllers.ts +271 -0
- package/src/settings/general/general.tsx +404 -0
- package/src/settings/general/interface-mode.css +261 -0
- package/src/settings/general/interface-mode.tsx +190 -0
- package/src/settings/general/machine.test.ts +188 -0
- package/src/settings/general/machine.ts +224 -0
- package/src/settings/general/sound-preview-machine.test.ts +114 -0
- package/src/settings/general/sound-preview-machine.ts +109 -0
- package/src/settings/keybinds/keybinds.tsx +624 -0
- package/src/settings/keybinds/machine.test.ts +142 -0
- package/src/settings/keybinds/machine.ts +149 -0
- package/src/settings/keybinds/migration.ts +42 -0
- package/src/settings/list.tsx +10 -0
- package/src/settings/model.test.ts +249 -0
- package/src/settings/model.tsx +685 -0
- package/src/settings/models/machine.test.ts +123 -0
- package/src/settings/models/machine.ts +161 -0
- package/src/settings/models/models.tsx +285 -0
- package/src/settings/navigation.tsx +223 -0
- package/src/settings/notifications/notifications.tsx +160 -0
- package/src/settings/pages.ts +33 -0
- package/src/settings/palette.ts +44 -0
- package/src/settings/providers/account-actions.ts +112 -0
- package/src/settings/providers/account-name.tsx +46 -0
- package/src/settings/providers/accounts.test.ts +29 -0
- package/src/settings/providers/accounts.ts +11 -0
- package/src/settings/providers/console-extensions.test.ts +103 -0
- package/src/settings/providers/console-extensions.ts +110 -0
- package/src/settings/providers/console-link.tsx +121 -0
- package/src/settings/providers/extensions.tsx +425 -0
- package/src/settings/providers/machine.test.ts +270 -0
- package/src/settings/providers/machine.ts +357 -0
- package/src/settings/providers/plugin-update-machine.test.ts +155 -0
- package/src/settings/providers/plugin-update-machine.ts +151 -0
- package/src/settings/providers/providers.tsx +702 -0
- package/src/settings/rename-machine.test.ts +123 -0
- package/src/settings/rename-machine.ts +167 -0
- package/src/settings/rename.ts +120 -0
- package/src/settings/route.test.ts +117 -0
- package/src/settings/route.ts +160 -0
- package/src/settings/row.tsx +21 -0
- package/src/settings/scroller.ts +6 -0
- package/src/settings/search-catalog.ts +319 -0
- package/src/settings/search-empty.tsx +87 -0
- package/src/settings/search-field.tsx +101 -0
- package/src/settings/search-index.ts +193 -0
- package/src/settings/search-machine.test.ts +249 -0
- package/src/settings/search-machine.ts +308 -0
- package/src/settings/search-results.test.ts +151 -0
- package/src/settings/search-results.ts +75 -0
- package/src/settings/search-reveal.ts +76 -0
- package/src/settings/search.css +168 -0
- package/src/settings/search.tsx +283 -0
- package/src/settings/server-scope.tsx +12 -0
- package/src/settings/servers/inventory.test.ts +50 -0
- package/src/settings/servers/inventory.ts +100 -0
- package/src/settings/servers/machine.test.ts +148 -0
- package/src/settings/servers/machine.ts +176 -0
- package/src/settings/servers/servers.tsx +178 -0
- package/src/settings/servers/switcher.tsx +77 -0
- package/src/settings/servers/unavailable.tsx +99 -0
- package/src/settings/settings.css +2478 -0
- package/src/settings/shell.standalone.stories.tsx +60 -0
- package/src/settings/shell.tsx +434 -0
- package/src/settings/surface.tsx +297 -0
- package/src/settings/tab-header.ts +12 -0
- package/src/settings/timeline-detail.css +334 -0
- package/src/settings/timeline-detail.stories.tsx +54 -0
- package/src/settings/timeline-detail.tsx +221 -0
- package/src/settings/workspaces/delete-machine.test.ts +298 -0
- package/src/settings/workspaces/delete-machine.ts +392 -0
- package/src/settings/workspaces/project-extensions.tsx +537 -0
- package/src/settings/workspaces/project-folder-missing.tsx +29 -0
- package/src/settings/workspaces/project-lsp.test.ts +65 -0
- package/src/settings/workspaces/project-lsp.ts +31 -0
- package/src/settings/workspaces/project-machine.test.ts +285 -0
- package/src/settings/workspaces/project-machine.ts +374 -0
- package/src/settings/workspaces/project-model.ts +201 -0
- package/src/settings/workspaces/project-options.tsx +81 -0
- package/src/settings/workspaces/project-row.tsx +121 -0
- package/src/settings/workspaces/project.css +397 -0
- package/src/settings/workspaces/project.tsx +266 -0
- package/src/settings/workspaces/projects.tsx +199 -0
- package/src/settings/workspaces/queries.ts +66 -0
- package/src/settings/workspaces/workspaces.tsx +705 -0
- package/src/shell/commands/command-search.tsx +41 -0
- package/src/shell/commands/command.test.ts +118 -0
- package/src/shell/commands/command.tsx +584 -0
- package/src/shell/commands/desktop-menu.test.ts +48 -0
- package/src/shell/commands/desktop-menu.ts +322 -0
- package/src/shell/commands/desktop.tsx +27 -0
- package/src/shell/commands/dialog.css +263 -0
- package/src/shell/commands/dialog.standalone.stories.tsx +247 -0
- package/src/shell/commands/dialog.tsx +318 -0
- package/src/shell/commands/highlight-machine.test.ts +64 -0
- package/src/shell/commands/highlight-machine.ts +54 -0
- package/src/shell/commands/key-sequence.tsx +38 -0
- package/src/shell/commands/keymap.test.ts +219 -0
- package/src/shell/commands/keymap.ts +275 -0
- package/src/shell/commands/palette.ts +466 -0
- package/src/shell/commands/safe-triangle.ts +64 -0
- package/src/shell/commands/search-machine.test.ts +218 -0
- package/src/shell/commands/search-machine.ts +274 -0
- package/src/shell/commands/search.ts +136 -0
- package/src/shell/commands/session-search.tsx +111 -0
- package/src/shell/commands/suspend-machine.test.ts +59 -0
- package/src/shell/commands/suspend-machine.ts +46 -0
- package/src/shell/deep-links/deep-links.ts +65 -0
- package/src/shell/deep-links/machine.test.ts +67 -0
- package/src/shell/deep-links/machine.ts +67 -0
- package/src/shell/errors/description.test.ts +32 -0
- package/src/shell/errors/description.ts +32 -0
- package/src/shell/errors/error.tsx +515 -0
- package/src/shell/errors/machine.test.ts +178 -0
- package/src/shell/errors/machine.ts +217 -0
- package/src/shell/layout/helpers.test.ts +76 -0
- package/src/shell/layout/helpers.ts +78 -0
- package/src/shell/layout/project-avatar-state.ts +157 -0
- package/src/shell/layout/project-icon.tsx +31 -0
- package/src/shell/layout/project-icons.tsx +34 -0
- package/src/shell/layout/session-tab-avatar.tsx +28 -0
- package/src/shell/mobile-drawer.css +90 -0
- package/src/shell/mobile-drawer.tsx +53 -0
- package/src/shell/mobile-panel-drawer.css +34 -0
- package/src/shell/mobile-panel-drawer.tsx +98 -0
- package/src/shell/notifications/coordinator.ts +160 -0
- package/src/shell/notifications/focus-lock-machine.test.ts +79 -0
- package/src/shell/notifications/focus-lock-machine.ts +76 -0
- package/src/shell/notifications/machine.test.ts +297 -0
- package/src/shell/notifications/machine.ts +313 -0
- package/src/shell/notifications/notification.test.ts +28 -0
- package/src/shell/notifications/notification.tsx +526 -0
- package/src/shell/notifications/sound.ts +113 -0
- package/src/shell/notifications/toast.tsx +53 -0
- package/src/shell/palette-menu.css +105 -0
- package/src/shell/panel-motion-machine.test.ts +167 -0
- package/src/shell/panel-motion-machine.ts +217 -0
- package/src/shell/panel-motion.test.ts +26 -0
- package/src/shell/panel-motion.ts +435 -0
- package/src/shell/project-navigation.ts +21 -0
- package/src/shell/routes/routes.tsx +140 -0
- package/src/shell/routes/session-reference-lookup-machine.test.ts +111 -0
- package/src/shell/routes/session-reference-lookup-machine.ts +86 -0
- package/src/shell/routes/session-ui-navigate-machine.test.ts +124 -0
- package/src/shell/routes/session-ui-navigate-machine.ts +127 -0
- package/src/shell/routes/session-ui-provider.tsx +267 -0
- package/src/shell/routes/session.test.ts +46 -0
- package/src/shell/routes/session.ts +30 -0
- package/src/shell/search-list.css +366 -0
- package/src/shell/shell.tsx +340 -0
- package/src/shell/sidebar-peek-machine.test.ts +240 -0
- package/src/shell/sidebar-peek-machine.ts +331 -0
- package/src/shell/sidebar-peek.css +28 -0
- package/src/shell/sidebar-peek.ts +482 -0
- package/src/shell/sidebar-toggle.tsx +255 -0
- package/src/shell/state/helpers.ts +69 -0
- package/src/shell/state/intent-machine.test.ts +155 -0
- package/src/shell/state/intent-machine.ts +216 -0
- package/src/shell/state/layout.test.ts +169 -0
- package/src/shell/state/layout.tsx +794 -0
- package/src/shell/state/scoped-machine.test.ts +69 -0
- package/src/shell/state/scoped-machine.ts +77 -0
- package/src/shell/state/scroll-machine.test.ts +109 -0
- package/src/shell/state/scroll-machine.ts +94 -0
- package/src/shell/state/scroll.test.ts +83 -0
- package/src/shell/state/scroll.ts +124 -0
- package/src/shell/state/session-preferences.ts +62 -0
- package/src/shell/state/session-tabs.test.ts +188 -0
- package/src/shell/state/session-tabs.ts +257 -0
- package/src/shell/tabs/closed.ts +83 -0
- package/src/shell/tabs/hydration-machine.test.ts +98 -0
- package/src/shell/tabs/hydration-machine.ts +115 -0
- package/src/shell/tabs/memory.ts +41 -0
- package/src/shell/tabs/navigation-switch.ts +75 -0
- package/src/shell/tabs/pins.test.ts +68 -0
- package/src/shell/tabs/pins.ts +194 -0
- package/src/shell/tabs/preview-machine.test.ts +89 -0
- package/src/shell/tabs/preview-machine.ts +46 -0
- package/src/shell/tabs/preview.test.ts +153 -0
- package/src/shell/tabs/preview.ts +102 -0
- package/src/shell/tabs/project-sessions.ts +60 -0
- package/src/shell/tabs/promotion-machine.test.ts +203 -0
- package/src/shell/tabs/promotion-machine.ts +194 -0
- package/src/shell/tabs/schema.ts +86 -0
- package/src/shell/tabs/tabs.test.ts +331 -0
- package/src/shell/tabs/tabs.tsx +927 -0
- package/src/shell/time.test.ts +23 -0
- package/src/shell/time.ts +31 -0
- package/src/shell/titlebar/auto-tab-groups.test.ts +76 -0
- package/src/shell/titlebar/auto-tab-groups.ts +88 -0
- package/src/shell/titlebar/auto-tab-sections.tsx +207 -0
- package/src/shell/titlebar/history-machine.test.ts +184 -0
- package/src/shell/titlebar/history-machine.ts +149 -0
- package/src/shell/titlebar/history.ts +64 -0
- package/src/shell/titlebar/inbox-branch-machine.test.ts +146 -0
- package/src/shell/titlebar/inbox-branch-machine.ts +265 -0
- package/src/shell/titlebar/inbox-card.stories.tsx +197 -0
- package/src/shell/titlebar/inbox-list.stories.tsx +342 -0
- package/src/shell/titlebar/inbox-model.ts +539 -0
- package/src/shell/titlebar/inbox-settle-machine.test.ts +108 -0
- package/src/shell/titlebar/inbox-settle-machine.ts +141 -0
- package/src/shell/titlebar/inbox-working.test.ts +26 -0
- package/src/shell/titlebar/inbox-working.ts +22 -0
- package/src/shell/titlebar/inbox.tsx +985 -0
- package/src/shell/titlebar/mobile-tabs-machine.test.ts +105 -0
- package/src/shell/titlebar/mobile-tabs-machine.ts +102 -0
- package/src/shell/titlebar/navigation-story.tsx +207 -0
- package/src/shell/titlebar/pinned-area.css +164 -0
- package/src/shell/titlebar/pinned-area.tsx +629 -0
- package/src/shell/titlebar/project-session-row.tsx +334 -0
- package/src/shell/titlebar/recent-sessions-model.test.ts +657 -0
- package/src/shell/titlebar/recent-sessions-model.ts +469 -0
- package/src/shell/titlebar/recent-sessions.tsx +1415 -0
- package/src/shell/titlebar/recent-view-menu.tsx +147 -0
- package/src/shell/titlebar/recent-view.test.ts +99 -0
- package/src/shell/titlebar/recent-view.ts +183 -0
- package/src/shell/titlebar/recently-closed-tabs-menu.css +25 -0
- package/src/shell/titlebar/recently-closed-tabs-menu.tsx +260 -0
- package/src/shell/titlebar/route-machine.test.ts +259 -0
- package/src/shell/titlebar/route-machine.ts +206 -0
- package/src/shell/titlebar/route-sync.ts +191 -0
- package/src/shell/titlebar/session-events.test.ts +23 -0
- package/src/shell/titlebar/session-events.ts +41 -0
- package/src/shell/titlebar/session-rename-dialog-machine.test.ts +151 -0
- package/src/shell/titlebar/session-rename-dialog-machine.ts +159 -0
- package/src/shell/titlebar/sidebar-customized.standalone.stories.tsx +16 -0
- package/src/shell/titlebar/sidebar-customized.tsx +747 -0
- package/src/shell/titlebar/sidebar-pins.tsx +462 -0
- package/src/shell/titlebar/sidebar-sessions.test.ts +96 -0
- package/src/shell/titlebar/sidebar-sessions.ts +29 -0
- package/src/shell/titlebar/sidebar-view-menu.tsx +191 -0
- package/src/shell/titlebar/sidebar-view.test.ts +185 -0
- package/src/shell/titlebar/sidebar-view.ts +208 -0
- package/src/shell/titlebar/tab-group-drag-machine.ts +1479 -0
- package/src/shell/titlebar/tab-groups-ui.tsx +1246 -0
- package/src/shell/titlebar/tab-groups.css +269 -0
- package/src/shell/titlebar/tab-groups.test.ts +667 -0
- package/src/shell/titlebar/tab-groups.ts +496 -0
- package/src/shell/titlebar/tab-hints-machine.test.ts +97 -0
- package/src/shell/titlebar/tab-hints-machine.ts +79 -0
- package/src/shell/titlebar/tab-load-machine.test.ts +178 -0
- package/src/shell/titlebar/tab-load-machine.ts +233 -0
- package/src/shell/titlebar/tab-nav.css +581 -0
- package/src/shell/titlebar/tab-nav.tsx +891 -0
- package/src/shell/titlebar/tab-order.test.ts +22 -0
- package/src/shell/titlebar/tab-order.ts +24 -0
- package/src/shell/titlebar/tab-popover-machine.test.ts +79 -0
- package/src/shell/titlebar/tab-popover-machine.ts +92 -0
- package/src/shell/titlebar/tab-popover.css +129 -0
- package/src/shell/titlebar/tab-popover.tsx +144 -0
- package/src/shell/titlebar/tab-rename-machine.test.ts +206 -0
- package/src/shell/titlebar/tab-rename-machine.ts +297 -0
- package/src/shell/titlebar/tab-strip.standalone.stories.tsx +19 -0
- package/src/shell/titlebar/tab-strip.tsx +1228 -0
- package/src/shell/titlebar/tab-title.test.ts +14 -0
- package/src/shell/titlebar/tab-title.ts +6 -0
- package/src/shell/titlebar/titlebar.css +197 -0
- package/src/shell/titlebar/titlebar.tsx +1075 -0
- package/src/shell/titlebar/windows-menu.test.ts +20 -0
- package/src/shell/titlebar/windows-menu.tsx +193 -0
- package/src/sst-env.d.ts +12 -0
- package/src/theme-preload.test.ts +56 -0
- package/src/tips/model.ts +155 -0
- package/src/tips/queue.test.ts +43 -0
- package/src/tips/queue.ts +46 -0
- package/src/usage/dialog.css +8 -0
- package/src/usage/dialog.standalone.stories.tsx +137 -0
- package/src/usage/dialog.tsx +570 -0
- package/src/usage/format.ts +39 -0
- package/src/usage/limits.test.ts +141 -0
- package/src/usage/limits.ts +189 -0
- package/src/usage/machine.test.ts +128 -0
- package/src/usage/machine.ts +159 -0
- package/src/usage/model.tsx +55 -0
- package/src/voice/call-machine.test.ts +245 -0
- package/src/voice/call-machine.ts +327 -0
- package/src/voice/call.ts +362 -0
- package/src/voice/composer.tsx +300 -0
- package/src/voice/context.tsx +152 -0
- package/src/voice/coordination.test.ts +58 -0
- package/src/voice/fixtures/history.ts +51 -0
- package/src/voice/gate-machine.test.ts +91 -0
- package/src/voice/gate-machine.ts +148 -0
- package/src/voice/handoff.test.ts +35 -0
- package/src/voice/handoff.ts +20 -0
- package/src/voice/machine.test.ts +303 -0
- package/src/voice/machine.ts +349 -0
- package/src/voice/messages.test.ts +49 -0
- package/src/voice/messages.ts +15 -0
- package/src/voice/panel-machine.test.ts +106 -0
- package/src/voice/panel-machine.ts +167 -0
- package/src/voice/protocol.ts +62 -0
- package/src/voice/replies.ts +71 -0
- package/src/voice/reply-machine.test.ts +290 -0
- package/src/voice/reply-machine.ts +303 -0
- package/src/voice/search.test.ts +35 -0
- package/src/voice/search.ts +134 -0
- package/src/voice/spec.ts +114 -0
- package/src/voice/tail-machine.test.ts +124 -0
- package/src/voice/tail-machine.ts +155 -0
- package/src/voice/tail.ts +55 -0
- package/src/voice/tools.test.ts +320 -0
- package/src/voice/tools.ts +336 -0
- package/src/voice/transport-machine.test.ts +295 -0
- package/src/voice/transport-machine.ts +338 -0
- package/src/voice/transport.test.ts +295 -0
- package/src/voice/transport.ts +313 -0
- package/src/voice/voice.css +84 -0
- package/src/workspaces/create.test.ts +120 -0
- package/src/workspaces/create.ts +23 -0
- package/src/workspaces/files/artifact.test.ts +103 -0
- package/src/workspaces/files/artifact.ts +74 -0
- package/src/workspaces/files/content-cache-accounting.test.ts +79 -0
- package/src/workspaces/files/content-cache.ts +74 -0
- package/src/workspaces/files/content-machine.test.ts +269 -0
- package/src/workspaces/files/content-machine.ts +243 -0
- package/src/workspaces/files/model.tsx +423 -0
- package/src/workspaces/files/path.test.ts +76 -0
- package/src/workspaces/files/path.ts +143 -0
- package/src/workspaces/files/tree-machine.test.ts +300 -0
- package/src/workspaces/files/tree-machine.ts +286 -0
- package/src/workspaces/files/tree-store.ts +142 -0
- package/src/workspaces/files/types.ts +85 -0
- package/src/workspaces/files/view-cache.ts +164 -0
- package/src/workspaces/files/watcher.test.ts +114 -0
- package/src/workspaces/files/watcher.ts +42 -0
- package/src/workspaces/inventory.test.ts +151 -0
- package/src/workspaces/inventory.ts +64 -0
- package/src/workspaces/location-machine.test.ts +135 -0
- package/src/workspaces/location-machine.ts +159 -0
- package/src/workspaces/location.tsx +111 -0
- package/src/workspaces/path-key.ts +5 -0
- package/src/workspaces/paths.test.ts +193 -0
- package/src/workspaces/paths.ts +123 -0
- package/src/workspaces/selection/combobox-machine.test.ts +286 -0
- package/src/workspaces/selection/combobox-machine.ts +331 -0
- package/src/workspaces/selection/dialog.css +234 -0
- package/src/workspaces/selection/dialog.standalone.stories.tsx +66 -0
- package/src/workspaces/selection/dialog.tsx +867 -0
- package/src/workspaces/selection/domain.test.ts +603 -0
- package/src/workspaces/selection/domain.ts +609 -0
- package/src/workspaces/selection/picker.test.ts +37 -0
- package/src/workspaces/selection/picker.tsx +77 -0
- package/src/workspaces/selection/policy.ts +8 -0
- package/src/workspaces/selection/queue-machine.test.ts +116 -0
- package/src/workspaces/selection/queue-machine.ts +203 -0
- package/src/workspaces/selection/tree-machine.test.ts +293 -0
- package/src/workspaces/selection/tree-machine.ts +506 -0
- package/test-browser/animated-presence-state.test.ts +134 -0
- package/test-browser/auto-scroll.test.ts +111 -0
- package/test-browser/browser-pane-model.test.ts +522 -0
- package/test-browser/child-store-eviction.test.ts +86 -0
- package/test-browser/command-palette-search.test.ts +157 -0
- package/test-browser/command-palette.test.ts +262 -0
- package/test-browser/composer-attachment-errors.test.tsx +140 -0
- package/test-browser/composer-attachment-ownership.test.tsx +132 -0
- package/test-browser/composer-drag-cancel.test.tsx +41 -0
- package/test-browser/composer-file-search.test.ts +183 -0
- package/test-browser/composer-ime.test.ts +58 -0
- package/test-browser/composer-submit-loading.test.ts +235 -0
- package/test-browser/composer-write-batch.test.ts +201 -0
- package/test-browser/draft-history-cache.test.ts +139 -0
- package/test-browser/elicitation-dock.test.ts +110 -0
- package/test-browser/file-tree-store.test.ts +113 -0
- package/test-browser/fixtures/model-selection.ts +646 -0
- package/test-browser/message-page-publication.test.ts +46 -0
- package/test-browser/model-selection.test.ts +25 -0
- package/test-browser/motion-dom.test.ts +367 -0
- package/test-browser/motion-spring.test.ts +75 -0
- package/test-browser/pane-drag.test.tsx +136 -0
- package/test-browser/panel-motion.test.ts +398 -0
- package/test-browser/persisted-consumers.test.ts +40 -0
- package/test-browser/playwright-config.test.ts +72 -0
- package/test-browser/plugin-catalog.test.ts +67 -0
- package/test-browser/plugin-link-check.test.ts +102 -0
- package/test-browser/plugin-migrations.test.ts +170 -0
- package/test-browser/plugin-primitives.test.ts +616 -0
- package/test-browser/plugin-server-stream.test.ts +88 -0
- package/test-browser/presence.test.ts +236 -0
- package/test-browser/project-avatar-hover.test.ts +143 -0
- package/test-browser/prompt-motion.test.ts +10 -0
- package/test-browser/prompt-persistence.test.ts +312 -0
- package/test-browser/prompt-scope.test.ts +15 -0
- package/test-browser/provider-catalog.test.ts +54 -0
- package/test-browser/pwa-route.test.ts +96 -0
- package/test-browser/question-dock.test.ts +128 -0
- package/test-browser/schema-persistence.test.ts +294 -0
- package/test-browser/selected-effect.test.ts +36 -0
- package/test-browser/server-connection-sync.test.ts +34 -0
- package/test-browser/server-notification-state.test.ts +662 -0
- package/test-browser/session-activity-elapsed.test.ts +62 -0
- package/test-browser/session-background.test.ts +377 -0
- package/test-browser/session-message-handoffs.test.ts +118 -0
- package/test-browser/session-resolution.test.ts +385 -0
- package/test-browser/settings-keybinds.test.ts +196 -0
- package/test-browser/shell-panel.test.ts +219 -0
- package/test-browser/sidebar-peek.test.ts +149 -0
- package/test-browser/solid-router-cleanup.test.ts +66 -0
- package/test-browser/solid-runtime.test.ts +95 -0
- package/test-browser/solid-virtual.test.ts +249 -0
- package/test-browser/ssh-composer.test.ts +41 -0
- package/test-browser/ssh-health.test.ts +142 -0
- package/test-browser/theme-preload.test.ts +9 -0
- package/test-browser/timeline-cache.test.ts +571 -0
- package/test-browser/timeline-projection.test.ts +363 -0
- package/test-browser/toast-owner.test.ts +66 -0
- package/test-browser/websearch-request.test.ts +277 -0
- package/tsconfig.json +35 -0
- package/vite.config.ts +62 -0
- package/vite.icons.test.ts +133 -0
- package/vite.icons.ts +65 -0
- package/vite.js +142 -0
- package/vite.pwa.ts +69 -0
|
@@ -0,0 +1,1415 @@
|
|
|
1
|
+
import { isSessionNotFoundError, type SessionInfo } from "@zyro-sec/client/promise"
|
|
2
|
+
import { Accessibility, Feedback, PointerActivationConstraints } from "@dnd-kit/dom"
|
|
3
|
+
import { RestrictToVerticalAxis } from "@dnd-kit/abstract/modifiers"
|
|
4
|
+
import { DragDropProvider, PointerSensor } from "@dnd-kit/solid"
|
|
5
|
+
import { isSortable, useSortable } from "@dnd-kit/solid/sortable"
|
|
6
|
+
import { Key } from "@solid-primitives/keyed"
|
|
7
|
+
import { useQueryClient } from "@tanstack/solid-query"
|
|
8
|
+
import { Button } from "@zyro-sec/ui/button"
|
|
9
|
+
import { useDialog, useDialogLayer } from "@zyro-sec/ui/context/dialog"
|
|
10
|
+
import { Dialog, DialogFooter, DialogHeader, DialogTitleGroup } from "@zyro-sec/ui/dialog"
|
|
11
|
+
import { Loader } from "@zyro-sec/ui/loader"
|
|
12
|
+
import { Icon } from "@zyro-sec/ui/icon"
|
|
13
|
+
import { Menu } from "@zyro-sec/ui/menu"
|
|
14
|
+
import { displayName } from "@zyro-sec/ui/project-avatar"
|
|
15
|
+
import { Schema } from "effect"
|
|
16
|
+
import { batch, createEffect, createMemo, onCleanup, Show, startTransition, untrack, type JSX } from "solid-js"
|
|
17
|
+
import { createStore, produce, reconcile } from "solid-js/store"
|
|
18
|
+
import { arrayMove } from "@/runtime/array-move"
|
|
19
|
+
import { useLanguage } from "@/runtime/i18n/language"
|
|
20
|
+
import { Persistence } from "@/runtime/persistence/schema"
|
|
21
|
+
import { Persist, persisted } from "@/runtime/persistence/storage"
|
|
22
|
+
import { rawTime } from "@/runtime/server/data"
|
|
23
|
+
import { ServerConnection, useServers } from "@/runtime/server/registry"
|
|
24
|
+
import { useGlobal, type ServerCtx } from "@/runtime/server/runtime"
|
|
25
|
+
import { sessionTreeIDs } from "@/session/requests/session-request-tree"
|
|
26
|
+
import { errorMessage } from "@/shell/layout/helpers"
|
|
27
|
+
import { sessionStatus, useSessionTabAvatarState } from "@/shell/layout/project-avatar-state"
|
|
28
|
+
import { projectSettingsKey, useSettings } from "@/settings/model"
|
|
29
|
+
import { pathKey } from "@/workspaces/path-key"
|
|
30
|
+
import { showToast } from "@/shell/notifications/toast"
|
|
31
|
+
import { setSidebarUnread } from "@/shell/sidebar-peek"
|
|
32
|
+
import { useLayout } from "@/shell/state/layout"
|
|
33
|
+
import { tabHref, useTabs } from "@/shell/tabs/tabs"
|
|
34
|
+
import {
|
|
35
|
+
addPin,
|
|
36
|
+
dedupePins,
|
|
37
|
+
INITIAL_RECENT_PAGE_STATE,
|
|
38
|
+
RECENT_PAGE_LIMIT,
|
|
39
|
+
RECENT_RELOAD_DELAY_MS,
|
|
40
|
+
RECENT_VISIBLE_LIMIT,
|
|
41
|
+
mergeRecentSessions,
|
|
42
|
+
partitionRecentSessions,
|
|
43
|
+
recentPageFailed,
|
|
44
|
+
recentPageHasMore,
|
|
45
|
+
recentPageLoaded,
|
|
46
|
+
recentPageLoadingMore,
|
|
47
|
+
recentReloadsOn,
|
|
48
|
+
recentRowUnread,
|
|
49
|
+
recentSessionEndpoints,
|
|
50
|
+
recentSessionKey,
|
|
51
|
+
removePin,
|
|
52
|
+
reorderPins,
|
|
53
|
+
splitRecentSessionKey,
|
|
54
|
+
transitionRecentPage,
|
|
55
|
+
windowRecentSessions,
|
|
56
|
+
type RecentPageEffect,
|
|
57
|
+
type RecentPageEvent,
|
|
58
|
+
type RecentPageState,
|
|
59
|
+
type RecentSession,
|
|
60
|
+
} from "./recent-sessions-model"
|
|
61
|
+
import {
|
|
62
|
+
DEFAULT_RECENT_VIEW,
|
|
63
|
+
NO_PROJECT,
|
|
64
|
+
RECENT_DATES,
|
|
65
|
+
RECENT_STATUSES,
|
|
66
|
+
RecentViewState,
|
|
67
|
+
recentGroups,
|
|
68
|
+
type RecentGroup,
|
|
69
|
+
type RecentStatus,
|
|
70
|
+
type RecentView,
|
|
71
|
+
type RecentViewRow,
|
|
72
|
+
} from "./recent-view"
|
|
73
|
+
import { RecentViewMenu } from "./recent-view-menu"
|
|
74
|
+
import { notifySessionTabsRemoved } from "./session-events"
|
|
75
|
+
import { TabNavItem } from "./tab-nav"
|
|
76
|
+
import { createSessionRowNavigation, syncInactiveSession } from "./tab-strip"
|
|
77
|
+
import { sessionTabTitle } from "./tab-title"
|
|
78
|
+
|
|
79
|
+
const RecentSidebarState = Persistence.struct({
|
|
80
|
+
// Ordered `${server}\u0000${sessionID}` keys. Local to this desktop.
|
|
81
|
+
pins: Persistence.array(Schema.String),
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
type Connection = { conn: ServerConnection.Any; ctx: ServerCtx; server: ServerConnection.Key }
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The experimental Recent sessions sidebar: pinned sessions first, then every server's root sessions from the last
|
|
88
|
+
* 7 days in one recency list, at most 30 until Show more reveals older ones. The desktop titlebar renders it in place of the side tabs only while the setting is on and available.
|
|
89
|
+
*/
|
|
90
|
+
export function RecentSessions(
|
|
91
|
+
input: {
|
|
92
|
+
/** The navigation prototype's pins and groups replace this list's own pins; their sessions leave the recent rows. */
|
|
93
|
+
pinned?: {
|
|
94
|
+
content: () => JSX.Element
|
|
95
|
+
keys: () => string[]
|
|
96
|
+
current: () => string | undefined
|
|
97
|
+
unread: (key: string) => boolean
|
|
98
|
+
navigate: (key: string) => void
|
|
99
|
+
holds: (server: string, sessionID: string) => boolean
|
|
100
|
+
toggle: (server: string, sessionID: string) => void
|
|
101
|
+
}
|
|
102
|
+
/** The navigation prototype's Group and sort menu on Recent's headings; View all opens the Sessions page. */
|
|
103
|
+
organize?: { viewAll: () => void }
|
|
104
|
+
} = {},
|
|
105
|
+
) {
|
|
106
|
+
const global = useGlobal()
|
|
107
|
+
const servers = useServers()
|
|
108
|
+
const language = useLanguage()
|
|
109
|
+
const layout = useLayout()
|
|
110
|
+
const tabs = useTabs()
|
|
111
|
+
const dialog = useDialog()
|
|
112
|
+
const queryClient = useQueryClient()
|
|
113
|
+
|
|
114
|
+
const settings = useSettings()
|
|
115
|
+
|
|
116
|
+
const [state, setState, , ready] = persisted(Persist.global("sidebar.recent"), RecentSidebarState, { pins: [] })
|
|
117
|
+
|
|
118
|
+
const [arrangementState, setArrangement] = persisted(
|
|
119
|
+
Persist.global("navigation.recent-view"),
|
|
120
|
+
RecentViewState,
|
|
121
|
+
DEFAULT_RECENT_VIEW,
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
const arrangement = (): RecentView => (input.organize ? arrangementState : DEFAULT_RECENT_VIEW)
|
|
125
|
+
|
|
126
|
+
const [pages, setPages] = createStore<Record<string, RecentPageState>>({})
|
|
127
|
+
|
|
128
|
+
const [hydration, setHydration] = createStore<Record<string, SessionInfo>>({})
|
|
129
|
+
|
|
130
|
+
// Whether each row shows its unread dot, keyed like the rows.
|
|
131
|
+
const [unread, setUnread] = createStore<Record<string, boolean>>({})
|
|
132
|
+
|
|
133
|
+
// `revealed` counts the rows Show more added beyond the 7-day window. `now` ticks each minute so the window moves.
|
|
134
|
+
const [view, setView] = createStore({ revealed: 0, now: Date.now() })
|
|
135
|
+
|
|
136
|
+
const clock = setInterval(() => setView("now", Date.now()), 60_000)
|
|
137
|
+
onCleanup(() => clearInterval(clock))
|
|
138
|
+
|
|
139
|
+
const controllers = new Map<AbortController, string>()
|
|
140
|
+
const timers = new Map<string, ReturnType<typeof setTimeout>>()
|
|
141
|
+
const reloads = new Map<string, ReturnType<typeof setTimeout>>()
|
|
142
|
+
const hydrationControllers = new Map<string, AbortController>()
|
|
143
|
+
const statuses = new Map<string, { ctx: ServerCtx; status: string }>()
|
|
144
|
+
let attempt = 0
|
|
145
|
+
let disposed = false
|
|
146
|
+
|
|
147
|
+
const connections = createMemo(() =>
|
|
148
|
+
servers.visible.flatMap((conn): Connection[] => {
|
|
149
|
+
const server = ServerConnection.key(conn)
|
|
150
|
+
const ctx = global.serverCtx(server)
|
|
151
|
+
|
|
152
|
+
return ctx ? [{ conn, ctx, server }] : []
|
|
153
|
+
}),
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
const ctxOf = (item: RecentSession) => global.serverCtx(ServerConnection.Key.make(item.server))
|
|
157
|
+
|
|
158
|
+
const isCurrent = (item: Connection) =>
|
|
159
|
+
connections().some((entry) => entry.server === item.server && entry.ctx === item.ctx)
|
|
160
|
+
|
|
161
|
+
const clearTimer = (server: string) => {
|
|
162
|
+
const timer = timers.get(server)
|
|
163
|
+
|
|
164
|
+
if (timer === undefined) return
|
|
165
|
+
|
|
166
|
+
clearTimeout(timer)
|
|
167
|
+
timers.delete(server)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const cancelReload = (server: string) => {
|
|
171
|
+
clearTimeout(reloads.get(server))
|
|
172
|
+
reloads.delete(server)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Order follows each server's last snapshot, so only a new root session reloads page one. Bursts coalesce per server.
|
|
176
|
+
const reload = (item: Connection) => {
|
|
177
|
+
cancelReload(item.server)
|
|
178
|
+
reloads.set(
|
|
179
|
+
item.server,
|
|
180
|
+
setTimeout(() => {
|
|
181
|
+
reloads.delete(item.server)
|
|
182
|
+
|
|
183
|
+
if (disposed || !isCurrent(item) || item.ctx.sdk.connection.status() !== "connected") return
|
|
184
|
+
|
|
185
|
+
dispatch(item, { type: "reload", attempt: ++attempt })
|
|
186
|
+
}, RECENT_RELOAD_DELAY_MS),
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const abortPages = (server: string) => {
|
|
191
|
+
controllers.forEach((owner, controller) => {
|
|
192
|
+
if (owner === server) controller.abort()
|
|
193
|
+
})
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const abortHydration = (server?: string) => {
|
|
197
|
+
hydrationControllers.forEach((controller, key) => {
|
|
198
|
+
if (server && splitRecentSessionKey(key)?.server !== server) return
|
|
199
|
+
|
|
200
|
+
controller.abort()
|
|
201
|
+
|
|
202
|
+
if (server) hydrationControllers.delete(key)
|
|
203
|
+
})
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const clearHydration = (server: string) => {
|
|
207
|
+
setHydration(
|
|
208
|
+
produce((current) => {
|
|
209
|
+
for (const key of Object.keys(current)) {
|
|
210
|
+
if (splitRecentSessionKey(key)?.server === server) delete current[key]
|
|
211
|
+
}
|
|
212
|
+
}),
|
|
213
|
+
)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function rememberPin(item: Connection, key: string, info: SessionInfo) {
|
|
217
|
+
batch(() => {
|
|
218
|
+
if (item.ctx.data.session.get(info.id)) item.ctx.data.session.remember(info)
|
|
219
|
+
setHydration(key, reconcile(info))
|
|
220
|
+
})
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function hydrate(item: Connection, key: string, sessionID: string) {
|
|
224
|
+
if (disposed || hydrationControllers.has(key)) return
|
|
225
|
+
|
|
226
|
+
const controller = new AbortController()
|
|
227
|
+
hydrationControllers.set(key, controller)
|
|
228
|
+
|
|
229
|
+
void item.ctx.sdk.api.session
|
|
230
|
+
.get({ sessionID }, { signal: controller.signal })
|
|
231
|
+
.then(
|
|
232
|
+
(response) => {
|
|
233
|
+
if (controller.signal.aborted || disposed) return
|
|
234
|
+
|
|
235
|
+
if (!isCurrent(item)) return
|
|
236
|
+
|
|
237
|
+
rememberPin(item, key, response)
|
|
238
|
+
},
|
|
239
|
+
(cause) => {
|
|
240
|
+
if (controller.signal.aborted || disposed) return
|
|
241
|
+
|
|
242
|
+
if (!isCurrent(item)) return
|
|
243
|
+
|
|
244
|
+
if (!isSessionNotFoundError(cause)) return
|
|
245
|
+
|
|
246
|
+
batch(() => {
|
|
247
|
+
item.ctx.data.session.forget(sessionID)
|
|
248
|
+
forget(item.server, sessionID)
|
|
249
|
+
global.sessionPreferences.forget(item.server, sessionID)
|
|
250
|
+
setHydration(produce((cache) => void delete cache[key]))
|
|
251
|
+
removePinKey(key)
|
|
252
|
+
})
|
|
253
|
+
},
|
|
254
|
+
)
|
|
255
|
+
.finally(() => {
|
|
256
|
+
if (hydrationControllers.get(key) !== controller) return
|
|
257
|
+
|
|
258
|
+
hydrationControllers.delete(key)
|
|
259
|
+
})
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// A server that leaves the visible list owns no rows or hydration; its pins stay for when it returns.
|
|
263
|
+
const dropServer = (server: string) => {
|
|
264
|
+
abortPages(server)
|
|
265
|
+
abortHydration(server)
|
|
266
|
+
clearTimer(server)
|
|
267
|
+
cancelReload(server)
|
|
268
|
+
setPages(produce((current) => void delete current[server]))
|
|
269
|
+
clearHydration(server)
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
function runEffect(item: Connection, effect: RecentPageEffect) {
|
|
273
|
+
if (effect.type === "timer.cancel") {
|
|
274
|
+
clearTimer(item.server)
|
|
275
|
+
|
|
276
|
+
return
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
if (effect.type === "timer.start") {
|
|
280
|
+
clearTimer(item.server)
|
|
281
|
+
timers.set(
|
|
282
|
+
item.server,
|
|
283
|
+
setTimeout(() => {
|
|
284
|
+
timers.delete(item.server)
|
|
285
|
+
dispatch(item, { type: "timed-out", attempt: effect.attempt })
|
|
286
|
+
}, effect.delayMs),
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
return
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// A new fetch supersedes the previous page request for this server.
|
|
293
|
+
abortPages(item.server)
|
|
294
|
+
|
|
295
|
+
const controller = new AbortController()
|
|
296
|
+
controllers.set(controller, item.server)
|
|
297
|
+
|
|
298
|
+
void item.ctx.sdk.api.session
|
|
299
|
+
.list(
|
|
300
|
+
effect.cursor
|
|
301
|
+
? { cursor: effect.cursor, limit: RECENT_PAGE_LIMIT }
|
|
302
|
+
: { parentID: null, archived: false, order: "desc", limit: RECENT_PAGE_LIMIT },
|
|
303
|
+
{ signal: controller.signal },
|
|
304
|
+
)
|
|
305
|
+
.then(
|
|
306
|
+
(response) => {
|
|
307
|
+
if (controller.signal.aborted || disposed) return
|
|
308
|
+
|
|
309
|
+
if (!isCurrent(item)) return
|
|
310
|
+
|
|
311
|
+
const page = pages[item.server]
|
|
312
|
+
|
|
313
|
+
if (page?.status !== "loading" || page.attempt !== effect.attempt) return
|
|
314
|
+
|
|
315
|
+
batch(() => {
|
|
316
|
+
if (page.kind === "refresh" || page.kind === "reload") {
|
|
317
|
+
const covered = new Map(response.data.map((info) => [info.id, info]))
|
|
318
|
+
|
|
319
|
+
for (const key of state.pins) {
|
|
320
|
+
const pin = splitRecentSessionKey(key)
|
|
321
|
+
|
|
322
|
+
if (pin?.server !== item.server) continue
|
|
323
|
+
const info = covered.get(pin.sessionID)
|
|
324
|
+
|
|
325
|
+
if (info) rememberPin(item, key, info)
|
|
326
|
+
// Live events keep other pins current while connected; only a reconnect may have missed some.
|
|
327
|
+
else if (page.kind === "refresh") hydrate(item, key, pin.sessionID)
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
dispatch(item, {
|
|
332
|
+
type: "succeeded",
|
|
333
|
+
attempt: effect.attempt,
|
|
334
|
+
sessions: response.data,
|
|
335
|
+
next: response.cursor.next ?? undefined,
|
|
336
|
+
})
|
|
337
|
+
})
|
|
338
|
+
},
|
|
339
|
+
() => {
|
|
340
|
+
if (controller.signal.aborted || disposed) return
|
|
341
|
+
|
|
342
|
+
if (!isCurrent(item)) return
|
|
343
|
+
|
|
344
|
+
dispatch(item, { type: "failed", attempt: effect.attempt })
|
|
345
|
+
},
|
|
346
|
+
)
|
|
347
|
+
.finally(() => controllers.delete(controller))
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
function dispatch(item: Connection, event: RecentPageEvent) {
|
|
351
|
+
untrack(() => {
|
|
352
|
+
const previous = pages[item.server] ?? INITIAL_RECENT_PAGE_STATE
|
|
353
|
+
const next = transitionRecentPage(previous, event)
|
|
354
|
+
|
|
355
|
+
if (next.state !== previous) setPages(item.server, reconcile(next.state))
|
|
356
|
+
next.effects.forEach((effect) => runEffect(item, effect))
|
|
357
|
+
})
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
function load(item: Connection, kind: "first" | "next" | "refresh") {
|
|
361
|
+
// A first page or reconnect refresh is already a fresh snapshot, so a pending reload would only repeat it.
|
|
362
|
+
if (kind !== "next") cancelReload(item.server)
|
|
363
|
+
|
|
364
|
+
dispatch(item, { type: "load", kind, attempt: ++attempt })
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
onCleanup(() => {
|
|
368
|
+
disposed = true
|
|
369
|
+
controllers.forEach((_, controller) => controller.abort())
|
|
370
|
+
hydrationControllers.forEach((controller) => controller.abort())
|
|
371
|
+
timers.forEach((timer) => clearTimeout(timer))
|
|
372
|
+
reloads.forEach((timer) => clearTimeout(timer))
|
|
373
|
+
})
|
|
374
|
+
|
|
375
|
+
// The store is local and long-lived; drop duplicates a previous version or a manual edit left behind.
|
|
376
|
+
createEffect(() => {
|
|
377
|
+
if (!ready()) return
|
|
378
|
+
|
|
379
|
+
const normalized = dedupePins(state.pins)
|
|
380
|
+
|
|
381
|
+
if (normalized.length !== state.pins.length) setState("pins", normalized)
|
|
382
|
+
})
|
|
383
|
+
|
|
384
|
+
// First pages follow connection state: load on the first connect, refresh the snapshot on every reconnect or
|
|
385
|
+
// context replacement, and forget pages whose server no longer has a controller.
|
|
386
|
+
createEffect(() => {
|
|
387
|
+
const list = connections()
|
|
388
|
+
const visible = new Set<string>(list.map((item) => item.server))
|
|
389
|
+
|
|
390
|
+
list.forEach((item) => {
|
|
391
|
+
const status = item.ctx.sdk.connection.status()
|
|
392
|
+
const previous = statuses.get(item.server)
|
|
393
|
+
const replaced = !!previous && previous.ctx !== item.ctx
|
|
394
|
+
|
|
395
|
+
statuses.set(item.server, { ctx: item.ctx, status })
|
|
396
|
+
|
|
397
|
+
// A replaced controller owns no old requests or pin snapshots, even before it reconnects.
|
|
398
|
+
if (replaced) dropServer(item.server)
|
|
399
|
+
|
|
400
|
+
if (status !== "connected") {
|
|
401
|
+
cancelReload(item.server)
|
|
402
|
+
|
|
403
|
+
return
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
if (!untrack(() => pages[item.server])) {
|
|
407
|
+
load(item, "first")
|
|
408
|
+
|
|
409
|
+
return
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
if (!replaced && previous?.status === status) return
|
|
413
|
+
|
|
414
|
+
// Page one supplies the fresh records; only pins outside it need a separate get.
|
|
415
|
+
abortHydration(item.server)
|
|
416
|
+
load(item, "refresh")
|
|
417
|
+
})
|
|
418
|
+
|
|
419
|
+
for (const server of [...statuses.keys()]) {
|
|
420
|
+
if (visible.has(server)) continue
|
|
421
|
+
|
|
422
|
+
statuses.delete(server)
|
|
423
|
+
dropServer(server)
|
|
424
|
+
}
|
|
425
|
+
})
|
|
426
|
+
|
|
427
|
+
const items = createMemo(() =>
|
|
428
|
+
connections().flatMap((item) => {
|
|
429
|
+
const fetched = pages[item.server]
|
|
430
|
+
|
|
431
|
+
return mergeRecentSessions(item.server, fetched?.sessions ?? [], item.ctx.data.session.known(), (rows) =>
|
|
432
|
+
item.ctx.data.session.apply(rows, { reloads: true }),
|
|
433
|
+
)
|
|
434
|
+
}),
|
|
435
|
+
)
|
|
436
|
+
|
|
437
|
+
const hydratedItems = createMemo(() => {
|
|
438
|
+
const result = new Map<string, RecentSession>()
|
|
439
|
+
|
|
440
|
+
connections().forEach((item) => {
|
|
441
|
+
state.pins.forEach((key) => {
|
|
442
|
+
const parsed = splitRecentSessionKey(key)
|
|
443
|
+
|
|
444
|
+
if (!parsed || parsed.server !== item.server) return
|
|
445
|
+
|
|
446
|
+
const value = hydration[key]
|
|
447
|
+
|
|
448
|
+
if (!value) return
|
|
449
|
+
|
|
450
|
+
const session = item.ctx.data.session.apply([value], { reloads: true })[0]
|
|
451
|
+
|
|
452
|
+
if (session) result.set(key, { key, server: item.server, session })
|
|
453
|
+
})
|
|
454
|
+
})
|
|
455
|
+
|
|
456
|
+
return result
|
|
457
|
+
})
|
|
458
|
+
|
|
459
|
+
// Pinned sessions older than the fetched pages load one by one. Not-found pins are dropped, not resurrected.
|
|
460
|
+
createEffect(() => {
|
|
461
|
+
if (!ready()) return
|
|
462
|
+
|
|
463
|
+
const loaded = new Set(items().map((item) => item.key))
|
|
464
|
+
const list = connections()
|
|
465
|
+
|
|
466
|
+
state.pins.forEach((key) => {
|
|
467
|
+
if (loaded.has(key) || hydrationControllers.has(key) || hydration[key]) return
|
|
468
|
+
const parsed = splitRecentSessionKey(key)
|
|
469
|
+
|
|
470
|
+
if (!parsed) return
|
|
471
|
+
|
|
472
|
+
const item = list.find((entry) => entry.server === parsed.server)
|
|
473
|
+
|
|
474
|
+
if (!item) return
|
|
475
|
+
|
|
476
|
+
if (item.ctx.sdk.connection.status() !== "connected") return
|
|
477
|
+
|
|
478
|
+
if (!recentPageLoaded(pages[item.server])) return
|
|
479
|
+
|
|
480
|
+
// A live entry that is archived is hidden and keeps its pin; one pending removal is already gone.
|
|
481
|
+
if (item.ctx.data.session.get(parsed.sessionID)) return
|
|
482
|
+
|
|
483
|
+
hydrate(item, key, parsed.sessionID)
|
|
484
|
+
})
|
|
485
|
+
})
|
|
486
|
+
|
|
487
|
+
// Deleted sessions drop their pin so a later reload cannot show a row that no longer exists.
|
|
488
|
+
createEffect(() => {
|
|
489
|
+
connections().forEach((item) => {
|
|
490
|
+
onCleanup(
|
|
491
|
+
item.ctx.data.on("session.deleted", (event) => {
|
|
492
|
+
const key = recentSessionKey(item.server, event.data.sessionID)
|
|
493
|
+
hydrationControllers.get(key)?.abort()
|
|
494
|
+
batch(() => {
|
|
495
|
+
removePinKey(key)
|
|
496
|
+
forget(item.server, event.data.sessionID)
|
|
497
|
+
setHydration(produce((cache) => void delete cache[key]))
|
|
498
|
+
})
|
|
499
|
+
}),
|
|
500
|
+
)
|
|
501
|
+
})
|
|
502
|
+
})
|
|
503
|
+
|
|
504
|
+
createEffect(() => {
|
|
505
|
+
connections().forEach((item) => {
|
|
506
|
+
onCleanup(
|
|
507
|
+
item.ctx.data.listen(({ details }) => {
|
|
508
|
+
if (recentReloadsOn(details)) reload(item)
|
|
509
|
+
}),
|
|
510
|
+
)
|
|
511
|
+
})
|
|
512
|
+
})
|
|
513
|
+
|
|
514
|
+
// A hydrated pin has no live entry, so archive events must reach its snapshot or Pinned keeps showing it.
|
|
515
|
+
createEffect(() => {
|
|
516
|
+
connections().forEach((item) => {
|
|
517
|
+
const update = (sessionID: string, archived: number | undefined) => {
|
|
518
|
+
const key = recentSessionKey(item.server, sessionID)
|
|
519
|
+
const value = hydration[key]
|
|
520
|
+
|
|
521
|
+
if (!value) return
|
|
522
|
+
|
|
523
|
+
setHydration(key, "time", "archived", archived)
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
onCleanup(
|
|
527
|
+
item.ctx.data.on("session.archived", (event) => {
|
|
528
|
+
update(event.data.sessionID, event.created)
|
|
529
|
+
forget(item.server, event.data.sessionID)
|
|
530
|
+
}),
|
|
531
|
+
)
|
|
532
|
+
onCleanup(
|
|
533
|
+
item.ctx.data.on("session.unarchived", (event) => {
|
|
534
|
+
update(event.data.sessionID, undefined)
|
|
535
|
+
|
|
536
|
+
// Hydrated pins have no live record to leave the archived state behind.
|
|
537
|
+
if (!item.ctx.data.session.get(event.data.sessionID)) {
|
|
538
|
+
void item.ctx.data.session.sync(event.data.sessionID).catch(() => undefined)
|
|
539
|
+
}
|
|
540
|
+
}),
|
|
541
|
+
)
|
|
542
|
+
})
|
|
543
|
+
})
|
|
544
|
+
|
|
545
|
+
const archived = (key: string) => {
|
|
546
|
+
const parsed = splitRecentSessionKey(key)
|
|
547
|
+
|
|
548
|
+
if (!parsed) return true
|
|
549
|
+
|
|
550
|
+
const live = global.serverCtx(ServerConnection.Key.make(parsed.server))?.data.session.get(parsed.sessionID)
|
|
551
|
+
|
|
552
|
+
if (live) return live.time.archived !== undefined
|
|
553
|
+
|
|
554
|
+
return hydration[key]?.time.archived !== undefined
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
const endpoints = createMemo(() => recentSessionEndpoints(servers.list, servers.ownUrl()))
|
|
558
|
+
|
|
559
|
+
const openSessions = createMemo(
|
|
560
|
+
() =>
|
|
561
|
+
new Set(
|
|
562
|
+
tabs.store.flatMap((tab) => (tab.type === "session" ? [recentSessionKey(tab.server, tab.sessionId)] : [])),
|
|
563
|
+
),
|
|
564
|
+
)
|
|
565
|
+
|
|
566
|
+
const partition = createMemo(() =>
|
|
567
|
+
partitionRecentSessions({
|
|
568
|
+
items: items(),
|
|
569
|
+
pins: input.pinned ? [] : state.pins,
|
|
570
|
+
endpoints: endpoints(),
|
|
571
|
+
open: openSessions(),
|
|
572
|
+
resolvePin: (key) => hydratedItems().get(key),
|
|
573
|
+
archived,
|
|
574
|
+
hidden: global.sessionPreferences.hidden,
|
|
575
|
+
}),
|
|
576
|
+
)
|
|
577
|
+
|
|
578
|
+
const pinned = () => partition().pinned
|
|
579
|
+
|
|
580
|
+
const recentSource = createMemo(() =>
|
|
581
|
+
input.pinned
|
|
582
|
+
? partition().recent.filter((item) => !input.pinned?.holds(item.server, item.session.id))
|
|
583
|
+
: partition().recent,
|
|
584
|
+
)
|
|
585
|
+
|
|
586
|
+
const windowed = createMemo(() =>
|
|
587
|
+
windowRecentSessions({
|
|
588
|
+
items: recentSource(),
|
|
589
|
+
now: view.now,
|
|
590
|
+
revealed: view.revealed,
|
|
591
|
+
serversHaveMore: connections().some((item) => recentPageHasMore(pages[item.server])),
|
|
592
|
+
}),
|
|
593
|
+
)
|
|
594
|
+
|
|
595
|
+
// The same status the row's avatar shows; muted sessions never count as unread.
|
|
596
|
+
const statusOf = (item: RecentSession): RecentStatus => {
|
|
597
|
+
const ctx = ctxOf(item)
|
|
598
|
+
|
|
599
|
+
if (!ctx) return "read"
|
|
600
|
+
const project = projectSettingsKey(ctx.sdk.scope, item.session.projectID)
|
|
601
|
+
|
|
602
|
+
const value = sessionStatus(ctx, item.session.id, {
|
|
603
|
+
root: true,
|
|
604
|
+
autoApprove: settings.permissions.autoApproves(project),
|
|
605
|
+
snapshot: item.session,
|
|
606
|
+
})
|
|
607
|
+
|
|
608
|
+
if (value === "input") return "attention"
|
|
609
|
+
|
|
610
|
+
if (value === "running") return "working"
|
|
611
|
+
|
|
612
|
+
if (value === "unread" && !global.sessionPreferences.muted(item.server, item.session.id)) return "unread"
|
|
613
|
+
|
|
614
|
+
return "read"
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
// Status grouping is the old Inbox: whatever needs you or is running shows even when it is older than the window.
|
|
618
|
+
const candidates = createMemo(() => {
|
|
619
|
+
const visible = windowed().visible
|
|
620
|
+
|
|
621
|
+
if (arrangement().groupBy !== "status") return visible
|
|
622
|
+
const shown = new Set(visible.map((item) => item.key))
|
|
623
|
+
|
|
624
|
+
return [
|
|
625
|
+
...visible,
|
|
626
|
+
...recentSource().filter((item) => {
|
|
627
|
+
if (shown.has(item.key)) return false
|
|
628
|
+
const status = statusOf(item)
|
|
629
|
+
|
|
630
|
+
return status === "attention" || status === "working"
|
|
631
|
+
}),
|
|
632
|
+
]
|
|
633
|
+
})
|
|
634
|
+
|
|
635
|
+
const groups = createMemo(() =>
|
|
636
|
+
recentGroups(
|
|
637
|
+
candidates().map((item): RecentViewRow & { item: RecentSession } => {
|
|
638
|
+
const project = ctxOf(item)?.projects.forSession(item.session)
|
|
639
|
+
|
|
640
|
+
return {
|
|
641
|
+
key: item.key,
|
|
642
|
+
item,
|
|
643
|
+
title: sessionTabTitle(item.session.title, language.t("command.session.new")) ?? "",
|
|
644
|
+
updated: item.session.time.updated ?? item.session.time.created,
|
|
645
|
+
created: item.session.time.created,
|
|
646
|
+
status: statusOf(item),
|
|
647
|
+
project: project
|
|
648
|
+
? { key: `${item.server}\u0000${pathKey(project.worktree)}`, label: displayName(project) }
|
|
649
|
+
: undefined,
|
|
650
|
+
server: item.server,
|
|
651
|
+
}
|
|
652
|
+
}),
|
|
653
|
+
arrangement(),
|
|
654
|
+
{
|
|
655
|
+
now: view.now,
|
|
656
|
+
servers: connections().map((entry) => ({ key: entry.server, label: servers.label(entry.conn) })),
|
|
657
|
+
},
|
|
658
|
+
),
|
|
659
|
+
)
|
|
660
|
+
|
|
661
|
+
const collapsed = (group: RecentGroup<RecentViewRow>) =>
|
|
662
|
+
arrangement().groupBy !== "none" && arrangement().collapsed.includes(group.key)
|
|
663
|
+
|
|
664
|
+
// A collapsed group still shows the session you're on, as a collapsed pinned group does.
|
|
665
|
+
const shownRows = (group: RecentGroup<RecentViewRow & { item: RecentSession }>) =>
|
|
666
|
+
group.rows.flatMap((entry) => (!collapsed(group) || selected(entry.item) ? [entry.item] : []))
|
|
667
|
+
|
|
668
|
+
// A collapsed group marks what its hidden rows need from you: an answer outranks unread work.
|
|
669
|
+
const hiddenMark = (group: RecentGroup<RecentViewRow & { item: RecentSession }>) => {
|
|
670
|
+
if (!collapsed(group)) return
|
|
671
|
+
const statuses = group.rows.filter((entry) => !selected(entry.item)).map((entry) => entry.status)
|
|
672
|
+
|
|
673
|
+
if (statuses.includes("attention")) return "attention"
|
|
674
|
+
|
|
675
|
+
if (statuses.includes("unread")) return "unread"
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
const toggleGroup = (key: string) =>
|
|
679
|
+
setArrangement("collapsed", (current) =>
|
|
680
|
+
current.includes(key) ? current.filter((entry) => entry !== key) : [...current, key],
|
|
681
|
+
)
|
|
682
|
+
|
|
683
|
+
const groupLabel = (group: RecentGroup<RecentViewRow>) => {
|
|
684
|
+
const by = arrangement().groupBy
|
|
685
|
+
const date = RECENT_DATES.find((value) => value === group.id)
|
|
686
|
+
const status = RECENT_STATUSES.find((value) => value === group.id)
|
|
687
|
+
|
|
688
|
+
if (by === "none") return language.t("sidebar.recent.section.recent")
|
|
689
|
+
|
|
690
|
+
if (by === "date" && date) return language.t(`sidebar.recent.group.date.${date}`)
|
|
691
|
+
|
|
692
|
+
if (by === "status" && status) return language.t(`sidebar.recent.group.status.${status}`)
|
|
693
|
+
|
|
694
|
+
if (by === "project" && group.id === NO_PROJECT) return language.t("sidebar.recent.group.project.none")
|
|
695
|
+
|
|
696
|
+
return group.label ?? group.id
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
const meta = (item: RecentSession) => {
|
|
700
|
+
if (!arrangement().metadata) return
|
|
701
|
+
const status = statusOf(item)
|
|
702
|
+
|
|
703
|
+
if (status === "attention") return language.t("sidebar.recent.meta.attention")
|
|
704
|
+
|
|
705
|
+
if (status === "working") return language.t("sidebar.recent.meta.working")
|
|
706
|
+
|
|
707
|
+
const time =
|
|
708
|
+
arrangement().sortBy === "created"
|
|
709
|
+
? item.session.time.created
|
|
710
|
+
: (item.session.time.updated ?? item.session.time.created)
|
|
711
|
+
|
|
712
|
+
const seconds = Math.max(0, Math.floor((view.now - time) / 1000))
|
|
713
|
+
|
|
714
|
+
if (seconds < 60) return language.t("sidebar.inbox.time.now")
|
|
715
|
+
|
|
716
|
+
if (seconds < 3600) return language.plural("sidebar.inbox.elapsed.minutes", Math.floor(seconds / 60))
|
|
717
|
+
|
|
718
|
+
if (seconds < 86_400) return language.plural("sidebar.inbox.elapsed.hours", Math.floor(seconds / 3600))
|
|
719
|
+
|
|
720
|
+
return language.plural("sidebar.inbox.elapsed.days", Math.floor(seconds / 86_400))
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
const recent = () => (input.organize ? groups().flatMap(shownRows) : windowed().visible)
|
|
724
|
+
const rows = createMemo(() => [...pinned(), ...recent()])
|
|
725
|
+
|
|
726
|
+
const firstPageLoading = createMemo(() => {
|
|
727
|
+
if (!servers.hydrated()) return true
|
|
728
|
+
|
|
729
|
+
// Adding a server should not blank the rows already shown while its first page loads.
|
|
730
|
+
if (pinned().length > 0 || partition().recent.length > 0) return false
|
|
731
|
+
|
|
732
|
+
return connections().some((item) => {
|
|
733
|
+
if (item.ctx.sdk.connection.status() !== "connected") return false
|
|
734
|
+
|
|
735
|
+
const value = pages[item.server]
|
|
736
|
+
|
|
737
|
+
return !recentPageLoaded(value)
|
|
738
|
+
})
|
|
739
|
+
})
|
|
740
|
+
|
|
741
|
+
const loadingMore = createMemo(() => connections().some((item) => recentPageLoadingMore(pages[item.server])))
|
|
742
|
+
|
|
743
|
+
const failed = createMemo(() => connections().some((item) => recentPageFailed(pages[item.server])))
|
|
744
|
+
|
|
745
|
+
const retryFailed = () => {
|
|
746
|
+
connections().forEach((item) => {
|
|
747
|
+
if (!recentPageFailed(pages[item.server])) return
|
|
748
|
+
|
|
749
|
+
if (item.ctx.sdk.connection.status() !== "connected") return
|
|
750
|
+
|
|
751
|
+
dispatch(item, { type: "retry", attempt: ++attempt })
|
|
752
|
+
})
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
const empty = createMemo(
|
|
756
|
+
() => pinned().length === 0 && recent().length === 0 && !windowed().hasMore && !firstPageLoading(),
|
|
757
|
+
)
|
|
758
|
+
|
|
759
|
+
// Every server with a cursor loads its next page together, and the merged list re-sorts. Newly loaded rows can
|
|
760
|
+
// therefore appear above rows already shown: one merged recency order is kept rather than holding rows back until
|
|
761
|
+
// every server reaches the same age. A short page or a missing next cursor ends that server's list; a failed page
|
|
762
|
+
// keeps its cursor so the next Show more retries it.
|
|
763
|
+
const loadMore = (retry: boolean) => {
|
|
764
|
+
connections().forEach((item) => {
|
|
765
|
+
const current = pages[item.server]
|
|
766
|
+
|
|
767
|
+
if (!current) return
|
|
768
|
+
|
|
769
|
+
if (item.ctx.sdk.connection.status() !== "connected") return
|
|
770
|
+
|
|
771
|
+
if (current.status === "failed") {
|
|
772
|
+
if (retry) dispatch(item, { type: "retry", attempt: ++attempt })
|
|
773
|
+
|
|
774
|
+
return
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
if (!recentPageHasMore(current)) return
|
|
778
|
+
|
|
779
|
+
load(item, "next")
|
|
780
|
+
})
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
const showMore = () => {
|
|
784
|
+
setView("revealed", (value) => value + RECENT_VISIBLE_LIMIT)
|
|
785
|
+
loadMore(true)
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
// Show more can reveal more rows than are loaded; fetch further pages until they are, or every server is exhausted.
|
|
789
|
+
// A failed page waits for the next Show more instead of retrying here.
|
|
790
|
+
createEffect(() => {
|
|
791
|
+
if (view.revealed === 0 || loadingMore()) return
|
|
792
|
+
|
|
793
|
+
if (windowed().limit <= partition().recent.length) return
|
|
794
|
+
|
|
795
|
+
untrack(() => loadMore(false))
|
|
796
|
+
})
|
|
797
|
+
|
|
798
|
+
const reorderPinned = (nextVisible: readonly string[]) => {
|
|
799
|
+
const visible = pinned().map((item) => item.key)
|
|
800
|
+
setState("pins", reorderPins(state.pins, visible, nextVisible))
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
const movePin = (key: string, offset: number) => {
|
|
804
|
+
const visible = pinned().map((item) => item.key)
|
|
805
|
+
const index = visible.indexOf(key)
|
|
806
|
+
|
|
807
|
+
if (index === -1) return
|
|
808
|
+
const target = index + offset
|
|
809
|
+
|
|
810
|
+
if (target < 0 || target >= visible.length) return
|
|
811
|
+
|
|
812
|
+
reorderPinned(arrayMove(visible, index, target))
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
const removePinKey = (key: string) => {
|
|
816
|
+
const next = removePin(state.pins, key, endpoints())
|
|
817
|
+
|
|
818
|
+
if (next.length !== state.pins.length) setState("pins", next)
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
// The fetched page is a separate cache. Archive and delete drop a row so it does not linger when the live store
|
|
822
|
+
// never held it.
|
|
823
|
+
const forget = (server: string, sessionID: string) => {
|
|
824
|
+
setPages(server, (current) =>
|
|
825
|
+
current ? { ...current, sessions: current.sessions.filter((session) => session.id !== sessionID) } : current,
|
|
826
|
+
)
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
const selected = (item: RecentSession) => {
|
|
830
|
+
const route = layout.route()
|
|
831
|
+
|
|
832
|
+
if (route.type !== "session") return false
|
|
833
|
+
const scope = endpoints()
|
|
834
|
+
|
|
835
|
+
if ((scope.get(route.server) ?? route.server) !== (scope.get(item.server) ?? item.server)) return false
|
|
836
|
+
|
|
837
|
+
return (
|
|
838
|
+
route.sessionId === item.session.id ||
|
|
839
|
+
global.serverCtx(route.server)?.data.session.root(route.sessionId) === item.session.id
|
|
840
|
+
)
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
const open = (item: RecentSession) => {
|
|
844
|
+
const ctx = ctxOf(item)
|
|
845
|
+
|
|
846
|
+
if (!ctx) return
|
|
847
|
+
|
|
848
|
+
const current = ctx.data.session.get(item.session.id) ?? item.session
|
|
849
|
+
const directory = ctx.projects.forSession(current)?.worktree ?? current.location.directory
|
|
850
|
+
|
|
851
|
+
void ctx.data.session.message.sync(current.id).catch((cause) => {
|
|
852
|
+
if (!isSessionNotFoundError(cause)) return
|
|
853
|
+
|
|
854
|
+
removePinKey(item.key)
|
|
855
|
+
forget(item.server, current.id)
|
|
856
|
+
global.sessionPreferences.forget(item.server, current.id)
|
|
857
|
+
})
|
|
858
|
+
void startTransition(() => {
|
|
859
|
+
tabs.select(tabs.addSessionTab({ server: ServerConnection.Key.make(item.server), sessionId: current.id }))
|
|
860
|
+
ctx.data.session.remember(current)
|
|
861
|
+
ctx.projects.touch(directory)
|
|
862
|
+
})
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
// Rows take the side tabs' shortcuts, numbered and stepped through in the order shown.
|
|
866
|
+
const rowRefs = new Map<string, HTMLDivElement>()
|
|
867
|
+
|
|
868
|
+
// The prototype's pinned rows are numbered first, so ⌘1–9 continue from them into these rows.
|
|
869
|
+
const pinnedKeys = () => input.pinned?.keys() ?? []
|
|
870
|
+
|
|
871
|
+
const hints = createSessionRowNavigation({
|
|
872
|
+
keys: () => [...pinnedKeys(), ...rows().map((item) => item.key)],
|
|
873
|
+
current: () => rows().find(selected)?.key ?? input.pinned?.current(),
|
|
874
|
+
unread: (key) => (pinnedKeys().includes(key) ? !!input.pinned?.unread(key) : !!unread[key]),
|
|
875
|
+
navigate: (key, reveal) => {
|
|
876
|
+
if (pinnedKeys().includes(key)) return input.pinned?.navigate(key)
|
|
877
|
+
const item = rows().find((entry) => entry.key === key)
|
|
878
|
+
|
|
879
|
+
if (!item) return
|
|
880
|
+
open(item)
|
|
881
|
+
|
|
882
|
+
if (reveal) rowRefs.get(key)?.scrollIntoView({ behavior: "instant", block: "nearest" })
|
|
883
|
+
},
|
|
884
|
+
})
|
|
885
|
+
|
|
886
|
+
// Tells the closed sidebar's toggle whether any row here shows its unread dot, which the selected row never does.
|
|
887
|
+
createEffect(() => {
|
|
888
|
+
setSidebarUnread(rows().some((item) => !selected(item) && !!unread[item.key]))
|
|
889
|
+
onCleanup(() => setSidebarUnread(false))
|
|
890
|
+
})
|
|
891
|
+
|
|
892
|
+
const requestFailed = (cause: unknown) =>
|
|
893
|
+
showToast({
|
|
894
|
+
title: language.t("common.requestFailed"),
|
|
895
|
+
description: errorMessage(cause, language.t("common.requestFailed")),
|
|
896
|
+
})
|
|
897
|
+
|
|
898
|
+
const invalidateSessionLists = (server: string) => {
|
|
899
|
+
const conn = global.servers.list().find((entry) => ServerConnection.key(entry) === server)
|
|
900
|
+
|
|
901
|
+
if (!conn) return
|
|
902
|
+
|
|
903
|
+
for (const queryKey of ["home-sessions", "inbox-sessions", "inbox-archived-sessions"]) {
|
|
904
|
+
void queryClient.invalidateQueries({ queryKey: [queryKey, conn], exact: true })
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
const archive = (item: RecentSession) => {
|
|
909
|
+
const ctx = ctxOf(item)
|
|
910
|
+
|
|
911
|
+
if (!ctx) return
|
|
912
|
+
|
|
913
|
+
void ctx.sdk.api.session
|
|
914
|
+
.update({ sessionID: item.session.id, archived: true })
|
|
915
|
+
.then(() => {
|
|
916
|
+
if (state.pins.includes(item.key)) {
|
|
917
|
+
setHydration(item.key, {
|
|
918
|
+
...item.session,
|
|
919
|
+
// The row's time may be a send bump; the snapshot goes back through `apply` and must stay raw.
|
|
920
|
+
time: {
|
|
921
|
+
...item.session.time,
|
|
922
|
+
updated: rawTime(item.session),
|
|
923
|
+
archived: item.session.time.archived ?? Date.now(),
|
|
924
|
+
},
|
|
925
|
+
})
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
forget(item.server, item.session.id)
|
|
929
|
+
invalidateSessionLists(item.server)
|
|
930
|
+
notifySessionTabsRemoved({
|
|
931
|
+
server: ServerConnection.Key.make(item.server),
|
|
932
|
+
directory: item.session.location.directory,
|
|
933
|
+
sessionIDs: [item.session.id],
|
|
934
|
+
})
|
|
935
|
+
})
|
|
936
|
+
.catch(requestFailed)
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
const remove = (item: RecentSession) => {
|
|
940
|
+
const ctx = ctxOf(item)
|
|
941
|
+
|
|
942
|
+
if (!ctx) return
|
|
943
|
+
|
|
944
|
+
const ids = sessionTreeIDs(ctx.data.session.list(), item.session.id)
|
|
945
|
+
|
|
946
|
+
void ctx.data.session
|
|
947
|
+
.remove(item.session.id)
|
|
948
|
+
.then(() => {
|
|
949
|
+
forget(item.server, item.session.id)
|
|
950
|
+
removePinKey(item.key)
|
|
951
|
+
ids.forEach((id) => global.sessionPreferences.forget(item.server, id))
|
|
952
|
+
notifySessionTabsRemoved({
|
|
953
|
+
server: ServerConnection.Key.make(item.server),
|
|
954
|
+
directory: item.session.location.directory,
|
|
955
|
+
sessionIDs: ids,
|
|
956
|
+
})
|
|
957
|
+
})
|
|
958
|
+
.catch((cause) =>
|
|
959
|
+
showToast({
|
|
960
|
+
title: language.t("session.delete.failed.title"),
|
|
961
|
+
description: errorMessage(cause, language.t("session.delete.failed.title")),
|
|
962
|
+
}),
|
|
963
|
+
)
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
const row = (item: () => RecentSession, index?: () => number) => {
|
|
967
|
+
const position = () => rows().findIndex((entry) => entry.key === item().key)
|
|
968
|
+
const key = item().key
|
|
969
|
+
|
|
970
|
+
onCleanup(() => rowRefs.delete(key))
|
|
971
|
+
|
|
972
|
+
const props = {
|
|
973
|
+
item,
|
|
974
|
+
selected: () => selected(item()),
|
|
975
|
+
shortcut: () => {
|
|
976
|
+
const index = position() + pinnedKeys().length
|
|
977
|
+
|
|
978
|
+
return position() >= 0 && index < 9 ? index + 1 : undefined
|
|
979
|
+
},
|
|
980
|
+
ref: (element: HTMLDivElement) => rowRefs.set(key, element),
|
|
981
|
+
onUnreadChange: (value: boolean) => setUnread(item().key, value),
|
|
982
|
+
meta: () => meta(item()),
|
|
983
|
+
hideAvatar: () => arrangement().groupBy === "project",
|
|
984
|
+
pinned: index !== undefined,
|
|
985
|
+
canMoveUp: () => index !== undefined && index() > 0,
|
|
986
|
+
canMoveDown: () => index !== undefined && index() < pinned().length - 1,
|
|
987
|
+
onOpen: () => open(item()),
|
|
988
|
+
onPin: () =>
|
|
989
|
+
input.pinned
|
|
990
|
+
? input.pinned.toggle(item().server, item().session.id)
|
|
991
|
+
: setState("pins", (current) => addPin(current, item().key)),
|
|
992
|
+
onUnpin: () => removePinKey(item().key),
|
|
993
|
+
onMoveUp: () => movePin(item().key, -1),
|
|
994
|
+
onMoveDown: () => movePin(item().key, 1),
|
|
995
|
+
onArchive: () => archive(item()),
|
|
996
|
+
onDelete: () => {
|
|
997
|
+
const current = item()
|
|
998
|
+
|
|
999
|
+
void dialog.show(() => (
|
|
1000
|
+
<DeleteSessionDialog
|
|
1001
|
+
title={sessionTabTitle(current.session.title, language.t("command.session.new"))}
|
|
1002
|
+
onConfirm={() => remove(current)}
|
|
1003
|
+
/>
|
|
1004
|
+
))
|
|
1005
|
+
},
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
return index === undefined ? <RecentSessionSlot {...props} /> : <PinnedSessionRow {...props} index={index} />
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
return (
|
|
1012
|
+
<div
|
|
1013
|
+
data-slot="sidebar-recent"
|
|
1014
|
+
data-shortcut-hints={hints() ? "" : undefined}
|
|
1015
|
+
class="flex min-h-0 flex-1 flex-col [app-region:no-drag]"
|
|
1016
|
+
>
|
|
1017
|
+
<div data-scrollable class="no-scrollbar flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto pb-1">
|
|
1018
|
+
<Show
|
|
1019
|
+
when={!firstPageLoading()}
|
|
1020
|
+
fallback={
|
|
1021
|
+
<div class="flex justify-center p-2">
|
|
1022
|
+
<Loader role="img" aria-hidden="false" aria-label={language.t("common.loading")} />
|
|
1023
|
+
</div>
|
|
1024
|
+
}
|
|
1025
|
+
>
|
|
1026
|
+
{input.pinned?.content()}
|
|
1027
|
+
<Show when={!input.pinned && pinned().length > 0}>
|
|
1028
|
+
<div role="group" aria-labelledby="sidebar-recent-pinned" class="flex shrink-0 flex-col gap-2 pb-2.5">
|
|
1029
|
+
<SectionHeader id="sidebar-recent-pinned" label={language.t("sidebar.recent.pinned")} />
|
|
1030
|
+
<DragDropProvider
|
|
1031
|
+
sensors={[
|
|
1032
|
+
PointerSensor.configure({
|
|
1033
|
+
activationConstraints: [new PointerActivationConstraints.Distance({ value: 4 })],
|
|
1034
|
+
}),
|
|
1035
|
+
]}
|
|
1036
|
+
modifiers={[RestrictToVerticalAxis]}
|
|
1037
|
+
plugins={(defaults) => [
|
|
1038
|
+
...defaults.filter((plugin) => plugin !== Accessibility),
|
|
1039
|
+
Feedback.configure({ dropAnimation: null }),
|
|
1040
|
+
]}
|
|
1041
|
+
onDragEnd={(event) => {
|
|
1042
|
+
const source = event.operation.source
|
|
1043
|
+
|
|
1044
|
+
if (event.canceled || !isSortable(source) || source.initialIndex === source.index) return
|
|
1045
|
+
|
|
1046
|
+
const visible = pinned().map((item) => item.key)
|
|
1047
|
+
reorderPinned(arrayMove(visible, source.initialIndex, source.index))
|
|
1048
|
+
}}
|
|
1049
|
+
>
|
|
1050
|
+
<div
|
|
1051
|
+
data-titlebar-tab-list
|
|
1052
|
+
data-focus-scope
|
|
1053
|
+
data-orientation="vertical"
|
|
1054
|
+
class="flex w-full min-w-0 flex-col"
|
|
1055
|
+
>
|
|
1056
|
+
<Key each={pinned()} by={(item) => item.key}>
|
|
1057
|
+
{(item, index) => row(item, index)}
|
|
1058
|
+
</Key>
|
|
1059
|
+
</div>
|
|
1060
|
+
</DragDropProvider>
|
|
1061
|
+
</div>
|
|
1062
|
+
</Show>
|
|
1063
|
+
<Show
|
|
1064
|
+
when={
|
|
1065
|
+
input.organize &&
|
|
1066
|
+
(groups().some((group) => group.rows.length > 0 || arrangement().emptyGroups) || windowed().hasMore)
|
|
1067
|
+
}
|
|
1068
|
+
>
|
|
1069
|
+
<div data-slot="sidebar-recent-groups" class="flex shrink-0 flex-col gap-2.5 pb-2.5">
|
|
1070
|
+
<Key each={groups()} by={(group) => group.key}>
|
|
1071
|
+
{(group) => (
|
|
1072
|
+
<div
|
|
1073
|
+
role="group"
|
|
1074
|
+
aria-labelledby={`sidebar-recent-${group().key}`}
|
|
1075
|
+
class="flex shrink-0 flex-col gap-2"
|
|
1076
|
+
>
|
|
1077
|
+
<GroupHeader
|
|
1078
|
+
id={`sidebar-recent-${group().key}`}
|
|
1079
|
+
label={groupLabel(group())}
|
|
1080
|
+
count={
|
|
1081
|
+
arrangement().metadata && arrangement().groupBy !== "none" ? group().rows.length : undefined
|
|
1082
|
+
}
|
|
1083
|
+
collapsible={arrangement().groupBy !== "none"}
|
|
1084
|
+
collapsed={collapsed(group())}
|
|
1085
|
+
mark={hiddenMark(group())}
|
|
1086
|
+
hoverReveal={settings.appearance.navigationPrototype()}
|
|
1087
|
+
onToggle={() => toggleGroup(group().key)}
|
|
1088
|
+
menu={
|
|
1089
|
+
<RecentViewMenu
|
|
1090
|
+
view={arrangement()}
|
|
1091
|
+
onChange={(next) => setArrangement((current) => ({ ...current, ...next }))}
|
|
1092
|
+
onViewAll={() => input.organize?.viewAll()}
|
|
1093
|
+
/>
|
|
1094
|
+
}
|
|
1095
|
+
/>
|
|
1096
|
+
<Show when={shownRows(group()).length > 0}>
|
|
1097
|
+
<div
|
|
1098
|
+
data-titlebar-tab-list
|
|
1099
|
+
data-focus-scope
|
|
1100
|
+
data-orientation="vertical"
|
|
1101
|
+
class="flex w-full min-w-0 flex-col"
|
|
1102
|
+
>
|
|
1103
|
+
<Key each={shownRows(group())} by={(item) => item.key}>
|
|
1104
|
+
{(item) => row(item)}
|
|
1105
|
+
</Key>
|
|
1106
|
+
</div>
|
|
1107
|
+
</Show>
|
|
1108
|
+
</div>
|
|
1109
|
+
)}
|
|
1110
|
+
</Key>
|
|
1111
|
+
<Show when={windowed().hasMore && !loadingMore()}>
|
|
1112
|
+
<Button
|
|
1113
|
+
variant="ghost-muted"
|
|
1114
|
+
size="normal"
|
|
1115
|
+
class="w-full justify-start px-2 focus-visible:-outline-offset-2"
|
|
1116
|
+
onClick={showMore}
|
|
1117
|
+
>
|
|
1118
|
+
{language.t("sidebar.inbox.showMore")}
|
|
1119
|
+
</Button>
|
|
1120
|
+
</Show>
|
|
1121
|
+
</div>
|
|
1122
|
+
</Show>
|
|
1123
|
+
<Show when={!input.organize && (recent().length > 0 || windowed().hasMore)}>
|
|
1124
|
+
<div role="group" aria-labelledby="sidebar-recent-list" class="flex shrink-0 flex-col gap-2 pb-2.5">
|
|
1125
|
+
<SectionHeader id="sidebar-recent-list" label={language.t("sidebar.recent.section.recent")} />
|
|
1126
|
+
<div
|
|
1127
|
+
data-titlebar-tab-list
|
|
1128
|
+
data-focus-scope
|
|
1129
|
+
data-orientation="vertical"
|
|
1130
|
+
class="flex w-full min-w-0 flex-col"
|
|
1131
|
+
>
|
|
1132
|
+
<Key each={recent()} by={(item) => item.key}>
|
|
1133
|
+
{(item) => row(item)}
|
|
1134
|
+
</Key>
|
|
1135
|
+
</div>
|
|
1136
|
+
<Show when={windowed().hasMore && !loadingMore()}>
|
|
1137
|
+
<Button
|
|
1138
|
+
variant="ghost-muted"
|
|
1139
|
+
size="normal"
|
|
1140
|
+
class="w-full justify-start px-2 focus-visible:-outline-offset-2"
|
|
1141
|
+
onClick={showMore}
|
|
1142
|
+
>
|
|
1143
|
+
{language.t("sidebar.inbox.showMore")}
|
|
1144
|
+
</Button>
|
|
1145
|
+
</Show>
|
|
1146
|
+
</div>
|
|
1147
|
+
</Show>
|
|
1148
|
+
<Show when={empty()}>
|
|
1149
|
+
<div class="px-1.5 py-2 text-[13px] leading-4 text-v2-text-text-faint">
|
|
1150
|
+
{language.t("sidebar.recent.empty")}
|
|
1151
|
+
</div>
|
|
1152
|
+
</Show>
|
|
1153
|
+
</Show>
|
|
1154
|
+
<Show when={loadingMore()}>
|
|
1155
|
+
<div class="flex justify-center p-2">
|
|
1156
|
+
<Loader role="img" aria-hidden="false" aria-label={language.t("common.loading")} />
|
|
1157
|
+
</div>
|
|
1158
|
+
</Show>
|
|
1159
|
+
<Show when={failed() && !loadingMore()}>
|
|
1160
|
+
<div class="flex justify-center p-2">
|
|
1161
|
+
<Button variant="ghost-muted" size="small" onClick={retryFailed}>
|
|
1162
|
+
{language.t("common.retry")}
|
|
1163
|
+
</Button>
|
|
1164
|
+
</div>
|
|
1165
|
+
</Show>
|
|
1166
|
+
</div>
|
|
1167
|
+
</div>
|
|
1168
|
+
)
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
/** A Recent heading. Grouped headings collapse their group; the Group and sort menu shows on hover. */
|
|
1172
|
+
function GroupHeader(props: {
|
|
1173
|
+
id: string
|
|
1174
|
+
label: string
|
|
1175
|
+
count: number | undefined
|
|
1176
|
+
collapsible: boolean
|
|
1177
|
+
collapsed: boolean
|
|
1178
|
+
mark: "attention" | "unread" | undefined
|
|
1179
|
+
/** Shows the chevron only on hover or focus (Consolidated). */
|
|
1180
|
+
hoverReveal: boolean
|
|
1181
|
+
onToggle: () => void
|
|
1182
|
+
menu: JSX.Element
|
|
1183
|
+
}) {
|
|
1184
|
+
return (
|
|
1185
|
+
<div class="group/header relative flex h-6 shrink-0 items-center">
|
|
1186
|
+
<Show
|
|
1187
|
+
when={props.collapsible}
|
|
1188
|
+
fallback={
|
|
1189
|
+
<div
|
|
1190
|
+
id={props.id}
|
|
1191
|
+
class="flex h-6 min-w-0 flex-1 items-center px-2 text-[13px] leading-4 font-medium text-v2-text-text-muted"
|
|
1192
|
+
>
|
|
1193
|
+
<span class="min-w-0 truncate">{props.label}</span>
|
|
1194
|
+
</div>
|
|
1195
|
+
}
|
|
1196
|
+
>
|
|
1197
|
+
<button
|
|
1198
|
+
type="button"
|
|
1199
|
+
id={props.id}
|
|
1200
|
+
aria-expanded={!props.collapsed}
|
|
1201
|
+
class="group/toggle flex h-6 min-w-0 flex-1 items-center gap-1 rounded-[6px] ps-2 pe-8 text-start text-[13px] leading-4 font-medium text-v2-text-text-muted hover:text-v2-text-text-base focus-visible:-outline-offset-2"
|
|
1202
|
+
onClick={props.onToggle}
|
|
1203
|
+
>
|
|
1204
|
+
<span class="min-w-0 truncate">{props.label}</span>
|
|
1205
|
+
<Show when={props.count !== undefined}>
|
|
1206
|
+
<span class="shrink-0 font-normal text-v2-text-text-faint tabular-nums">{props.count}</span>
|
|
1207
|
+
</Show>
|
|
1208
|
+
<Show when={props.mark}>
|
|
1209
|
+
{(value) => (
|
|
1210
|
+
<span
|
|
1211
|
+
aria-hidden="true"
|
|
1212
|
+
class="size-1.5 shrink-0 rounded-full"
|
|
1213
|
+
classList={{
|
|
1214
|
+
"bg-v2-background-bg-accent": value() === "unread",
|
|
1215
|
+
"bg-v2-state-fg-warning": value() === "attention",
|
|
1216
|
+
}}
|
|
1217
|
+
/>
|
|
1218
|
+
)}
|
|
1219
|
+
</Show>
|
|
1220
|
+
<Icon
|
|
1221
|
+
name="fill-triangle-down"
|
|
1222
|
+
class="shrink-0 text-v2-icon-icon-muted transition-[transform,opacity] motion-reduce:transition-none"
|
|
1223
|
+
classList={{
|
|
1224
|
+
"-rotate-90 rtl:rotate-90": props.collapsed,
|
|
1225
|
+
"opacity-0 group-hover/header:opacity-100 group-focus-visible/toggle:opacity-100 [@media(hover:none)]:opacity-100":
|
|
1226
|
+
props.hoverReveal,
|
|
1227
|
+
}}
|
|
1228
|
+
/>
|
|
1229
|
+
</button>
|
|
1230
|
+
</Show>
|
|
1231
|
+
<div class="absolute inset-y-0 end-1 my-auto flex h-5 items-center opacity-0 group-hover/header:opacity-100 focus-within:opacity-100 [&:has([data-expanded])]:opacity-100">
|
|
1232
|
+
{props.menu}
|
|
1233
|
+
</div>
|
|
1234
|
+
</div>
|
|
1235
|
+
)
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
function SectionHeader(props: { id: string; label: string }) {
|
|
1239
|
+
return (
|
|
1240
|
+
<div
|
|
1241
|
+
id={props.id}
|
|
1242
|
+
class="flex h-6 shrink-0 items-center gap-1.5 px-2 text-[13px] leading-4 font-medium text-v2-text-text-muted"
|
|
1243
|
+
>
|
|
1244
|
+
<span class="min-w-0 truncate">{props.label}</span>
|
|
1245
|
+
</div>
|
|
1246
|
+
)
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
type RecentSessionTabProps = {
|
|
1250
|
+
item: () => RecentSession
|
|
1251
|
+
selected: () => boolean
|
|
1252
|
+
shortcut: () => number | undefined
|
|
1253
|
+
ref: (element: HTMLDivElement) => void
|
|
1254
|
+
onUnreadChange: (unread: boolean) => void
|
|
1255
|
+
meta: () => string | undefined
|
|
1256
|
+
hideAvatar: () => boolean
|
|
1257
|
+
pinned: boolean
|
|
1258
|
+
canMoveUp: () => boolean
|
|
1259
|
+
canMoveDown: () => boolean
|
|
1260
|
+
onOpen: () => void
|
|
1261
|
+
onPin: () => void
|
|
1262
|
+
onUnpin: () => void
|
|
1263
|
+
onMoveUp: () => void
|
|
1264
|
+
onMoveDown: () => void
|
|
1265
|
+
onArchive: () => void
|
|
1266
|
+
onDelete: () => void
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
function RecentSessionSlot(
|
|
1270
|
+
props: RecentSessionTabProps & { slotRef?: (element: HTMLDivElement) => void; dragging?: boolean },
|
|
1271
|
+
) {
|
|
1272
|
+
return (
|
|
1273
|
+
<div
|
|
1274
|
+
ref={props.slotRef}
|
|
1275
|
+
data-titlebar-tab-slot
|
|
1276
|
+
data-orientation="vertical"
|
|
1277
|
+
data-active={props.selected()}
|
|
1278
|
+
class="relative flex w-full shrink-0"
|
|
1279
|
+
>
|
|
1280
|
+
<RecentSessionTab {...props} />
|
|
1281
|
+
</div>
|
|
1282
|
+
)
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
function PinnedSessionRow(props: RecentSessionTabProps & { index: () => number }) {
|
|
1286
|
+
const sortable = useSortable({
|
|
1287
|
+
get id() {
|
|
1288
|
+
return props.item().key
|
|
1289
|
+
},
|
|
1290
|
+
get index() {
|
|
1291
|
+
return props.index()
|
|
1292
|
+
},
|
|
1293
|
+
})
|
|
1294
|
+
|
|
1295
|
+
return <RecentSessionSlot {...props} slotRef={sortable.ref} dragging={sortable.isDragSource()} />
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
// Renders the session as the side tabs do, from the same status, with the Recent menu and no close actions.
|
|
1299
|
+
function RecentSessionTab(props: RecentSessionTabProps & { dragging?: boolean }) {
|
|
1300
|
+
const global = useGlobal()
|
|
1301
|
+
const language = useLanguage()
|
|
1302
|
+
|
|
1303
|
+
const item = () => props.item()
|
|
1304
|
+
const server = () => ServerConnection.Key.make(item().server)
|
|
1305
|
+
|
|
1306
|
+
const status = useSessionTabAvatarState(
|
|
1307
|
+
server,
|
|
1308
|
+
() => item().session.id,
|
|
1309
|
+
() => true,
|
|
1310
|
+
() => item().session,
|
|
1311
|
+
)
|
|
1312
|
+
|
|
1313
|
+
// A busy session shows its progress indicator instead of the unread dot.
|
|
1314
|
+
const muted = () => global.sessionPreferences.muted(server(), item().session.id)
|
|
1315
|
+
const unread = createMemo(() => recentRowUnread(status.unread(), status.loading(), muted()))
|
|
1316
|
+
|
|
1317
|
+
createEffect(() => props.onUnreadChange(unread()))
|
|
1318
|
+
|
|
1319
|
+
// A permission or form asked before this window connected only shows once loaded, as for an unselected side tab.
|
|
1320
|
+
// Only running rows load it: an idle session cannot wait on either, and Recent lists far more sessions than tabs.
|
|
1321
|
+
createEffect(() => {
|
|
1322
|
+
const ctx = global.serverCtx(server())
|
|
1323
|
+
const id = item().session.id
|
|
1324
|
+
|
|
1325
|
+
if (!ctx || props.selected() || !status.loading() || ctx.sdk.connection.status() !== "connected") return
|
|
1326
|
+
|
|
1327
|
+
const timer = window.setTimeout(() => syncInactiveSession(ctx, id), 300)
|
|
1328
|
+
|
|
1329
|
+
onCleanup(() => window.clearTimeout(timer))
|
|
1330
|
+
})
|
|
1331
|
+
|
|
1332
|
+
const menu = (rename: () => void) => (
|
|
1333
|
+
<>
|
|
1334
|
+
<Show
|
|
1335
|
+
when={props.pinned}
|
|
1336
|
+
fallback={<Menu.Item onSelect={props.onPin}>{language.t("sidebar.recent.pin")}</Menu.Item>}
|
|
1337
|
+
>
|
|
1338
|
+
<Menu.Item onSelect={props.onUnpin}>{language.t("sidebar.recent.unpin")}</Menu.Item>
|
|
1339
|
+
<Menu.Item disabled={!props.canMoveUp()} onSelect={props.onMoveUp}>
|
|
1340
|
+
{language.t("sidebar.recent.moveUp")}
|
|
1341
|
+
</Menu.Item>
|
|
1342
|
+
<Menu.Item disabled={!props.canMoveDown()} onSelect={props.onMoveDown}>
|
|
1343
|
+
{language.t("sidebar.recent.moveDown")}
|
|
1344
|
+
</Menu.Item>
|
|
1345
|
+
</Show>
|
|
1346
|
+
<Menu.Item onSelect={() => global.sessionPreferences.update("muted", server(), item().session.id, !muted())}>
|
|
1347
|
+
{language.t(muted() ? "sidebar.recent.unmute" : "sidebar.recent.mute")}
|
|
1348
|
+
</Menu.Item>
|
|
1349
|
+
<Menu.Item onSelect={() => global.sessionPreferences.update("hidden", server(), item().session.id, true)}>
|
|
1350
|
+
{language.t("sidebar.recent.hide")}
|
|
1351
|
+
</Menu.Item>
|
|
1352
|
+
<Menu.Separator />
|
|
1353
|
+
<Menu.Item onSelect={rename}>{language.t("common.rename")}</Menu.Item>
|
|
1354
|
+
<Menu.Item onSelect={props.onArchive}>{language.t("common.archive")}</Menu.Item>
|
|
1355
|
+
<Menu.Separator />
|
|
1356
|
+
<Menu.Item onSelect={props.onDelete}>{language.t("common.delete")}…</Menu.Item>
|
|
1357
|
+
</>
|
|
1358
|
+
)
|
|
1359
|
+
|
|
1360
|
+
return (
|
|
1361
|
+
<TabNavItem
|
|
1362
|
+
ref={props.ref}
|
|
1363
|
+
href={tabHref({ type: "session", server: server(), sessionId: item().session.id })}
|
|
1364
|
+
server={server()}
|
|
1365
|
+
session={item().session}
|
|
1366
|
+
preparing={false}
|
|
1367
|
+
label={muted() ? language.t("sidebar.recent.muted") : props.meta()}
|
|
1368
|
+
hideAvatar={props.hideAvatar()}
|
|
1369
|
+
unread={unread()}
|
|
1370
|
+
attention={status.attention()}
|
|
1371
|
+
loading={status.loading()}
|
|
1372
|
+
shortcut={props.shortcut()}
|
|
1373
|
+
onNavigate={props.onOpen}
|
|
1374
|
+
active={props.selected()}
|
|
1375
|
+
dragging={!!props.dragging}
|
|
1376
|
+
orientation="vertical"
|
|
1377
|
+
menu={menu}
|
|
1378
|
+
/>
|
|
1379
|
+
)
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
export function DeleteSessionDialog(props: { title: string | undefined; onConfirm: () => void }) {
|
|
1383
|
+
const language = useLanguage()
|
|
1384
|
+
const dialog = useDialog()
|
|
1385
|
+
const layer = useDialogLayer()
|
|
1386
|
+
|
|
1387
|
+
const close = () => dialog.close(layer?.id)
|
|
1388
|
+
|
|
1389
|
+
const confirm = () => {
|
|
1390
|
+
if (dialog.closing) return
|
|
1391
|
+
close()
|
|
1392
|
+
props.onConfirm()
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
return (
|
|
1396
|
+
<Dialog fit>
|
|
1397
|
+
<DialogHeader hideClose>
|
|
1398
|
+
<DialogTitleGroup
|
|
1399
|
+
title={language.t("session.delete.title")}
|
|
1400
|
+
description={language.t("session.delete.confirm", {
|
|
1401
|
+
name: props.title ?? language.t("command.session.new"),
|
|
1402
|
+
})}
|
|
1403
|
+
/>
|
|
1404
|
+
</DialogHeader>
|
|
1405
|
+
<DialogFooter>
|
|
1406
|
+
<Button variant="ghost" autofocus disabled={dialog.closing} onClick={close}>
|
|
1407
|
+
{language.t("common.cancel")}
|
|
1408
|
+
</Button>
|
|
1409
|
+
<Button variant="danger" disabled={dialog.closing} onClick={confirm}>
|
|
1410
|
+
{language.t("session.delete.button")}
|
|
1411
|
+
</Button>
|
|
1412
|
+
</DialogFooter>
|
|
1413
|
+
</Dialog>
|
|
1414
|
+
)
|
|
1415
|
+
}
|