@kabmo-labs/kabmo 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -7
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +523 -441
- package/dist/client/static/js/{index-rerjq5th.js → index-fcee4c13.js} +828 -818
- package/dist/client/static/js/index-sxdw908m.css +1 -0
- package/marketplace/plugins/command-runner/package.json +3 -2
- package/marketplace/plugins/git-forge/package.json +3 -2
- package/marketplace/plugins/session-info/package.json +3 -2
- package/marketplace/plugins/stats/package.json +3 -2
- package/package.json +3 -1
- package/src/client/components/auth/login-screen/index.tsx +2 -1
- package/src/client/components/common/ComposerPicker.tsx +1 -1
- package/src/client/components/common/FolderPicker.tsx +2 -2
- package/src/client/components/common/MarkdownRenderer.tsx +136 -89
- package/src/client/components/common/Modal.tsx +2 -2
- package/src/client/components/common/PWAInstallButton.tsx +2 -2
- package/src/client/components/common/ViewportSelector.tsx +1 -1
- package/src/client/components/common/anchored-menu/index.test.tsx +141 -0
- package/src/client/components/common/anchored-menu/index.tsx +147 -0
- package/src/client/components/common/batch-selection/SelectionCheckbox.tsx +2 -1
- package/src/client/components/common/brand-wordmark/index.test.tsx +13 -2
- package/src/client/components/common/brand-wordmark/index.tsx +13 -2
- package/src/client/components/common/checkbox/style.test.ts +139 -0
- package/src/client/components/common/checkbox/style.ts +51 -0
- package/src/client/components/common/context-usage-button/index.tsx +2 -2
- package/src/client/components/common/file-icon/index.tsx +23 -9
- package/src/client/components/common/header-controls/MoreMenu.tsx +1 -1
- package/src/client/components/common/markdown-review/ReviewPopover.tsx +144 -0
- package/src/client/components/common/markdown-review/ReviewSummary.tsx +108 -0
- package/src/client/components/common/markdown-review/index.tsx +129 -0
- package/src/client/components/common/panel-mark/index.tsx +97 -0
- package/src/client/components/common/provider-icon/glyphs.test.ts +1 -1
- package/src/client/components/common/provider-icon/index.test.ts +14 -0
- package/src/client/components/common/provider-icon/index.tsx +4 -0
- package/src/client/components/common/provider-icon/resolve.test.ts +8 -7
- package/src/client/components/common/provider-icon/resolve.ts +16 -3
- package/src/client/components/common/server-control/Panel.tsx +33 -23
- package/src/client/components/common/server-control/index.test.tsx +11 -5
- package/src/client/components/common/server-control/index.tsx +10 -8
- package/src/client/components/common/session-actions-menu/index.tsx +1 -1
- package/src/client/components/common/toolbar-row/index.tsx +1 -1
- package/src/client/components/layout/ActivityBar.tsx +22 -3
- package/src/client/components/layout/LeftDock.tsx +9 -2
- package/src/client/components/layout/PanelVisibilityMenu.tsx +1 -1
- package/src/client/components/layout/WindowAura.tsx +27 -0
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +1 -1
- package/src/client/components/layout/desktop-layout/TopNavbar.tsx +2 -2
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +11 -2
- package/src/client/components/layout/desktop-layout/index.tsx +3 -1
- package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +44 -23
- package/src/client/components/layout/session-sidebar/CategoryHeader.worktree.test.tsx +36 -17
- package/src/client/components/layout/session-sidebar/CategoryItem.tsx +8 -7
- package/src/client/components/layout/session-sidebar/Header.tsx +1 -1
- package/src/client/components/layout/session-sidebar/OverflowMenu.tsx +1 -1
- package/src/client/components/layout/session-sidebar/Toolbar.tsx +1 -1
- package/src/client/components/layout/session-sidebar/about-modal/NotesDialog.tsx +94 -0
- package/src/client/components/layout/session-sidebar/about-modal/VersionLine.test.tsx +68 -0
- package/src/client/components/layout/session-sidebar/about-modal/VersionLine.tsx +36 -0
- package/src/client/components/layout/session-sidebar/about-modal/index.tsx +57 -34
- package/src/client/components/layout/session-sidebar/modern/ActionRow.tsx +1 -1
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +40 -14
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +7 -6
- package/src/client/components/layout/session-sidebar/modern/workspace-header.test.tsx +1 -1
- package/src/client/components/layout/session-sidebar/new-workspace-modal/index.tsx +2 -2
- package/src/client/components/layout/session-sidebar/scheduler-modal/TaskForm.tsx +2 -1
- package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +2 -2
- package/src/client/components/layout/update-popup/ReleaseNotes.tsx +8 -3
- package/src/client/components/layout/update-popup/index.tsx +5 -1
- package/src/client/components/mobile/LayoutWrapper.tsx +3 -1
- package/src/client/components/mobile/mobile-main-view/Header.tsx +2 -2
- package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +13 -15
- package/src/client/components/mobile/mobile-right-sidebar/Header.tsx +23 -1
- package/src/client/components/mobile/mobile-right-sidebar/MissingFileBanner.tsx +30 -0
- package/src/client/components/mobile/mobile-right-sidebar/PreviewScroller.tsx +18 -2
- package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +1 -1
- package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +22 -67
- package/src/client/components/mobile/mobile-session-sidebar/ItemMenu.tsx +110 -0
- package/src/client/components/mobile/mobile-session-sidebar/Toolbar.tsx +1 -1
- package/src/client/components/mobile/panel-chips.tsx +10 -2
- package/src/client/components/settings/Modal.tsx +4 -4
- package/src/client/components/settings/ProjectSelectorDropdown.tsx +2 -2
- package/src/client/components/settings/SettingsSidebarList.tsx +20 -0
- package/src/client/components/settings/apply-side-effects.test.ts +30 -0
- package/src/client/components/settings/apply-side-effects.ts +14 -0
- package/src/client/components/settings/categories/AgentSettings.tsx +23 -50
- package/src/client/components/settings/categories/AppearanceSettings.tsx +6 -0
- package/src/client/components/settings/categories/CommandSettings.tsx +2 -2
- package/src/client/components/settings/categories/McpSettings.tsx +4 -21
- package/src/client/components/settings/categories/OmpSettings.tsx +147 -194
- package/src/client/components/settings/categories/SkillSettings.tsx +2 -2
- package/src/client/components/settings/categories/TokenUsageSettings.tsx +211 -229
- package/src/client/components/settings/categories/agent-settings/DetailPane.tsx +229 -237
- package/src/client/components/settings/categories/agent-settings/ModelPicker.tsx +71 -0
- package/src/client/components/settings/categories/agent-settings/SidebarList.tsx +9 -2
- package/src/client/components/settings/categories/agent-settings/levels.ts +38 -0
- package/src/client/components/settings/categories/appearance-settings/EditorBlameSection.tsx +2 -1
- package/src/client/components/settings/categories/appearance-settings/EditorTypingSection.tsx +2 -1
- package/src/client/components/settings/categories/appearance-settings/IconStyleSection.tsx +144 -0
- package/src/client/components/settings/categories/appearance-settings/SurfaceStyleSection.test.tsx +120 -0
- package/src/client/components/settings/categories/appearance-settings/SurfaceStyleSection.tsx +180 -0
- package/src/client/components/settings/categories/behavior-settings/Editor.tsx +27 -7
- package/src/client/components/settings/categories/chat-settings/ToolRenderSection.tsx +23 -5
- package/src/client/components/settings/categories/command-settings/DetailPane.tsx +75 -33
- package/src/client/components/settings/categories/command-settings/SidebarList.tsx +7 -0
- package/src/client/components/settings/categories/mcp-settings/DetailPane.tsx +93 -77
- package/src/client/components/settings/categories/mcp-settings/EnvVarsSection.tsx +83 -0
- package/src/client/components/settings/categories/mcp-settings/ImportModal.tsx +28 -15
- package/src/client/components/settings/categories/mcp-settings/SidebarList.tsx +20 -0
- package/src/client/components/settings/categories/omp-settings/ConfigTabs.tsx +97 -36
- package/src/client/components/settings/categories/omp-settings/EngineHeader.tsx +151 -0
- package/src/client/components/settings/categories/omp-settings/ExtensionsPanel.tsx +68 -32
- package/src/client/components/settings/categories/omp-settings/OrderedChips.tsx +119 -0
- package/src/client/components/settings/categories/omp-settings/PresetBar.tsx +14 -7
- package/src/client/components/settings/categories/omp-settings/RoleEditor.tsx +15 -6
- package/src/client/components/settings/categories/omp-settings/RowEditor.tsx +165 -226
- package/src/client/components/settings/categories/omp-settings/types.ts +28 -0
- package/src/client/components/settings/categories/panel-plugins/AvailableList.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/BuiltinList.tsx +21 -3
- package/src/client/components/settings/categories/panel-plugins/PluginCard.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/PluginMark.test.ts +51 -2
- package/src/client/components/settings/categories/panel-plugins/PluginMark.tsx +43 -10
- package/src/client/components/settings/categories/plugin-settings/DetailPane.tsx +2 -1
- package/src/client/components/settings/categories/plugin-settings/SettingsSection.tsx +2 -1
- package/src/client/components/settings/categories/project-settings/ModelDropdown.tsx +1 -1
- package/src/client/components/settings/categories/project-settings/WorktreeSettings.tsx +2 -1
- package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/EntryAdvanced.tsx +3 -2
- package/src/client/components/settings/categories/provider-settings/LogoutProviderModal.tsx +2 -2
- package/src/client/components/settings/categories/skill-catalog/GitImportPanel.tsx +3 -2
- package/src/client/components/settings/categories/skill-settings/DetailHeader.tsx +37 -8
- package/src/client/components/settings/categories/skill-settings/DetailPane.tsx +34 -14
- package/src/client/components/settings/categories/skill-settings/SidebarList.tsx +21 -0
- package/src/client/components/settings/categories/skill-settings/pane.test.tsx +15 -6
- package/src/client/components/settings/categories/token-usage-settings/Breakdown.tsx +242 -102
- package/src/client/components/settings/categories/token-usage-settings/Chart.tsx +130 -56
- package/src/client/components/settings/categories/token-usage-settings/Controls.tsx +135 -0
- package/src/client/components/settings/categories/token-usage-settings/MetricsGrid.tsx +55 -33
- package/src/client/components/settings/categories/token-usage-settings/Provenance.tsx +59 -0
- package/src/client/components/settings/categories/token-usage-settings/panel.test.tsx +239 -0
- package/src/client/components/workspace/browser-panel/Screencast.test.ts +1 -0
- package/src/client/components/workspace/browser-panel/Screencast.tsx +17 -22
- package/src/client/components/workspace/browser-panel/TabStrip.test.tsx +158 -0
- package/src/client/components/workspace/browser-panel/TabStrip.tsx +90 -0
- package/src/client/components/workspace/browser-panel/index.tsx +50 -4
- package/src/client/components/workspace/browser-toolbar/index.tsx +41 -1
- package/src/client/components/workspace/btw-panel/TopicMenu.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/AiMessageFooter.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/NewChatModal.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/ToolCallingSection.tsx +2 -0
- package/src/client/components/workspace/chat-timeline/UndoConfirmModal.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/block-chrome.test.tsx +13 -2
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.tsx +4 -3
- package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/WaitingDependencyPicker.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/plan-review/index.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/index.tsx +2 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.test.ts +88 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.tsx +24 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.test.ts +34 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +5 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactChip.tsx +7 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.test.tsx +237 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +191 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/styles.test.tsx +1 -1
- package/src/client/components/workspace/context-panel/CostBreakdownPopover.tsx +1 -1
- package/src/client/components/workspace/diff-panel/MergeDiffView.tsx +21 -7
- package/src/client/components/workspace/diff-panel/changes.test.ts +51 -0
- package/src/client/components/workspace/diff-panel/changes.ts +28 -12
- package/src/client/components/workspace/diff-panel/index.tsx +2 -2
- package/src/client/components/workspace/diff-panel/merge.test.ts +28 -0
- package/src/client/components/workspace/diff-panel/merge.ts +21 -1
- package/src/client/components/workspace/editor/Body.tsx +7 -0
- package/src/client/components/workspace/editor/FileDocument.tsx +15 -21
- package/src/client/components/workspace/editor/FilePane.tsx +12 -0
- package/src/client/components/workspace/editor/PluginRail.tsx +1 -1
- package/src/client/components/workspace/editor/PreviewPane.tsx +70 -0
- package/src/client/components/workspace/editor/SaveDeletedFileModal.tsx +2 -2
- package/src/client/components/workspace/editor/TabContextMenu.tsx +1 -1
- package/src/client/components/workspace/editor/Tabs.tsx +1 -1
- package/src/client/components/workspace/editor/Toolbar.tsx +17 -1
- package/src/client/components/workspace/editor/index.tsx +25 -22
- package/src/client/components/workspace/editor/toolbar-clusters.test.ts +14 -0
- package/src/client/components/workspace/editor/toolbar-clusters.tsx +12 -86
- package/src/client/components/workspace/editor/toolbar-toggle.tsx +53 -0
- package/src/client/components/workspace/editor/toolbar-write-clusters.tsx +112 -0
- package/src/client/components/workspace/file-explorer/ContextMenu.tsx +1 -1
- package/src/client/components/workspace/file-explorer/Modals.tsx +10 -10
- package/src/client/components/workspace/file-explorer/RootMenu.tsx +1 -1
- package/src/client/components/workspace/git-panel/BranchToolbar.test.tsx +130 -0
- package/src/client/components/workspace/git-panel/BranchToolbar.tsx +21 -11
- package/src/client/components/workspace/git-panel/CommitBox.tsx +2 -1
- package/src/client/components/workspace/git-panel/Modals.tsx +2 -2
- package/src/client/components/workspace/git-panel/StashSection.tsx +2 -1
- package/src/client/components/workspace/git-panel/branch-modal/DeleteDialog.tsx +2 -1
- package/src/client/components/workspace/git-panel/branch-modal/RenameDialog.tsx +2 -1
- package/src/client/components/workspace/git-panel/commit-modal/index.tsx +2 -2
- package/src/client/components/workspace/git-panel/commit-modal.test.ts +5 -3
- package/src/client/components/workspace/git-panel/index.tsx +7 -0
- package/src/client/components/workspace/model-dropdown/Panel.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/SpecsTooltip.tsx +1 -1
- package/src/client/components/workspace/plugin-panel/catalog.tsx +7 -0
- package/src/client/components/workspace/plugin-panel/resolve.tsx +4 -0
- package/src/client/components/workspace/search-panel/Body.tsx +1 -1
- package/src/client/components/workspace/usage-panel/ProviderSelect.tsx +1 -1
- package/src/client/components/workspace/user-browser-panel/AddressBar.tsx +5 -0
- package/src/client/components/workspace/user-browser-panel/AnnotateBar.test.tsx +201 -0
- package/src/client/components/workspace/user-browser-panel/AnnotateBar.tsx +112 -0
- package/src/client/components/workspace/user-browser-panel/AnnotateLayer.test.tsx +225 -0
- package/src/client/components/workspace/user-browser-panel/AnnotateLayer.tsx +217 -0
- package/src/client/components/workspace/user-browser-panel/AnnotateTarget.tsx +99 -0
- package/src/client/components/workspace/user-browser-panel/Frame.tsx +30 -1
- package/src/client/components/workspace/user-browser-panel/index.tsx +81 -2
- package/src/client/data/agent-data/builtin.ts +0 -10
- package/src/client/data/agent-data/orchestrator.ts +0 -45
- package/src/client/data/agent-data/specialist.ts +0 -100
- package/src/client/data/mock/token-usage.ts +170 -120
- package/src/client/data/settings/omp-schema.json +33 -1
- package/src/client/glass.css +785 -0
- package/src/client/glass.test.ts +346 -0
- package/src/client/hooks/browser/use-annotate.test.ts +143 -0
- package/src/client/hooks/browser/use-annotate.ts +98 -0
- package/src/client/hooks/browser/use-close-tab.test.ts +148 -0
- package/src/client/hooks/browser/use-close-tab.ts +67 -0
- package/src/client/hooks/browser/use-screencast.ts +13 -1
- package/src/client/hooks/chat/composer/browser-context.test.ts +117 -0
- package/src/client/hooks/chat/composer/browser-context.ts +40 -16
- package/src/client/hooks/chat/composer/items.test.ts +1 -1
- package/src/client/hooks/chat/composer/review-context.ts +38 -0
- package/src/client/hooks/chat/composer/use-draft.test.ts +132 -0
- package/src/client/hooks/chat/composer/use-draft.ts +31 -2
- package/src/client/hooks/chat/timeline/row-window.test.ts +15 -2
- package/src/client/hooks/editor/use-document-annotations.ts +124 -0
- package/src/client/hooks/editor/use-editor-panel-ui.ts +52 -0
- package/src/client/hooks/editor/use-file-review-mode.ts +35 -0
- package/src/client/hooks/editor/use-preview-review.ts +148 -0
- package/src/client/hooks/settings/agents.ts +149 -0
- package/src/client/hooks/settings/crud-list.test.ts +28 -6
- package/src/client/hooks/settings/crud-list.ts +96 -57
- package/src/client/hooks/settings/omp-config.ts +164 -0
- package/src/client/hooks/settings/useTokenUsage.ts +125 -0
- package/src/client/hooks/settings/write-feedback.test.ts +104 -0
- package/src/client/hooks/settings/write-feedback.ts +63 -0
- package/src/client/hooks/ui/glass-support.ts +57 -0
- package/src/client/hooks/ui/icon-style.ts +59 -0
- package/src/client/hooks/ui/markdown-hydration.ts +125 -0
- package/src/client/hooks/ui/stuck-header.test.ts +188 -0
- package/src/client/hooks/ui/stuck-header.ts +91 -0
- package/src/client/hooks/ui/style-attributes.test.ts +120 -0
- package/src/client/hooks/ui/surface-style.ts +56 -0
- package/src/client/hooks/ui/updates/index.test.ts +100 -1
- package/src/client/hooks/ui/updates/index.ts +50 -0
- package/src/client/hooks/ui/updates/notes.test.ts +138 -0
- package/src/client/hooks/ui/updates/notes.ts +57 -0
- package/src/client/hooks/workspace/panel-hues.ts +23 -0
- package/src/client/lib/browser/element-at.test.ts +229 -0
- package/src/client/lib/browser/element-at.ts +139 -0
- package/src/client/lib/review/client.ts +73 -0
- package/src/client/lib/router/search-params.ts +42 -20
- package/src/client/main.tsx +10 -0
- package/src/client/tailwind.css +329 -11
- package/src/server/lib/assets/shell-attributes.server.ts +80 -0
- package/src/server/lib/assets/shell-attributes.test.ts +86 -0
- package/src/server/lib/btw/lifecycle.server.ts +2 -2
- package/src/server/lib/db/schema.ts +7 -0
- package/src/server/lib/db/seed-terminal.test.ts +4 -0
- package/src/server/lib/omp/config/agent-definitions.test.ts +273 -0
- package/src/server/lib/omp/config/agents.ts +231 -61
- package/src/server/lib/omp/config/definitions.test.ts +9 -105
- package/src/server/lib/omp/config/extensions.ts +16 -7
- package/src/server/lib/omp/config/omp-config-files.test.ts +27 -0
- package/src/server/lib/omp/rpc/constants.test.ts +11 -0
- package/src/server/lib/omp/rpc/constants.ts +15 -0
- package/src/server/lib/omp/rpc/frame-fold-host.test-util.ts +1 -0
- package/src/server/lib/omp/rpc/frame-fold-signals.test.ts +2 -30
- package/src/server/lib/omp/rpc/frame-fold.test.ts +55 -0
- package/src/server/lib/omp/rpc/frame-fold.ts +4 -0
- package/src/server/lib/omp/rpc/manager.ts +2 -2
- package/src/server/lib/omp/rpc/process-helpers.ts +11 -0
- package/src/server/lib/omp/rpc/process.test.ts +106 -0
- package/src/server/lib/omp/rpc/process.ts +39 -18
- package/src/server/lib/omp/rpc/run-settle.server.ts +12 -0
- package/src/server/lib/omp/rpc/run-settle.test.ts +22 -0
- package/src/server/lib/omp/rpc/session-command-guards.ts +5 -0
- package/src/server/lib/omp/rpc/session-commands.test.ts +9 -1
- package/src/server/lib/omp/rpc/session-commands.ts +17 -3
- package/src/server/lib/omp/rpc/terminal-settle.ts +29 -7
- package/src/server/lib/omp/rpc/utility-agent-dir.test.ts +134 -0
- package/src/server/lib/omp/rpc/utility-agent-dir.ts +138 -0
- package/src/server/lib/omp/rpc/utility.ts +12 -0
- package/src/server/lib/panels/bundled-catalog.server.ts +1 -0
- package/src/server/lib/panels/manifest.test.ts +20 -0
- package/src/server/lib/panels/manifest.ts +12 -0
- package/src/server/lib/panels/scan.server.ts +4 -0
- package/src/server/lib/queue/delivery-dispatch.server.test.ts +48 -0
- package/src/server/lib/queue/delivery-harness.ts +8 -4
- package/src/server/lib/queue/delivery.server.test.ts +29 -0
- package/src/server/lib/queue/delivery.server.ts +39 -0
- package/src/server/lib/queue/store.server.test.ts +22 -2
- package/src/server/lib/queue/store.server.ts +33 -11
- package/src/server/lib/review/schema.server.ts +45 -0
- package/src/server/lib/review/store.server.ts +138 -0
- package/src/server/lib/terminal/attach-replay.test.ts +132 -0
- package/src/server/lib/terminal/output.test.ts +166 -0
- package/src/server/lib/terminal/output.ts +104 -0
- package/src/server/lib/terminal/runtime.server.ts +5 -0
- package/src/server/lib/terminal/send-result.test.ts +33 -0
- package/src/server/lib/terminal/send-result.ts +32 -0
- package/src/server/lib/terminal/session.server.ts +45 -11
- package/src/server/lib/terminal/store-liveness.test.ts +4 -0
- package/src/server/lib/updates/active-notes.test.ts +149 -0
- package/src/server/lib/updates/active-notes.ts +75 -0
- package/src/server/lib/updates/changelog-file.ts +42 -11
- package/src/server/lib/updates/changelog.test.ts +15 -1
- package/src/server/lib/updates/omp.ts +42 -15
- package/src/server/lib/updates/release-url.ts +27 -1
- package/src/server/lib/usage/index-parse.test.ts +200 -0
- package/src/server/lib/usage/index-parse.ts +178 -0
- package/src/server/lib/usage/index-query.server.ts +248 -0
- package/src/server/lib/usage/index-scan.server.ts +343 -0
- package/src/server/lib/usage/index-schema.server.ts +82 -0
- package/src/server/lib/usage/index.test.ts +234 -0
- package/src/server/lib/usage/providers.server.ts +4 -53
- package/src/server/plugins/ssr.ts +22 -5
- package/src/server/routes/browser/index.ts +3 -0
- package/src/server/routes/browser/stream.ts +31 -2
- package/src/server/routes/browser/tabs.test.ts +94 -0
- package/src/server/routes/browser/tabs.ts +85 -0
- package/src/server/routes/index.ts +2 -0
- package/src/server/routes/review/bindings.ts +11 -0
- package/src/server/routes/review/index.ts +127 -0
- package/src/server/routes/review/routes.test.ts +191 -0
- package/src/server/routes/settings/agents.test.ts +180 -0
- package/src/server/routes/settings/agents.ts +95 -102
- package/src/server/routes/settings/mcp.test.ts +135 -0
- package/src/server/routes/settings/mcp.ts +14 -6
- package/src/server/routes/settings/settings-store-routes.test.ts +6 -113
- package/src/server/routes/telemetry/tokens.test.ts +145 -0
- package/src/server/routes/telemetry/tokens.ts +70 -149
- package/src/server/routes/terminal/ws.ts +6 -5
- package/src/server/routes/updates/index.ts +2 -0
- package/src/server/routes/updates/notes.ts +34 -0
- package/src/server/routes/updates/routes.test.ts +49 -0
- package/src/shared/lib/browser/annotate.test.ts +283 -0
- package/src/shared/lib/browser/annotate.ts +231 -0
- package/src/shared/lib/browser/browser-viewer.test.ts +26 -4
- package/src/shared/lib/browser/frame-gate.test.ts +91 -0
- package/src/shared/lib/browser/frame-gate.ts +69 -0
- package/src/shared/lib/browser/frame-params.test.ts +43 -0
- package/src/shared/lib/browser/frame-params.ts +60 -0
- package/src/shared/lib/browser/frame-pipeline.test.ts +132 -0
- package/src/shared/lib/browser/frame-pipeline.ts +80 -0
- package/src/shared/lib/browser/page-context.ts +60 -4
- package/src/shared/lib/browser/snapshot.test.ts +115 -0
- package/src/shared/lib/browser/snapshot.ts +112 -0
- package/src/shared/lib/browser/tab-close.test.ts +74 -0
- package/src/shared/lib/browser/tab-close.ts +77 -0
- package/src/shared/lib/browser/viewer.ts +45 -26
- package/src/shared/lib/chat/timeline/block-chrome.ts +19 -0
- package/src/shared/lib/chat/timeline/tool-render-mode.ts +17 -4
- package/src/shared/lib/chat/tool/artifact.ts +55 -20
- package/src/shared/lib/chat/tool/bash-facts.ts +96 -0
- package/src/shared/lib/chat/tool/minimized.test.ts +98 -0
- package/src/shared/lib/chat/tool/minimized.ts +64 -0
- package/src/shared/lib/chat/tool/summary.test.ts +28 -8
- package/src/shared/lib/chat/tool/summary.ts +3 -32
- package/src/shared/lib/icons/file-brand-color.ts +38 -0
- package/src/shared/lib/icons/icon-paint-css.test.ts +234 -0
- package/src/shared/lib/icons/icon-paint-css.ts +284 -0
- package/src/shared/lib/icons/icon-paint-panel.ts +100 -0
- package/src/shared/lib/icons/tint-hues.generated.ts +230 -0
- package/src/shared/lib/icons/tint.test.ts +273 -0
- package/src/shared/lib/icons/tint.ts +219 -0
- package/src/shared/lib/markdown/blocks/anchor.ts +63 -0
- package/src/shared/lib/markdown/blocks/blocks.test.ts +141 -0
- package/src/shared/lib/markdown/blocks/renderer.ts +120 -0
- package/src/shared/lib/markdown/blocks/scan.ts +100 -0
- package/src/shared/lib/markdown/blocks/types.ts +62 -0
- package/src/shared/lib/markdown/marked.ts +58 -147
- package/src/shared/lib/markdown/math-extensions.ts +168 -0
- package/src/shared/lib/markdown/review/prompt.ts +77 -0
- package/src/shared/lib/markdown/review/reconcile.ts +55 -0
- package/src/shared/lib/markdown/review/review.test.ts +96 -0
- package/src/shared/lib/markdown/xml-sections.test.ts +140 -0
- package/src/shared/lib/markdown/xml-sections.ts +139 -0
- package/src/shared/lib/models/provider/brand-color.test.ts +116 -0
- package/src/shared/lib/models/provider/brand-color.ts +103 -0
- package/src/shared/lib/models/provider/label.ts +57 -0
- package/src/shared/lib/omp/config/agent-file.test.ts +54 -0
- package/src/shared/lib/omp/config/agent-file.ts +43 -0
- package/src/shared/lib/omp/config/row-value.test.ts +95 -0
- package/src/shared/lib/omp/config/row-value.ts +97 -0
- package/src/shared/lib/omp/config/schema.test.ts +31 -0
- package/src/shared/lib/omp/config/schema.ts +6 -0
- package/src/shared/lib/omp/rpc/frame.test.ts +113 -47
- package/src/shared/lib/omp/rpc/frame.ts +107 -43
- package/src/shared/lib/settings/defaults.ts +4 -0
- package/src/shared/lib/theme/catalog.test.ts +5 -4
- package/src/shared/lib/theme/catalog.ts +18 -3
- package/src/shared/lib/theme/glass-support.test.ts +38 -0
- package/src/shared/lib/theme/glass-support.ts +73 -0
- package/src/shared/lib/theme/icon-style.test.ts +74 -0
- package/src/shared/lib/theme/icon-style.ts +90 -0
- package/src/shared/lib/theme/legibility.ts +91 -0
- package/src/shared/lib/theme/palettes/dark-extended.ts +152 -0
- package/src/shared/lib/theme/palettes/light-extended.ts +157 -0
- package/src/shared/lib/theme/surface-style.test.ts +68 -0
- package/src/shared/lib/theme/surface-style.ts +91 -0
- package/src/shared/lib/theme/theme.test.ts +11 -7
- package/src/shared/lib/ui/menu-anchor.test.ts +69 -0
- package/src/shared/lib/ui/menu-anchor.ts +89 -0
- package/src/shared/lib/usage/breakdown.test.ts +197 -0
- package/src/shared/lib/usage/breakdown.ts +241 -0
- package/src/shared/lib/usage/range.test.ts +204 -0
- package/src/shared/lib/usage/range.ts +240 -0
- package/src/shared/lib/usage/view.test.ts +85 -0
- package/src/shared/lib/usage/view.ts +74 -0
- package/src/shared/lib/workspace/panel-hues.test.ts +68 -0
- package/src/shared/lib/workspace/panel-hues.ts +57 -0
- package/src/shared/types/browser.ts +78 -0
- package/src/shared/types/index.ts +1 -0
- package/src/shared/types/panels-registry.ts +6 -0
- package/src/shared/types/panels.ts +14 -0
- package/src/shared/types/settings/agent.ts +28 -6
- package/src/shared/types/settings/state.ts +30 -3
- package/src/shared/types/settings/write.ts +6 -0
- package/src/shared/types/tokenUsage.ts +128 -21
- package/src/shared/types/updates.ts +20 -0
- package/src/test-support/fake-omp-frames.ts +163 -0
- package/dist/client/static/js/index-3ve31rzx.css +0 -1
- package/src/server/lib/omp/session/usage/aggregate-shaping.test.ts +0 -149
- package/src/server/lib/omp/session/usage/aggregate.test.ts +0 -243
- package/src/server/lib/omp/session/usage/aggregate.ts +0 -330
- package/src/server/lib/omp/session/usage/shaping.ts +0 -130
- /package/src/{client/components/common/file-icon/brand-paths.ts → shared/lib/icons/file-brand-paths.ts} +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The glow the glass plane blurs.
|
|
8
|
+
*
|
|
9
|
+
* Three empty, palette-tinted blobs under the window's frosted plane
|
|
10
|
+
* (`glass.css` draws them from `--aura`, which each child maps to a theme token).
|
|
11
|
+
* They exist because a `backdrop-filter` can only sample what is painted behind
|
|
12
|
+
* it: over a flat canvas the frost is indistinguishable from a plain translucent
|
|
13
|
+
* panel, and the whole material reads as "slightly washed out" instead of glass.
|
|
14
|
+
*
|
|
15
|
+
* It renders in every document and is inert in the classic look — no rule
|
|
16
|
+
* targets it without `[data-surface="glass"]` — because a conditional mount here
|
|
17
|
+
* would be a second place that knows about the surface style.
|
|
18
|
+
*/
|
|
19
|
+
export function WindowAura() {
|
|
20
|
+
return (
|
|
21
|
+
<div className="app-window-aura" aria-hidden="true">
|
|
22
|
+
<i />
|
|
23
|
+
<i />
|
|
24
|
+
<i />
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -122,7 +122,7 @@ export function LeftColumn({
|
|
|
122
122
|
view, then the strip across the whole width again. The rail must not
|
|
123
123
|
start above the title — it would run under the app's own titlebar —
|
|
124
124
|
and the strip must not stop at the view's edge. */}
|
|
125
|
-
<div className="flex flex-col h-full w-full bg-paper">
|
|
125
|
+
<div className="glass-chrome flex flex-col h-full w-full bg-paper">
|
|
126
126
|
<SessionSidebarHeader streamStatus={streamStatus} onCollapse={onCollapse} />
|
|
127
127
|
<div className="flex flex-1 min-h-0 w-full">
|
|
128
128
|
{railEnabled ? (
|
|
@@ -62,7 +62,7 @@ export function TopNavbar({
|
|
|
62
62
|
);
|
|
63
63
|
return (
|
|
64
64
|
<header
|
|
65
|
-
className="h-10 flex-shrink-0 border-b border-ink/10 bg-paper flex items-center justify-between z-20 titlebar-drag-region select-none"
|
|
65
|
+
className="glass-chrome h-10 flex-shrink-0 border-b border-ink/10 bg-paper flex items-center justify-between z-20 titlebar-drag-region select-none"
|
|
66
66
|
{...dragRegionProps()}
|
|
67
67
|
style={{
|
|
68
68
|
// The sidebar's own header carries the left inset while it is open.
|
|
@@ -83,7 +83,7 @@ export function TopNavbar({
|
|
|
83
83
|
<PanelLeft size={16} />
|
|
84
84
|
</button>
|
|
85
85
|
<span className="relative font-bold text-sm tracking-tight hidden sm:flex items-center flex-shrink-0">
|
|
86
|
-
<BrandWordmark />
|
|
86
|
+
<BrandWordmark glow />
|
|
87
87
|
{/* Same badge placement the sidebar header and the phone use:
|
|
88
88
|
the stream indicator belongs to the wordmark, not to the
|
|
89
89
|
control cluster. */}
|
|
@@ -301,8 +301,17 @@ export function WorkspacePanels(props: WorkspacePanelsProps) {
|
|
|
301
301
|
onClose: onToggleRightPanel,
|
|
302
302
|
layout: 'desktop',
|
|
303
303
|
};
|
|
304
|
+
// `glass-chrome` + `data-panel-chrome` on the SLOT, not on each
|
|
305
|
+
// view: the right panel is column chrome, exactly like the session
|
|
306
|
+
// sidebar, and ten built-in views plus every plugin panel paint
|
|
307
|
+
// their own `bg-paper` root. Marking the slot makes the column one
|
|
308
|
+
// surface and leaves a future view nothing to forget.
|
|
304
309
|
return (
|
|
305
|
-
<div
|
|
310
|
+
<div
|
|
311
|
+
key={panel.id}
|
|
312
|
+
data-panel-chrome=""
|
|
313
|
+
className={`glass-chrome w-full h-full${isActiveView ? '' : ' hidden'}`}
|
|
314
|
+
>
|
|
306
315
|
<PanelHostProvider value={body}>{panel.render(body)}</PanelHostProvider>
|
|
307
316
|
</div>
|
|
308
317
|
);
|
|
@@ -310,7 +319,7 @@ export function WorkspacePanels(props: WorkspacePanelsProps) {
|
|
|
310
319
|
{/* The selection names a panel that is switched off, uninstalled, or
|
|
311
320
|
whose bundle has not loaded — a notice, never a blank column. */}
|
|
312
321
|
{!activePanel ? (
|
|
313
|
-
<div className="w-full h-full">
|
|
322
|
+
<div data-panel-chrome="" className="glass-chrome w-full h-full">
|
|
314
323
|
<PluginPanelBody panelKey={activeRightPanel} />
|
|
315
324
|
</div>
|
|
316
325
|
) : null}
|
|
@@ -9,6 +9,7 @@ import type { OpenedFile } from '@/shared/types/fs';
|
|
|
9
9
|
import { useSessionState } from '@/client/hooks/workspace/session-state';
|
|
10
10
|
import { TopNavbar } from '@/client/components/layout/desktop-layout/TopNavbar';
|
|
11
11
|
import { WorkspacePanels } from '@/client/components/layout/desktop-layout/WorkspacePanels';
|
|
12
|
+
import { WindowAura } from '@/client/components/layout/WindowAura';
|
|
12
13
|
import { usePanelSlotPlugins } from '@/client/components/workspace/plugin-panel/resolve';
|
|
13
14
|
import { useAgentStreamStatus } from '@/client/hooks/chat/omp/status';
|
|
14
15
|
import { usePanelWidths } from '@/client/hooks/workspace/panel-widths';
|
|
@@ -224,8 +225,9 @@ export function DesktopLayout({ sessionId, onSwitchToMobile, appSettings = {} }:
|
|
|
224
225
|
return (
|
|
225
226
|
<div
|
|
226
227
|
data-testid="app-root"
|
|
227
|
-
className="relative flex flex-col h-screen w-screen overflow-hidden bg-canvas text-ink font-sans selection:bg-ink selection:text-canvas"
|
|
228
|
+
className="app-window relative flex flex-col h-screen w-screen overflow-hidden bg-canvas text-ink font-sans selection:bg-ink selection:text-canvas"
|
|
228
229
|
>
|
|
230
|
+
<WindowAura />
|
|
229
231
|
|
|
230
232
|
{/* Main Workspace: the resizable LEFT dock (rail + view, see
|
|
231
233
|
`LeftColumn`) plus the right stack. */}
|
|
@@ -14,8 +14,10 @@
|
|
|
14
14
|
* props; this file only decides how the two states look.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { useState } from 'preact/hooks';
|
|
17
|
+
import { useRef, useState } from 'preact/hooks';
|
|
18
18
|
import { ChevronDown, ChevronRight, MoreHorizontal, Pin, Plus } from 'lucide-preact';
|
|
19
|
+
import { AnchoredMenu } from '@/client/components/common/anchored-menu';
|
|
20
|
+
import { anchorRectOf, type AnchorRect } from '@/shared/lib/ui/menu-anchor';
|
|
19
21
|
import { NewWorktreeModal } from '@/client/components/workspace/worktree-modal/index';
|
|
20
22
|
import { SelectionCheckbox } from '@/client/components/common/batch-selection/SelectionCheckbox';
|
|
21
23
|
import { WorkspaceOptionsMenu } from '@/client/components/common/workspace-options-menu';
|
|
@@ -37,9 +39,10 @@ export interface CategoryHeaderProps {
|
|
|
37
39
|
checkbox: CategoryHeaderCheckbox | null;
|
|
38
40
|
/** True while a batch selection is active — actions are hidden then. */
|
|
39
41
|
batchActive: boolean;
|
|
40
|
-
menuRef: { current: HTMLDivElement | null };
|
|
41
42
|
showMenu: boolean;
|
|
42
43
|
onToggleMenu: () => void;
|
|
44
|
+
/** Close the `⋯` menu (backdrop, Escape, or a parent that moved on). */
|
|
45
|
+
onCloseMenu: () => void;
|
|
43
46
|
onNewSession: () => void;
|
|
44
47
|
/** Start a chat in a worktree made from this folder. */
|
|
45
48
|
onNewWorktreeSession?: (folderId: number, worktreePath: string) => void;
|
|
@@ -58,9 +61,9 @@ export function CategoryHeader({
|
|
|
58
61
|
onToggleFolder,
|
|
59
62
|
checkbox,
|
|
60
63
|
batchActive,
|
|
61
|
-
menuRef,
|
|
62
64
|
showMenu,
|
|
63
65
|
onToggleMenu,
|
|
66
|
+
onCloseMenu,
|
|
64
67
|
onNewSession,
|
|
65
68
|
onNewWorktreeSession,
|
|
66
69
|
onOpenFolder,
|
|
@@ -77,6 +80,13 @@ export function CategoryHeader({
|
|
|
77
80
|
const [worktreeDialogOpen, setWorktreeDialogOpen] = useState(false);
|
|
78
81
|
const canCreateWorktree = Boolean(onNewWorktreeSession && folder.project_path);
|
|
79
82
|
|
|
83
|
+
// The `⋯` panel is portalled and measured from this rectangle, because the
|
|
84
|
+
// sidebar this row sits in is a scroller: an `absolute` menu was clipped at
|
|
85
|
+
// the scroller's edge, and one at `z-50` inside the row still lost to a later
|
|
86
|
+
// sibling's stacking context. See `common/anchored-menu/`.
|
|
87
|
+
const triggerRef = useRef<HTMLButtonElement>(null);
|
|
88
|
+
const [anchor, setAnchor] = useState<AnchorRect | null>(null);
|
|
89
|
+
|
|
80
90
|
return (
|
|
81
91
|
<div className="group flex items-center justify-between h-7 text-xs font-semibold text-ink px-2 hover:bg-ink/5 rounded-md transition-colors select-none">
|
|
82
92
|
<div
|
|
@@ -112,8 +122,8 @@ export function CategoryHeader({
|
|
|
112
122
|
) : (
|
|
113
123
|
<ProjectIcon
|
|
114
124
|
size={15}
|
|
115
|
-
className="text-ink/75"
|
|
116
|
-
style={{
|
|
125
|
+
className="project-accent-mark text-ink/75"
|
|
126
|
+
style={folder.accentColor ? { '--project-accent': folder.accentColor } : undefined}
|
|
117
127
|
/>
|
|
118
128
|
)}
|
|
119
129
|
</span>
|
|
@@ -150,33 +160,44 @@ export function CategoryHeader({
|
|
|
150
160
|
<Plus size={12} />
|
|
151
161
|
</button>
|
|
152
162
|
|
|
153
|
-
<div className="relative flex items-center"
|
|
163
|
+
<div className="relative flex items-center">
|
|
154
164
|
<button
|
|
165
|
+
ref={triggerRef}
|
|
155
166
|
type="button"
|
|
156
167
|
title={`Options for ${folder.name}`}
|
|
157
168
|
aria-label={`Options for ${folder.name}`}
|
|
169
|
+
aria-haspopup="menu"
|
|
170
|
+
aria-expanded={showMenu}
|
|
158
171
|
className="w-5 h-5 flex items-center justify-center text-ink/40 hover:text-ink hover:bg-ink/10 rounded cursor-pointer transition-colors"
|
|
159
|
-
onClick={(e) => {
|
|
172
|
+
onClick={(e) => {
|
|
173
|
+
e.stopPropagation();
|
|
174
|
+
if (triggerRef.current) setAnchor(anchorRectOf(triggerRef.current));
|
|
175
|
+
onToggleMenu();
|
|
176
|
+
}}
|
|
160
177
|
>
|
|
161
178
|
<MoreHorizontal size={12} />
|
|
162
179
|
</button>
|
|
163
180
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
181
|
+
<AnchoredMenu
|
|
182
|
+
anchor={showMenu ? anchor : null}
|
|
183
|
+
align="end"
|
|
184
|
+
ariaLabel={`Options for ${folder.name}`}
|
|
185
|
+
className="glass-popover w-44 rounded-md border border-ink/15 bg-paper py-1 text-xs shadow-lg"
|
|
186
|
+
onClose={onCloseMenu}
|
|
187
|
+
>
|
|
188
|
+
<WorkspaceOptionsMenu
|
|
189
|
+
variant="desktop"
|
|
190
|
+
isPinned={folder.isPinned}
|
|
191
|
+
onOpenFolder={onOpenFolder}
|
|
192
|
+
onSelectSessions={onSelectSessions}
|
|
193
|
+
onNewWorktree={canCreateWorktree ? () => { onToggleMenu(); setWorktreeDialogOpen(true); } : undefined}
|
|
194
|
+
confirmDelete={confirmDelete}
|
|
195
|
+
onPin={onPin}
|
|
196
|
+
onDelete={onDelete}
|
|
197
|
+
onRequestDelete={onRequestDelete}
|
|
198
|
+
onCancelDelete={onCancelDelete}
|
|
199
|
+
/>
|
|
200
|
+
</AnchoredMenu>
|
|
180
201
|
</div>
|
|
181
202
|
</div>
|
|
182
203
|
)}
|
|
@@ -53,7 +53,15 @@ afterAll(() => {
|
|
|
53
53
|
restoreDomGlobals();
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* Mount the header, then open its `⋯` menu the way a user does.
|
|
58
|
+
*
|
|
59
|
+
* The menu panel is PORTALLED to `document.body` (the row is inside the
|
|
60
|
+
* sidebar's scroller, and an `absolute` menu was clipped at its edge), so it can
|
|
61
|
+
* no longer be rendered by handing `showMenu: true` to a header that was never
|
|
62
|
+
* clicked: the panel is placed from the TRIGGER's measured rectangle, which
|
|
63
|
+
* only exists once that button has been pressed.
|
|
64
|
+
*/
|
|
57
65
|
function mountHeader(overrides: Partial<Parameters<typeof CategoryHeader>[0]> = {}): HTMLElement {
|
|
58
66
|
host = document.createElement('div');
|
|
59
67
|
document.body.appendChild(host);
|
|
@@ -64,9 +72,9 @@ function mountHeader(overrides: Partial<Parameters<typeof CategoryHeader>[0]> =
|
|
|
64
72
|
onToggleFolder: () => {},
|
|
65
73
|
checkbox: null,
|
|
66
74
|
batchActive: false,
|
|
67
|
-
menuRef: { current: null },
|
|
68
75
|
showMenu: true,
|
|
69
76
|
onToggleMenu: () => {},
|
|
77
|
+
onCloseMenu: () => {},
|
|
70
78
|
onNewSession: () => {},
|
|
71
79
|
confirmDelete: false,
|
|
72
80
|
onPin: () => {},
|
|
@@ -80,33 +88,44 @@ function mountHeader(overrides: Partial<Parameters<typeof CategoryHeader>[0]> =
|
|
|
80
88
|
return host;
|
|
81
89
|
}
|
|
82
90
|
|
|
83
|
-
/**
|
|
84
|
-
function
|
|
85
|
-
|
|
91
|
+
/** Press the row's `⋯` trigger, which is what mounts the portalled menu. */
|
|
92
|
+
async function openMenu(host: HTMLElement): Promise<void> {
|
|
93
|
+
const trigger = host.querySelector('button[aria-label^="Options for"]') as HTMLButtonElement | null;
|
|
94
|
+
if (!trigger) throw new Error('no options trigger rendered');
|
|
95
|
+
await act(async () => {
|
|
96
|
+
trigger.click();
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** The menu's own buttons, by their words — read from the document it portals into. */
|
|
101
|
+
function menuRows(): string[] {
|
|
102
|
+
return [...document.body.querySelectorAll('[aria-label^="Options for"] button')]
|
|
103
|
+
.map((button) => (button.textContent ?? '').trim())
|
|
104
|
+
.filter(Boolean);
|
|
86
105
|
}
|
|
87
106
|
|
|
88
107
|
describe('CategoryHeader worktree entry', () => {
|
|
89
|
-
test('the menu offers New worktree… when a handler is supplied', () => {
|
|
90
|
-
|
|
91
|
-
expect(menuRows(
|
|
108
|
+
test('the menu offers New worktree… when a handler is supplied', async () => {
|
|
109
|
+
await openMenu(mountHeader({ onNewWorktreeSession: () => {} }));
|
|
110
|
+
expect(menuRows()).toContain('New worktree…');
|
|
92
111
|
});
|
|
93
112
|
|
|
94
|
-
test('no row without a handler — a folder that cannot create one does not offer it', () => {
|
|
95
|
-
|
|
96
|
-
expect(menuRows(
|
|
113
|
+
test('no row without a handler — a folder that cannot create one does not offer it', async () => {
|
|
114
|
+
await openMenu(mountHeader());
|
|
115
|
+
expect(menuRows().some((row) => row.startsWith('New worktree'))).toBe(false);
|
|
97
116
|
});
|
|
98
117
|
|
|
99
|
-
test('a folder with no project path offers nothing: a worktree needs a repository', () => {
|
|
100
|
-
|
|
118
|
+
test('a folder with no project path offers nothing: a worktree needs a repository', async () => {
|
|
119
|
+
await openMenu(mountHeader({
|
|
101
120
|
folder: { ...folder, project_path: null },
|
|
102
121
|
onNewWorktreeSession: () => {},
|
|
103
|
-
});
|
|
104
|
-
expect(menuRows(
|
|
122
|
+
}));
|
|
123
|
+
expect(menuRows().some((row) => row.startsWith('New worktree'))).toBe(false);
|
|
105
124
|
});
|
|
106
125
|
|
|
107
126
|
test('clicking it opens the dialog, closed on its own name field', async () => {
|
|
108
|
-
|
|
109
|
-
const row = [...
|
|
127
|
+
await openMenu(mountHeader({ onNewWorktreeSession: () => {} }));
|
|
128
|
+
const row = [...document.body.querySelectorAll<HTMLButtonElement>('[aria-label^="Options for"] button')].find(
|
|
110
129
|
(button) => (button.textContent ?? '').trim() === 'New worktree…',
|
|
111
130
|
);
|
|
112
131
|
if (!row) throw new Error('no New worktree row rendered');
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { useEffect,
|
|
1
|
+
import { useEffect, useState } from 'preact/hooks';
|
|
2
2
|
import { ChevronDown, ChevronUp } from 'lucide-preact';
|
|
3
3
|
import { useSearchParams } from '@/client/lib/router/search-params';
|
|
4
4
|
import { useFetcher } from '@/client/lib/router/fetcher';
|
|
5
|
-
import { useOnClickOutside } from '@/client/hooks/ui/on-click-outside';
|
|
6
5
|
import { useShowMore } from '@/client/hooks/ui/show-more';
|
|
7
6
|
import { useWorkspaceFolderActions } from '@/client/hooks/workspace/workspace-folder-actions';
|
|
8
7
|
import { useSessionDelete } from '@/client/hooks/workspace/session-delete';
|
|
@@ -63,8 +62,7 @@ export function Category({
|
|
|
63
62
|
useEffect(() => {
|
|
64
63
|
if (typeof folder.isExpanded === 'boolean') setIsOpen(folder.isExpanded);
|
|
65
64
|
}, [folder.isExpanded]);
|
|
66
|
-
|
|
67
|
-
const menuRef = useRef<HTMLDivElement>(null);
|
|
65
|
+
|
|
68
66
|
const { refresh } = useSidebarData();
|
|
69
67
|
const toggleFetcher = useFetcher<{ success?: boolean }>();
|
|
70
68
|
const {
|
|
@@ -80,10 +78,13 @@ export function Category({
|
|
|
80
78
|
} = useWorkspaceFolderActions(folder, refresh, onToast);
|
|
81
79
|
const sessionDelete = useSessionDelete();
|
|
82
80
|
|
|
83
|
-
|
|
81
|
+
// The menu's own portalled backdrop is the dismissal now, so there is exactly
|
|
82
|
+
// one close path (`common/anchored-menu/`) and it also closes the inline
|
|
83
|
+
// delete confirmation.
|
|
84
|
+
const closeMenu = () => {
|
|
84
85
|
setShowMenu(false);
|
|
85
86
|
cancelDelete();
|
|
86
|
-
}
|
|
87
|
+
};
|
|
87
88
|
|
|
88
89
|
const allSessions = folder.sessions;
|
|
89
90
|
|
|
@@ -170,9 +171,9 @@ export function Category({
|
|
|
170
171
|
: null
|
|
171
172
|
}
|
|
172
173
|
batchActive={Boolean(batch)}
|
|
173
|
-
menuRef={menuRef}
|
|
174
174
|
showMenu={showMenu}
|
|
175
175
|
onToggleMenu={() => setShowMenu(!showMenu)}
|
|
176
|
+
onCloseMenu={closeMenu}
|
|
176
177
|
onNewSession={() => onNewSessionForFolder(folder.id)}
|
|
177
178
|
onNewWorktreeSession={onNewWorktreeSession}
|
|
178
179
|
onOpenFolder={onOpenFolder}
|
|
@@ -38,7 +38,7 @@ export function SessionSidebarHeader({
|
|
|
38
38
|
same placement the phone's header uses — it reads as part of the
|
|
39
39
|
title instead of competing with the icon controls for a slot. */}
|
|
40
40
|
<span className="relative font-bold text-sm tracking-tight flex items-center">
|
|
41
|
-
<BrandWordmark />
|
|
41
|
+
<BrandWordmark glow />
|
|
42
42
|
<span className="absolute -top-0.5 -right-1.5 flex">
|
|
43
43
|
<StreamStatusDot status={streamStatus} />
|
|
44
44
|
</span>
|
|
@@ -101,7 +101,7 @@ export function ToolbarOverflowMenu({
|
|
|
101
101
|
{open && (
|
|
102
102
|
<div
|
|
103
103
|
role="menu"
|
|
104
|
-
className={`absolute right-0 top-full mt-2 w-52 bg-paper border border-ink/15 shadow-lg z-50 py-1 text-xs ${
|
|
104
|
+
className={`glass-popover absolute right-0 top-full mt-2 w-52 bg-paper border border-ink/15 shadow-lg z-50 py-1 text-xs ${
|
|
105
105
|
mobile ? 'rounded-xl p-2' : 'rounded-lg'
|
|
106
106
|
}`}
|
|
107
107
|
>
|
|
@@ -221,7 +221,7 @@ export function SessionSidebarToolbar({
|
|
|
221
221
|
<ArrowUpDown size={14} />
|
|
222
222
|
</button>
|
|
223
223
|
{optionsOpen && (
|
|
224
|
-
<div className="absolute right-0 top-full mt-2 w-48 bg-paper border border-ink/15 rounded-lg shadow-lg z-50 py-1" onMouseLeave={onCloseOptions}>
|
|
224
|
+
<div className="glass-popover absolute right-0 top-full mt-2 w-48 bg-paper border border-ink/15 rounded-lg shadow-lg z-50 py-1" onMouseLeave={onCloseOptions}>
|
|
225
225
|
<SortMenu variant="desktop" sortOption={sortOption} onSortChange={onSortChange} />
|
|
226
226
|
</div>
|
|
227
227
|
)}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One product's changelog for the version that is RUNNING, opened from About.
|
|
3
|
+
*
|
|
4
|
+
* The About modal's pair of buttons answer "what am I running" — the update
|
|
5
|
+
* popup answers "what would I get" — so this dialog renders exactly one section,
|
|
6
|
+
* taken from the install's own version by the server. It sits above About rather
|
|
7
|
+
* than replacing it, and `z-[65]` keeps it above the update popup's layer for the
|
|
8
|
+
* case where both are reachable at once.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { createPortal } from 'preact/compat';
|
|
12
|
+
import { AlertCircle, ExternalLink, RefreshCw, Sparkles } from 'lucide-preact';
|
|
13
|
+
import { Modal } from '@/client/components/common/Modal';
|
|
14
|
+
import { openLinksExternally, ReleaseSection } from '@/client/components/layout/update-popup/ReleaseNotes';
|
|
15
|
+
import { useActiveReleaseNotes } from '@/client/hooks/ui/updates/notes';
|
|
16
|
+
import type { UpdateTarget } from '@/shared/types/updates';
|
|
17
|
+
|
|
18
|
+
export interface NotesDialogProps {
|
|
19
|
+
target: UpdateTarget;
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const PRODUCT: Record<UpdateTarget, string> = { kabmo: 'Kabmo', omp: 'Oh-My-Pi' };
|
|
24
|
+
|
|
25
|
+
export function NotesDialog({ target, onClose }: NotesDialogProps) {
|
|
26
|
+
const notes = useActiveReleaseNotes(target);
|
|
27
|
+
const data = notes.data;
|
|
28
|
+
const product = PRODUCT[target];
|
|
29
|
+
const version = data?.version ?? null;
|
|
30
|
+
// "installed" vs "running" names where the version came from: a package on
|
|
31
|
+
// disk for Kabmo, the live `omp` binary for Oh-My-Pi. Both are this machine's.
|
|
32
|
+
const origin = target === 'omp' ? 'running' : 'installed';
|
|
33
|
+
|
|
34
|
+
return createPortal(
|
|
35
|
+
<Modal
|
|
36
|
+
onClose={onClose}
|
|
37
|
+
zClass="z-[65]"
|
|
38
|
+
// A single release's notes are long prose — commit subjects, long PR and
|
|
39
|
+
// contributor names, 60+ wrapped list items in omp's case. At 560px the
|
|
40
|
+
// body was 542px of column and a release ran past 1900px of scroll, so the
|
|
41
|
+
// width is the reader's cost. 768px is the widest panel that still wraps
|
|
42
|
+
// those items once instead of three times while staying under a prose
|
|
43
|
+
// measure a reader can track; `max-h-full` keeps it inside a phone's
|
|
44
|
+
// viewport, where the body scrolls.
|
|
45
|
+
maxWidthClass="max-w-3xl"
|
|
46
|
+
ariaLabel={`What is new in ${product}`}
|
|
47
|
+
header={
|
|
48
|
+
<div className="flex min-w-0 items-center gap-3">
|
|
49
|
+
<Sparkles size={16} className="shrink-0 text-ink/70" />
|
|
50
|
+
<div className="min-w-0">
|
|
51
|
+
<h2 className="text-sm font-semibold text-ink">What's new in {product}</h2>
|
|
52
|
+
<p className="truncate font-mono text-[11px] text-ink/50">
|
|
53
|
+
{version ? `v${version} · ${origin}` : `${origin} version…`}
|
|
54
|
+
</p>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
}
|
|
58
|
+
footer={
|
|
59
|
+
data?.changelogUrl ? (
|
|
60
|
+
<div className="border-t border-ink/10 px-5 py-3">
|
|
61
|
+
<a
|
|
62
|
+
href={data.changelogUrl}
|
|
63
|
+
target="_blank"
|
|
64
|
+
rel="noopener noreferrer"
|
|
65
|
+
className="inline-flex items-center gap-1.5 text-[11px] font-medium text-ink/60 transition-colors hover:text-ink"
|
|
66
|
+
>
|
|
67
|
+
<span>Full changelog</span>
|
|
68
|
+
<ExternalLink size={11} />
|
|
69
|
+
</a>
|
|
70
|
+
</div>
|
|
71
|
+
) : undefined
|
|
72
|
+
}
|
|
73
|
+
>
|
|
74
|
+
<div className="px-5 py-4" onClick={openLinksExternally}>
|
|
75
|
+
{notes.loading && (
|
|
76
|
+
<p className="flex items-center gap-2 text-[11px] text-ink/50">
|
|
77
|
+
<RefreshCw size={12} className="animate-spin motion-reduce:animate-none" />
|
|
78
|
+
<span>Loading release notes…</span>
|
|
79
|
+
</p>
|
|
80
|
+
)}
|
|
81
|
+
|
|
82
|
+
{!notes.loading && notes.error && (
|
|
83
|
+
<div className="flex items-start gap-2">
|
|
84
|
+
<AlertCircle size={14} className="mt-0.5 shrink-0 text-ink/40" />
|
|
85
|
+
<p className="text-[11px] leading-4 text-ink/60">{notes.error}</p>
|
|
86
|
+
</div>
|
|
87
|
+
)}
|
|
88
|
+
|
|
89
|
+
{!notes.loading && data?.note && <ReleaseSection note={data.note} />}
|
|
90
|
+
</div>
|
|
91
|
+
</Modal>,
|
|
92
|
+
document.body,
|
|
93
|
+
);
|
|
94
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The version line is the row a reader looks at to learn what is running, so
|
|
8
|
+
* the release-notes control belongs to that row and must be addressable by the
|
|
9
|
+
* product it opens — not by a generic "Info" name that would make the two lines
|
|
10
|
+
* indistinguishable to a screen reader or a spec.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
|
|
14
|
+
import { Window } from 'happy-dom';
|
|
15
|
+
import { h, render } from 'preact';
|
|
16
|
+
import { act } from 'preact/test-utils';
|
|
17
|
+
|
|
18
|
+
import { VersionLine } from '@/client/components/layout/session-sidebar/about-modal/VersionLine';
|
|
19
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
20
|
+
|
|
21
|
+
let container: HTMLElement;
|
|
22
|
+
|
|
23
|
+
function mount(label: string, notesLabel: string, onNotes: () => void): HTMLElement {
|
|
24
|
+
container = document.createElement('div');
|
|
25
|
+
document.body.appendChild(container);
|
|
26
|
+
act(() =>
|
|
27
|
+
render(h(VersionLine, { label, notesLabel, onNotes }), container),
|
|
28
|
+
);
|
|
29
|
+
return container;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
beforeAll(() => {
|
|
33
|
+
installDomGlobals(new Window({ url: 'http://localhost' }));
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
afterEach(() => {
|
|
37
|
+
if (container) render(null, container);
|
|
38
|
+
container?.remove();
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
afterAll(() => {
|
|
42
|
+
restoreDomGlobals();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
describe('VersionLine', () => {
|
|
46
|
+
test('shows the version text beside a circle-i control named for its product', () => {
|
|
47
|
+
const el = mount('Kabmo v0.17.0', "What's new in Kabmo", () => {});
|
|
48
|
+
|
|
49
|
+
expect(el.textContent).toBe('Kabmo v0.17.0');
|
|
50
|
+
const button = el.querySelector('button');
|
|
51
|
+
expect(button?.getAttribute('aria-label')).toBe("What's new in Kabmo");
|
|
52
|
+
expect(button?.getAttribute('title')).toBe("What's new in Kabmo");
|
|
53
|
+
expect(button?.querySelector('svg')).not.toBeNull();
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test('the control opens that product’s notes', () => {
|
|
57
|
+
let opened = 0;
|
|
58
|
+
const el = mount('Oh-My-Pi 18.14.0', "What's new in Oh-My-Pi", () => {
|
|
59
|
+
opened += 1;
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
act(() => {
|
|
63
|
+
el.querySelector('button')?.dispatchEvent(new window.Event('click', { bubbles: true }));
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
expect(opened).toBe(1);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One install line in About — `Kabmo v0.17.0` — with the "circle i" control
|
|
3
|
+
* that opens that product's release notes.
|
|
4
|
+
*
|
|
5
|
+
* The version text and the control are one row because they describe one
|
|
6
|
+
* subject: the version that is running. A separate pair of buttons above the
|
|
7
|
+
* list read as an action on the update, which is the other question the updates
|
|
8
|
+
* row already answers.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { Info } from 'lucide-preact';
|
|
12
|
+
|
|
13
|
+
export interface VersionLineProps {
|
|
14
|
+
/** The version text exactly as it is shown, e.g. `Kabmo v0.17.0`. */
|
|
15
|
+
label: string;
|
|
16
|
+
/** Accessible name of the notes control; it names the product. */
|
|
17
|
+
notesLabel: string;
|
|
18
|
+
onNotes: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function VersionLine({ label, notesLabel, onNotes }: VersionLineProps) {
|
|
22
|
+
return (
|
|
23
|
+
<p className="flex items-center justify-center gap-1.5">
|
|
24
|
+
<span>{label}</span>
|
|
25
|
+
<button
|
|
26
|
+
type="button"
|
|
27
|
+
onClick={onNotes}
|
|
28
|
+
aria-label={notesLabel}
|
|
29
|
+
title={notesLabel}
|
|
30
|
+
className="rounded-full p-0.5 text-ink/40 transition-colors hover:text-ink focus-visible:text-ink"
|
|
31
|
+
>
|
|
32
|
+
<Info size={13} aria-hidden="true" />
|
|
33
|
+
</button>
|
|
34
|
+
</p>
|
|
35
|
+
);
|
|
36
|
+
}
|