@kabmo-labs/kabmo 0.21.1 → 0.22.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 +7 -2
- package/dist/client/index.html +9 -8
- package/dist/client/index.js +334 -334
- package/dist/client/static/js/{index-thwqf24c.js → index-297dck9a.js} +784 -791
- package/dist/client/static/js/index-7ppta1pb.css +1 -0
- package/extensions/kabmo-modes/commands.ts +17 -3
- package/extensions/kabmo-modes/goal-start.ts +101 -0
- package/extensions/kabmo-modes/goal.test.ts +80 -5
- package/extensions/kabmo-modes/goal.ts +13 -38
- package/extensions/kabmo-modes/prompts.test.ts +12 -0
- package/extensions/kabmo-modes/prompts.ts +9 -2
- package/index.html +8 -7
- package/package.json +2 -2
- package/src/cli/lib/args.js +9 -0
- package/src/cli/lib/args.test.js +26 -0
- package/src/cli/lib/commands/doctor.js +153 -0
- package/src/cli/lib/commands/doctor.test.js +139 -0
- package/src/cli/lib/commands/serve.js +23 -10
- package/src/cli/lib/commands/status.js +22 -3
- package/src/cli/lib/omp-setup.js +131 -0
- package/src/cli/lib/omp-setup.test.js +115 -0
- package/src/cli/main.js +1 -1
- package/src/client/components/common/DemoDataBadge.tsx +52 -0
- package/src/client/components/common/FolderPicker.tsx +2 -2
- package/src/client/components/common/Modal.tsx +15 -1
- package/src/client/components/common/code-surface/blame-panel.ts +1 -1
- package/src/client/components/common/context-usage-button/index.test.tsx +1 -1
- package/src/client/components/common/context-usage-button/index.tsx +4 -4
- package/src/client/components/common/demo-data-badge.test.tsx +58 -0
- package/src/client/components/common/diagram-viewer/index.tsx +2 -2
- package/src/client/components/common/editor-view-buttons/index.tsx +2 -2
- package/src/client/components/common/header-controls/MoreMenu.tsx +1 -1
- package/src/client/components/common/header-controls/index.tsx +4 -1
- package/src/client/components/common/markdown-review/ReviewPopover.tsx +2 -2
- package/src/client/components/common/markdown-review/ReviewSummary.tsx +1 -1
- package/src/client/components/common/panel-mark/index.tsx +2 -1
- package/src/client/components/common/server-control/Panel.tsx +3 -3
- package/src/client/components/common/server-control/index.tsx +1 -1
- package/src/client/components/common/shell-update-button/Modal.tsx +1 -1
- package/src/client/components/common/todo-row/index.tsx +1 -1
- package/src/client/components/layout/ActivityBar.tsx +4 -0
- package/src/client/components/layout/ShellNotice.tsx +33 -0
- package/src/client/components/layout/desktop-layout/index.tsx +14 -16
- package/src/client/components/layout/desktop-layout/resizer/index.tsx +14 -1
- package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +2 -1
- package/src/client/components/layout/session-sidebar/ClassicView.tsx +5 -1
- package/src/client/components/layout/session-sidebar/SessionList.tsx +1 -1
- package/src/client/components/layout/session-sidebar/SessionListNotice.tsx +56 -0
- package/src/client/components/layout/session-sidebar/SessionsView.tsx +2 -0
- package/src/client/components/layout/session-sidebar/about-modal/UpdateSection.tsx +1 -1
- package/src/client/components/layout/session-sidebar/about-modal/index.tsx +12 -1
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +2 -1
- package/src/client/components/layout/session-sidebar/modern/index.tsx +6 -2
- package/src/client/components/layout/session-sidebar/new-workspace-modal/CloneField.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 +1 -1
- package/src/client/components/layout/session-sidebar/scheduler-modal/TaskList.tsx +3 -3
- package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +1 -1
- package/src/client/components/layout/session-sidebar/session-list-states.test.tsx +150 -0
- package/src/client/components/layout/session-sidebar/variant-props.ts +6 -0
- package/src/client/components/mobile/LayoutWrapper.tsx +20 -30
- package/src/client/components/mobile/MainView.tsx +5 -2
- package/src/client/components/mobile/RightSidebar.tsx +1 -1
- package/src/client/components/mobile/SessionSidebar.tsx +3 -0
- package/src/client/components/mobile/mobile-main-view/Header.tsx +2 -2
- package/src/client/components/mobile/mobile-session-sidebar/ClassicDrawer.tsx +7 -1
- package/src/client/components/mobile/mobile-session-sidebar/Toolbar.tsx +1 -1
- package/src/client/components/settings/Modal.tsx +15 -1
- package/src/client/components/settings/ProjectSelectorDropdown.tsx +1 -1
- package/src/client/components/settings/Sidebar.tsx +2 -2
- package/src/client/components/settings/categories/OmpSettings.tsx +1 -1
- package/src/client/components/settings/categories/TokenUsageSettings.tsx +1 -1
- package/src/client/components/settings/categories/agent-settings/DetailPane.tsx +3 -3
- package/src/client/components/settings/categories/appearance-settings/EditorFontSection.tsx +1 -1
- package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/IconStyleSection.tsx +5 -5
- package/src/client/components/settings/categories/appearance-settings/SidebarStyleSection.tsx +1 -1
- package/src/client/components/settings/categories/appearance-settings/SurfaceStyleSection.tsx +1 -1
- package/src/client/components/settings/categories/appearance-settings/ThemeCard.tsx +1 -1
- package/src/client/components/settings/categories/chat-settings/ComposerStyleSection.tsx +1 -1
- package/src/client/components/settings/categories/chat-settings/GoalSection.tsx +1 -1
- package/src/client/components/settings/categories/command-settings/DetailPane.tsx +2 -2
- package/src/client/components/settings/categories/omp-settings/ConfigTabs.tsx +5 -5
- package/src/client/components/settings/categories/omp-settings/EngineHeader.tsx +3 -3
- package/src/client/components/settings/categories/omp-settings/RoleRow.tsx +2 -2
- package/src/client/components/settings/categories/panel-plugins/LeftDockSettings.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/PluginCard.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/PluginMark.tsx +4 -3
- package/src/client/components/settings/categories/plugin-settings/SidebarList.tsx +2 -2
- package/src/client/components/settings/categories/project-settings/AddProjectModal.tsx +1 -1
- package/src/client/components/settings/categories/project-settings/NameInput.tsx +1 -1
- package/src/client/components/settings/categories/project-settings/PathField.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/AddModelModal.tsx +3 -3
- package/src/client/components/settings/categories/provider-settings/AddProviderModal.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/AuthSection.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/EntryAdvanced.tsx +4 -4
- package/src/client/components/settings/categories/provider-settings/EntryModal.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/LoginModal.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/ModelCapabilitiesModal.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/ModelsList.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/PriceFields.tsx +1 -1
- package/src/client/components/settings/categories/token-usage-settings/Breakdown.tsx +4 -4
- package/src/client/components/settings/categories/token-usage-settings/Chart.tsx +2 -2
- package/src/client/components/settings/categories/token-usage-settings/Controls.tsx +1 -1
- package/src/client/components/settings/categories/token-usage-settings/MetricsGrid.tsx +1 -1
- package/src/client/components/settings/categories/usage-settings/KenariCard.tsx +5 -5
- package/src/client/components/workspace/browser-panel/AddressBar.tsx +1 -1
- package/src/client/components/workspace/browser-panel/Screencast.tsx +6 -6
- package/src/client/components/workspace/browser-panel/TabStrip.tsx +1 -1
- package/src/client/components/workspace/browser-panel/index.tsx +1 -1
- package/src/client/components/workspace/browser-toolbar/index.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/AttachmentChips.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/GeneratingIndicator.tsx +13 -26
- package/src/client/components/workspace/chat-timeline/GoalNotice.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/MessageItem.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/MinimapShortcuts.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/QueueList.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/SubagentView.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/SystemNotice.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/TaskResultContent.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +4 -4
- package/src/client/components/workspace/chat-timeline/ToolCallingSection.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/ArmedGoalStrip.tsx +71 -0
- package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +4 -3
- package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.test.ts +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.test.ts +176 -0
- package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.tsx +70 -81
- package/src/client/components/workspace/chat-timeline/chat-input/GoalSurfaces.tsx +10 -1
- package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.test.ts +20 -0
- package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.tsx +13 -7
- package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +65 -3
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +69 -19
- package/src/client/components/workspace/chat-timeline/chat-input/WaitingDependencyPicker.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/chat-input/composer-portal.test.tsx +174 -0
- package/src/client/components/workspace/chat-timeline/chat-input/goal-modal-parts.tsx +80 -0
- package/src/client/components/workspace/chat-timeline/chat-input/modes-props.ts +15 -3
- package/src/client/components/workspace/chat-timeline/chat-input/styles.test.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/plan-review/index.tsx +1 -1
- 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/ask-panel/FrameControl.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionBlock.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionCard.tsx +4 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Header.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/SelectBody.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/hashline-patch/index.tsx +4 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AstEdit.tsx +6 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.tsx +13 -13
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Checkpoint.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/ContextNotes.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Debug.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Edit.tsx +9 -9
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Eval.tsx +10 -10
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/FileMatches.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Goal.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/GoalRecord.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Lsp.tsx +6 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/ManageSkill.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Memory.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Proc.tsx +15 -15
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Resolve.tsx +4 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/SearchFs.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/SearchTool.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/SecurityScan.tsx +4 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/TaskResult.tsx +7 -7
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Think.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Todo.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.missing.test.ts +4 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +17 -17
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/WebSearch.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactChip.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/EnvelopeHeader.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ExcerptCode.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/FallbackOutput.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/JsonCodeBlock.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/OutputWindow.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolBody.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolFactChips.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolPanelHeader.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Minimal.tsx +1 -1
- package/src/client/components/workspace/context-panel/RawJsonViewer.tsx +2 -2
- package/src/client/components/workspace/context-panel/StatsGrid.tsx +1 -1
- package/src/client/components/workspace/context-panel/index.tsx +1 -1
- package/src/client/components/workspace/diff-panel/ConflictBanner.tsx +1 -1
- package/src/client/components/workspace/editor/EmptyEditor.tsx +1 -1
- package/src/client/components/workspace/editor/FindWidget.tsx +1 -1
- package/src/client/components/workspace/editor/Tabs.tsx +1 -1
- package/src/client/components/workspace/editor/Toolbar.tsx +1 -1
- package/src/client/components/workspace/file-explorer/OutlineSection.tsx +2 -2
- package/src/client/components/workspace/file-explorer/RowLabel.tsx +1 -1
- package/src/client/components/workspace/file-explorer/index.tsx +1 -1
- package/src/client/components/workspace/git-panel/BranchToolbar.tsx +2 -2
- package/src/client/components/workspace/git-panel/ChangesList.tsx +3 -3
- package/src/client/components/workspace/git-panel/ConflictItem.tsx +3 -3
- package/src/client/components/workspace/git-panel/FileItem.tsx +2 -2
- package/src/client/components/workspace/git-panel/StashSection.tsx +5 -5
- package/src/client/components/workspace/git-panel/TreeItem.tsx +2 -2
- package/src/client/components/workspace/git-panel/branch-modal/BranchRow.tsx +4 -4
- package/src/client/components/workspace/git-panel/branch-modal/DeleteDialog.tsx +2 -2
- package/src/client/components/workspace/git-panel/index.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/Item.tsx +3 -3
- package/src/client/components/workspace/model-dropdown/Section.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/index.tsx +3 -3
- package/src/client/components/workspace/plan-panel/index.tsx +2 -2
- package/src/client/components/workspace/repo-picker/Modal.tsx +1 -1
- package/src/client/components/workspace/repo-picker/Row.tsx +6 -6
- package/src/client/components/workspace/search-panel/Body.tsx +2 -2
- package/src/client/components/workspace/search-panel/Results.tsx +1 -1
- package/src/client/components/workspace/search-panel/index.tsx +1 -1
- package/src/client/components/workspace/terminal-panel/index.tsx +1 -1
- package/src/client/components/workspace/todo-panel/PhaseGroup.tsx +1 -1
- package/src/client/components/workspace/todo-panel/index.tsx +2 -2
- package/src/client/components/workspace/user-browser-panel/AddressBar.tsx +5 -5
- package/src/client/components/workspace/user-browser-panel/AnnotateBar.test.tsx +13 -13
- package/src/client/components/workspace/user-browser-panel/AnnotateBar.tsx +4 -4
- package/src/client/components/workspace/user-browser-panel/AnnotateLayer.tsx +1 -1
- package/src/client/components/workspace/user-browser-panel/AnnotateTarget.tsx +7 -7
- package/src/client/components/workspace/user-browser-panel/Frame.tsx +1 -1
- package/src/client/components/workspace/wiki-panel/Nav.tsx +1 -1
- package/src/client/components/workspace/wiki-panel/index.tsx +2 -2
- package/src/client/glass.css +50 -0
- package/src/client/glass.test.ts +68 -24
- package/src/client/hooks/chat/composer/browser-context.test.ts +6 -6
- package/src/client/hooks/chat/composer/use-draft.test.ts +2 -2
- package/src/client/hooks/chat/omp/prompt-send.test.ts +36 -0
- package/src/client/hooks/chat/omp/prompt-send.ts +24 -18
- package/src/client/hooks/chat/omp/session-list.tsx +24 -70
- package/src/client/hooks/chat/omp/session-merges.ts +89 -0
- package/src/client/hooks/chat/omp/session-sidebar-controller.ts +4 -1
- package/src/client/hooks/chat/timeline/armed-goal-send.test.ts +168 -0
- package/src/client/hooks/chat/timeline/armed-goal.test.ts +178 -0
- package/src/client/hooks/chat/timeline/goal-command.ts +57 -27
- package/src/client/hooks/chat/timeline/index.ts +7 -4
- package/src/client/hooks/chat/timeline/mode-post.ts +46 -0
- package/src/client/hooks/chat/timeline/modes-contract.ts +94 -0
- package/src/client/hooks/chat/timeline/modes.ts +60 -95
- package/src/client/hooks/chat/timeline/send-props.ts +97 -0
- package/src/client/hooks/chat/timeline/send-steer.test.ts +6 -0
- package/src/client/hooks/chat/timeline/send.test-util.ts +55 -8
- package/src/client/hooks/chat/timeline/send.test.ts +17 -1
- package/src/client/hooks/chat/timeline/send.ts +64 -72
- package/src/client/hooks/ui/dialog-behaviour.ts +143 -0
- package/src/client/hooks/ui/theme.ts +17 -0
- package/src/client/hooks/workspace/copy-tab-path.ts +23 -0
- package/src/client/hooks/workspace/mobile-back.ts +71 -0
- package/src/client/palette-class.test.ts +93 -0
- package/src/client/tailwind-contrast.test.ts +194 -0
- package/src/client/tailwind.css +327 -8
- package/src/server/lib/assets/theme-shell.server.ts +4 -10
- package/src/server/lib/omp/config/provider-seeds.test.ts +39 -1
- package/src/server/lib/omp/config/provider-seeds.ts +32 -3
- package/src/server/lib/omp/config/provider-vision-compat.test.ts +140 -0
- package/src/server/lib/omp/core/host-resolution.test.ts +1 -55
- package/src/server/lib/omp/core/install-hint.test.ts +48 -0
- package/src/server/lib/omp/core/install-hint.ts +64 -0
- package/src/server/lib/omp/core/startup.test.ts +125 -0
- package/src/server/lib/omp/core/startup.ts +5 -1
- package/src/server/lib/omp/mode/request.ts +14 -6
- package/src/server/plugins/ssr.ts +2 -1
- package/src/shared/lib/browser/annotate.test.ts +22 -22
- package/src/shared/lib/browser/annotate.ts +14 -14
- package/src/shared/lib/browser/page-context.ts +6 -6
- package/src/shared/lib/icons/icon-paint-authority.test.ts +86 -0
- package/src/shared/lib/icons/icon-paint-authority.ts +94 -0
- package/src/shared/lib/icons/icon-paint-css.test.ts +44 -8
- package/src/shared/lib/icons/icon-paint-css.ts +18 -1
- package/src/shared/lib/icons/icon-paint-panel.ts +15 -18
- package/src/shared/lib/icons/icon-paint-weight.ts +20 -1
- package/src/shared/lib/icons/icon-tone.ts +58 -13
- package/src/shared/lib/icons/tint-hues.generated.ts +51 -6
- package/src/shared/lib/icons/tint-tones.test.ts +257 -0
- package/src/shared/lib/icons/tint.test.ts +3 -211
- package/src/shared/lib/icons/tint.ts +23 -25
- package/src/shared/lib/omp/mode/actions.ts +40 -0
- package/src/shared/lib/omp/mode/types.ts +12 -0
- package/src/shared/lib/theme/css.ts +21 -0
- package/src/shared/lib/theme/first-frame.ts +38 -0
- package/src/shared/lib/theme/ink-scale.test.ts +151 -0
- package/src/shared/lib/theme/ink-scale.ts +103 -0
- package/src/shared/lib/theme/shell-palette.test.ts +22 -5
- package/src/shared/lib/theme/shell-palette.ts +9 -4
- package/src/shared/lib/theme/theme.test.ts +28 -3
- package/src/shared/lib/workspace/project-accent.test.ts +33 -1
- package/src/shared/lib/workspace/project-accent.ts +23 -0
- package/src/shared/types/omp/agent.ts +24 -9
- package/dist/client/static/js/index-0721wrkf.css +0 -1
|
@@ -23,40 +23,18 @@
|
|
|
23
23
|
|
|
24
24
|
import { CHECKBOX_CLASS } from '@/client/components/common/checkbox/style';
|
|
25
25
|
import { useEffect, useRef, useState } from 'preact/hooks';
|
|
26
|
-
import
|
|
26
|
+
import { createPortal } from 'preact/compat';
|
|
27
27
|
import { Target, X } from 'lucide-preact';
|
|
28
|
-
import type {
|
|
29
|
-
import
|
|
28
|
+
import type { GoalAction } from '@/shared/lib/omp/mode/actions';
|
|
29
|
+
import {
|
|
30
|
+
ActionButton,
|
|
31
|
+
Stat,
|
|
32
|
+
parseBudget,
|
|
33
|
+
parseMaxTurns,
|
|
34
|
+
type GoalModalProps,
|
|
35
|
+
} from '@/client/components/workspace/chat-timeline/chat-input/goal-modal-parts';
|
|
30
36
|
|
|
31
|
-
export
|
|
32
|
-
open: boolean;
|
|
33
|
-
goal: boolean;
|
|
34
|
-
goalRecord: GoalRecord | null;
|
|
35
|
-
pending: boolean;
|
|
36
|
-
/** The default token budget a NEW goal starts with (Settings → Chats → Goal
|
|
37
|
-
* Mode). Null means no budget, which is also what an empty field means. */
|
|
38
|
-
defaultBudget?: number | null;
|
|
39
|
-
onClose: () => void;
|
|
40
|
-
onSubmit: (action: GoalAction) => void;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function parseBudget(raw: string): { value: number | 'off' } | { error: string } {
|
|
44
|
-
const trimmed = raw.trim();
|
|
45
|
-
if (!trimmed) return { value: 'off' };
|
|
46
|
-
if (trimmed === 'off') return { value: 'off' };
|
|
47
|
-
const parsed = Number.parseInt(trimmed, 10);
|
|
48
|
-
if (!Number.isInteger(parsed) || parsed <= 0) return { error: 'Budget must be a positive integer, or `off`.' };
|
|
49
|
-
return { value: parsed };
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** An empty field means "whatever this install defaults to" — not zero. */
|
|
53
|
-
function parseMaxTurns(raw: string): { value: number | 'default' } | { error: string } {
|
|
54
|
-
const trimmed = raw.trim();
|
|
55
|
-
if (!trimmed) return { value: 'default' };
|
|
56
|
-
const parsed = Number.parseInt(trimmed, 10);
|
|
57
|
-
if (!Number.isInteger(parsed) || parsed <= 0) return { error: 'Max turns must be a positive integer.' };
|
|
58
|
-
return { value: parsed };
|
|
59
|
-
}
|
|
37
|
+
export type { GoalModalProps };
|
|
60
38
|
|
|
61
39
|
export function GoalModal({ open, goal, goalRecord, pending, defaultBudget = null, onClose, onSubmit }: GoalModalProps) {
|
|
62
40
|
const [objective, setObjective] = useState('');
|
|
@@ -64,6 +42,9 @@ export function GoalModal({ open, goal, goalRecord, pending, defaultBudget = nul
|
|
|
64
42
|
const [maxTurns, setMaxTurns] = useState('');
|
|
65
43
|
const [guided, setGuided] = useState(false);
|
|
66
44
|
const [error, setError] = useState<string | null>(null);
|
|
45
|
+
/** True while the submitted command is in flight: the buttons read as busy
|
|
46
|
+
* instead of accepting a second click for the same goal. */
|
|
47
|
+
const [submitting, setSubmitting] = useState(false);
|
|
67
48
|
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
|
68
49
|
|
|
69
50
|
// A fresh open starts from a blank form: a previous objective left behind
|
|
@@ -92,10 +73,28 @@ export function GoalModal({ open, goal, goalRecord, pending, defaultBudget = nul
|
|
|
92
73
|
|
|
93
74
|
if (!open) return null;
|
|
94
75
|
|
|
95
|
-
|
|
76
|
+
// One submit path for every action: await the outcome, close only on success.
|
|
77
|
+
// A refusal leaves the form (and whatever was typed) exactly where it was, with
|
|
78
|
+
// the reason under the fields — the previous version closed first and then
|
|
79
|
+
// dropped the objective, which is what made a refusal read as a dead button.
|
|
80
|
+
const busy = pending || submitting;
|
|
81
|
+
const submit = async (action: GoalAction): Promise<void> => {
|
|
82
|
+
setError(null);
|
|
83
|
+
setSubmitting(true);
|
|
84
|
+
try {
|
|
85
|
+
const result = await onSubmit(action);
|
|
86
|
+
if (result.ok) onClose();
|
|
87
|
+
else setError(result.error ?? 'The goal command was refused.');
|
|
88
|
+
} catch (err) {
|
|
89
|
+
setError(err instanceof Error ? err.message : 'The goal command was refused.');
|
|
90
|
+
} finally {
|
|
91
|
+
setSubmitting(false);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const submitCreate = (): void => {
|
|
96
96
|
if (guided) {
|
|
97
|
-
|
|
98
|
-
onClose();
|
|
97
|
+
void submit({ kind: 'guided', rough: objective.trim() });
|
|
99
98
|
return;
|
|
100
99
|
}
|
|
101
100
|
if (!objective.trim()) {
|
|
@@ -112,16 +111,32 @@ export function GoalModal({ open, goal, goalRecord, pending, defaultBudget = nul
|
|
|
112
111
|
setError(turns.error);
|
|
113
112
|
return;
|
|
114
113
|
}
|
|
115
|
-
|
|
114
|
+
void submit({
|
|
116
115
|
kind: 'create',
|
|
117
116
|
objective: objective.trim(),
|
|
118
117
|
...(parsed.value === 'off' ? {} : { tokenBudget: parsed.value }),
|
|
119
118
|
...(turns.value === 'default' ? {} : { maxTurns: turns.value }),
|
|
120
119
|
});
|
|
121
|
-
onClose();
|
|
122
120
|
};
|
|
123
121
|
|
|
124
|
-
|
|
122
|
+
// PORTALLED to `<body>`, and that is what centres it.
|
|
123
|
+
//
|
|
124
|
+
// The modal is mounted from the composer's `header` slot, and a `fixed`
|
|
125
|
+
// element is contained by any ancestor that is a containing block. Measured
|
|
126
|
+
// in Chromium at 1440x900 by re-parenting the real scrim into the composer
|
|
127
|
+
// card: the scrim went from `1440x900` at `(0,0)` — the viewport — to
|
|
128
|
+
// `710x164` at the CARD's box, i.e. exactly the `@container` composer, and the
|
|
129
|
+
// dialog centred on it (dx -49, dy +38). Reproduced by any of the three
|
|
130
|
+
// properties the composer can carry: `backdrop-filter` (the `glass` style's
|
|
131
|
+
// `--glass-card-filter`), a `transform`, or `contain: layout`. `container-type`
|
|
132
|
+
// alone did NOT trigger it, so an earlier note here blaming containment was
|
|
133
|
+
// wrong.
|
|
134
|
+
//
|
|
135
|
+
// The effect is what the operator sees as "the goal modal opens in front of
|
|
136
|
+
// the composer" instead of the middle of the screen. A portal escapes every
|
|
137
|
+
// such ancestor; the same reason `Toast`, `anchored-menu` and `diagram-viewer`
|
|
138
|
+
// portal.
|
|
139
|
+
return createPortal(
|
|
125
140
|
<div className="fixed inset-0 z-[60] flex items-center justify-center modal-scrim p-4" onClick={onClose}>
|
|
126
141
|
<div
|
|
127
142
|
className="glass-overlay w-full max-w-lg overflow-hidden rounded-xl border border-ink/15 bg-paper shadow-xl"
|
|
@@ -163,11 +178,11 @@ export function GoalModal({ open, goal, goalRecord, pending, defaultBudget = nul
|
|
|
163
178
|
{error && <div className="text-error">{error}</div>}
|
|
164
179
|
<div className="flex flex-wrap items-center gap-2 pt-1">
|
|
165
180
|
{goalRecord.status === 'paused' ? (
|
|
166
|
-
<ActionButton onClick={() =>
|
|
181
|
+
<ActionButton onClick={() => void submit({ kind: 'resume' })} disabled={busy}>
|
|
167
182
|
Resume
|
|
168
183
|
</ActionButton>
|
|
169
184
|
) : (
|
|
170
|
-
<ActionButton onClick={() =>
|
|
185
|
+
<ActionButton onClick={() => void submit({ kind: 'pause' })} disabled={busy}>
|
|
171
186
|
Pause
|
|
172
187
|
</ActionButton>
|
|
173
188
|
)}
|
|
@@ -178,10 +193,9 @@ export function GoalModal({ open, goal, goalRecord, pending, defaultBudget = nul
|
|
|
178
193
|
setError(parsed.error);
|
|
179
194
|
return;
|
|
180
195
|
}
|
|
181
|
-
|
|
182
|
-
onClose();
|
|
196
|
+
void submit({ kind: 'budget', value: parsed.value });
|
|
183
197
|
}}
|
|
184
|
-
disabled={
|
|
198
|
+
disabled={busy}
|
|
185
199
|
>
|
|
186
200
|
Set budget
|
|
187
201
|
</ActionButton>
|
|
@@ -193,8 +207,8 @@ export function GoalModal({ open, goal, goalRecord, pending, defaultBudget = nul
|
|
|
193
207
|
/>
|
|
194
208
|
<button
|
|
195
209
|
type="button"
|
|
196
|
-
onClick={() =>
|
|
197
|
-
disabled={
|
|
210
|
+
onClick={() => void submit({ kind: 'drop' })}
|
|
211
|
+
disabled={busy}
|
|
198
212
|
className="ml-auto rounded border border-error/40 px-3 py-1.5 text-[11px] text-error transition-colors hover:bg-error/10 disabled:opacity-50"
|
|
199
213
|
>
|
|
200
214
|
Drop goal
|
|
@@ -219,15 +233,19 @@ export function GoalModal({ open, goal, goalRecord, pending, defaultBudget = nul
|
|
|
219
233
|
Name the deliverables, the evidence of completion, and any prohibited shortcuts.
|
|
220
234
|
</p>
|
|
221
235
|
</div>
|
|
236
|
+
{/* `min-w-0` on both halves: a flex item defaults to
|
|
237
|
+
`min-width: auto`, so the two fields kept their intrinsic input
|
|
238
|
+
width and overflowed a phone's 358px card (measured: "auto: this
|
|
239
|
+
install'" and "2000" clipped mid-word). */}
|
|
222
240
|
<div className="flex items-end gap-3">
|
|
223
|
-
<div className="flex-1">
|
|
241
|
+
<div className="min-w-0 flex-1">
|
|
224
242
|
<label className="mb-1 block text-[10px] font-semibold uppercase tracking-wider text-ink/45">
|
|
225
243
|
Token budget
|
|
226
244
|
</label>
|
|
227
245
|
<input
|
|
228
246
|
value={budget}
|
|
229
247
|
onChange={(event) => setBudget(event.currentTarget.value)}
|
|
230
|
-
placeholder="
|
|
248
|
+
placeholder="e.g. 200000"
|
|
231
249
|
aria-label="Token budget"
|
|
232
250
|
className="w-full rounded-lg border border-ink/15 bg-paper px-3 py-1.5 font-mono text-[11.5px] outline-none focus:border-ink"
|
|
233
251
|
/>
|
|
@@ -237,14 +255,14 @@ export function GoalModal({ open, goal, goalRecord, pending, defaultBudget = nul
|
|
|
237
255
|
</p>
|
|
238
256
|
)}
|
|
239
257
|
</div>
|
|
240
|
-
<div className="flex-1">
|
|
258
|
+
<div className="min-w-0 flex-1">
|
|
241
259
|
<label className="mb-1 block text-[10px] font-semibold uppercase tracking-wider text-ink/45">
|
|
242
260
|
Max turns
|
|
243
261
|
</label>
|
|
244
262
|
<input
|
|
245
263
|
value={maxTurns}
|
|
246
264
|
onChange={(event) => setMaxTurns(event.currentTarget.value)}
|
|
247
|
-
placeholder="
|
|
265
|
+
placeholder="install default"
|
|
248
266
|
inputMode="numeric"
|
|
249
267
|
aria-label="Max automatic turns"
|
|
250
268
|
className="w-full rounded-lg border border-ink/15 bg-paper px-3 py-1.5 font-mono text-[11.5px] outline-none focus:border-ink"
|
|
@@ -277,7 +295,7 @@ export function GoalModal({ open, goal, goalRecord, pending, defaultBudget = nul
|
|
|
277
295
|
<button
|
|
278
296
|
type="button"
|
|
279
297
|
onClick={submitCreate}
|
|
280
|
-
disabled={
|
|
298
|
+
disabled={busy}
|
|
281
299
|
className="rounded bg-ink px-3 py-1.5 text-[11.5px] text-canvas transition-colors hover:bg-ink/80 disabled:opacity-50"
|
|
282
300
|
>
|
|
283
301
|
{guided ? 'Start interview' : 'Start goal'}
|
|
@@ -286,36 +304,7 @@ export function GoalModal({ open, goal, goalRecord, pending, defaultBudget = nul
|
|
|
286
304
|
</div>
|
|
287
305
|
)}
|
|
288
306
|
</div>
|
|
289
|
-
</div
|
|
290
|
-
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
function Stat({ label, value }: { label: string; value: string }) {
|
|
294
|
-
return (
|
|
295
|
-
<div className="rounded-lg border border-ink/10 bg-canvas/30 p-2">
|
|
296
|
-
<div className="text-[9.5px] font-semibold uppercase tracking-wider text-ink/40">{label}</div>
|
|
297
|
-
<div className="mt-0.5 truncate font-mono text-[11.5px] text-ink">{value}</div>
|
|
298
|
-
</div>
|
|
299
|
-
);
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
function ActionButton({
|
|
303
|
-
children,
|
|
304
|
-
onClick,
|
|
305
|
-
disabled,
|
|
306
|
-
}: {
|
|
307
|
-
children: ComponentChildren;
|
|
308
|
-
onClick: () => void;
|
|
309
|
-
disabled?: boolean;
|
|
310
|
-
}) {
|
|
311
|
-
return (
|
|
312
|
-
<button
|
|
313
|
-
type="button"
|
|
314
|
-
onClick={onClick}
|
|
315
|
-
disabled={disabled}
|
|
316
|
-
className="rounded border border-ink/20 px-3 py-1.5 text-[11px] text-ink transition-colors hover:bg-ink/5 disabled:opacity-50"
|
|
317
|
-
>
|
|
318
|
-
{children}
|
|
319
|
-
</button>
|
|
307
|
+
</div>,
|
|
308
|
+
document.body,
|
|
320
309
|
);
|
|
321
310
|
}
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* is its other trigger.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
+
import { ArmedGoalStrip } from '@/client/components/workspace/chat-timeline/chat-input/ArmedGoalStrip';
|
|
20
21
|
import { GoalBanner } from '@/client/components/workspace/chat-timeline/chat-input/GoalBanner';
|
|
21
22
|
import { GoalModal } from '@/client/components/workspace/chat-timeline/chat-input/GoalModal';
|
|
22
23
|
import type { ComposerModes } from '@/client/components/workspace/chat-timeline/chat-input/modes-props';
|
|
@@ -50,11 +51,19 @@ export function GoalSurfaces({ modes, running, open, defaultBudget, onOpen, onCl
|
|
|
50
51
|
/>
|
|
51
52
|
)}
|
|
52
53
|
|
|
54
|
+
{/* An armed goal has no record yet, so the banner cannot draw it; the
|
|
55
|
+
button alone would read "on" over nothing running. */}
|
|
56
|
+
{modes.goalArm && (
|
|
57
|
+
<ArmedGoalStrip goal={modes.goalArm} onDisarm={modes.disarmGoal} />
|
|
58
|
+
)}
|
|
59
|
+
|
|
53
60
|
<GoalModal
|
|
54
61
|
open={open}
|
|
55
62
|
// Manage view whenever a goal the chat still owns exists — the create
|
|
56
63
|
// form would otherwise offer to start a second goal over a PAUSED one,
|
|
57
|
-
// with Resume/Drop/budget unreachable.
|
|
64
|
+
// with Resume/Drop/budget unreachable. An ARMED goal shows the create
|
|
65
|
+
// form again: pressing Goal is how it is re-armed (its objective and
|
|
66
|
+
// limits replace the waiting one).
|
|
58
67
|
goal={modes.goalOpen}
|
|
59
68
|
goalRecord={modes.goalRecord}
|
|
60
69
|
defaultBudget={defaultBudget}
|
|
@@ -53,6 +53,7 @@ function paint(overrides: Partial<ModeTogglesProps> = {}): HTMLElement {
|
|
|
53
53
|
const props: ModeTogglesProps = {
|
|
54
54
|
plan: false,
|
|
55
55
|
goal: false,
|
|
56
|
+
goalArm: null,
|
|
56
57
|
goalRecord: null,
|
|
57
58
|
pending: false,
|
|
58
59
|
onTogglePlan: () => {},
|
|
@@ -101,3 +102,22 @@ describe('ModeToggles', () => {
|
|
|
101
102
|
expect(el.textContent).not.toContain('left');
|
|
102
103
|
});
|
|
103
104
|
});
|
|
105
|
+
|
|
106
|
+
describe('an armed goal', () => {
|
|
107
|
+
test('reads as set but not running, and says what starts it', () => {
|
|
108
|
+
const el = paint({ goalArm: { kind: 'create', objective: 'Ship the importer' } });
|
|
109
|
+
const button = el.querySelector('[aria-label="Edit the armed goal"]') as HTMLButtonElement | null;
|
|
110
|
+
|
|
111
|
+
expect(button).not.toBeNull();
|
|
112
|
+
// Pressed, because it IS set — but the label and the title both name the
|
|
113
|
+
// waiting state, so "on" never claims work that has not started.
|
|
114
|
+
expect(button?.getAttribute('aria-pressed')).toBe('true');
|
|
115
|
+
expect(button?.title).toContain('starts with your next message');
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
test('a running goal keeps the running wording', () => {
|
|
119
|
+
const el = paint({ goal: true, goalRecord: goalRecord });
|
|
120
|
+
expect(el.querySelector('[aria-label="Manage the active goal"]')).not.toBeNull();
|
|
121
|
+
expect(el.querySelector('[aria-label="Edit the armed goal"]')).toBeNull();
|
|
122
|
+
});
|
|
123
|
+
});
|
|
@@ -29,10 +29,13 @@
|
|
|
29
29
|
|
|
30
30
|
import { ClipboardList, Target } from 'lucide-preact';
|
|
31
31
|
import type { GoalRecord } from '@/shared/lib/omp/mode/types';
|
|
32
|
+
import type { ArmedGoal } from '@/shared/lib/omp/mode/actions';
|
|
32
33
|
|
|
33
34
|
export interface ModeTogglesProps {
|
|
34
35
|
plan: boolean;
|
|
35
36
|
goal: boolean;
|
|
37
|
+
/** A goal set but not started: the next message is its first turn. */
|
|
38
|
+
goalArm: ArmedGoal | null;
|
|
36
39
|
goalRecord: GoalRecord | null;
|
|
37
40
|
/** A mode command is in flight; the buttons stay responsive but read as
|
|
38
41
|
* pending so a slow child cannot look like a dead button. */
|
|
@@ -60,6 +63,7 @@ function goalTitle(goal: boolean, record: GoalRecord | null): string {
|
|
|
60
63
|
export function ModeToggles({
|
|
61
64
|
plan,
|
|
62
65
|
goal,
|
|
66
|
+
goalArm,
|
|
63
67
|
goalRecord,
|
|
64
68
|
pending,
|
|
65
69
|
onTogglePlan,
|
|
@@ -75,8 +79,8 @@ export function ModeToggles({
|
|
|
75
79
|
aria-pressed={plan}
|
|
76
80
|
aria-label={plan ? 'Leave plan mode' : 'Enter plan mode'}
|
|
77
81
|
title={plan ? 'Plan mode is on — the agent explores before editing' : 'Plan mode: explore and draft before any edit'}
|
|
78
|
-
className={`flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors cursor-pointer ${
|
|
79
|
-
plan ? 'bg-ink text-canvas' : 'text-
|
|
82
|
+
className={`tap-chip flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors cursor-pointer ${
|
|
83
|
+
plan ? 'bg-ink text-canvas' : 'text-muted hover:bg-ink/5'
|
|
80
84
|
} ${pending ? 'opacity-60' : ''}`}
|
|
81
85
|
>
|
|
82
86
|
<ClipboardList size={12} className={plan ? '' : 'text-ink/60'} />
|
|
@@ -84,14 +88,16 @@ export function ModeToggles({
|
|
|
84
88
|
</button>
|
|
85
89
|
)}
|
|
86
90
|
|
|
91
|
+
{/* An ARMED goal is not a running one: the button names it as waiting,
|
|
92
|
+
so "on" never claims work that has not started. */}
|
|
87
93
|
<button
|
|
88
94
|
type="button"
|
|
89
95
|
onClick={onOpenGoal}
|
|
90
|
-
aria-pressed={goal}
|
|
91
|
-
aria-label={goal ? 'Manage the active goal' : 'Set a goal'}
|
|
92
|
-
title={goalTitle(goal, goalRecord)}
|
|
93
|
-
className={`flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors cursor-pointer ${
|
|
94
|
-
goal ? 'bg-ink text-canvas' : '
|
|
96
|
+
aria-pressed={goal || Boolean(goalArm)}
|
|
97
|
+
aria-label={goalArm ? 'Edit the armed goal' : goal ? 'Manage the active goal' : 'Set a goal'}
|
|
98
|
+
title={goalArm ? 'Goal armed: it starts with your next message' : goalTitle(goal, goalRecord)}
|
|
99
|
+
className={`tap-chip flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors cursor-pointer ${
|
|
100
|
+
goal ? 'bg-ink text-canvas' : goalArm ? 'border border-dashed border-ink/30 text-muted' : 'text-muted hover:bg-ink/5'
|
|
95
101
|
} ${pending ? 'opacity-60' : ''}`}
|
|
96
102
|
>
|
|
97
103
|
<Target size={12} className={goal ? '' : 'text-ink/60'} />
|
|
@@ -23,7 +23,7 @@ export function ThinkingLevelDropdown({ thinkingLevels, currentThinking, onSelec
|
|
|
23
23
|
<button
|
|
24
24
|
onClick={() => thinkingLevels.length > 0 && setShowThinking(!showThinking)}
|
|
25
25
|
disabled={thinkingLevels.length === 0}
|
|
26
|
-
className="flex items-center space-x-1 hover:bg-ink/5 px-2 py-1 rounded transition-colors text-xs text-
|
|
26
|
+
className="tap-chip flex items-center space-x-1 hover:bg-ink/5 px-2 py-1 rounded transition-colors text-xs text-muted disabled:opacity-40 disabled:cursor-not-allowed"
|
|
27
27
|
title={thinkingLevels.length === 0 ? 'This model exposes no thinking levels' : `Thinking Level: ${currentThinking}`}
|
|
28
28
|
>
|
|
29
29
|
<Brain size={12} className="text-ink/60" />
|
|
@@ -57,6 +57,8 @@ interface MountOptions {
|
|
|
57
57
|
onStop?: () => void;
|
|
58
58
|
/** Renders the Plan/Goal group when supplied. */
|
|
59
59
|
withModes?: boolean;
|
|
60
|
+
/** Blocks the send control, as an empty draft does. */
|
|
61
|
+
sendDisabled?: boolean;
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
const MODES = {
|
|
@@ -66,16 +68,18 @@ const MODES = {
|
|
|
66
68
|
goalRecord: null,
|
|
67
69
|
goalContinuation: null,
|
|
68
70
|
goalEvaluating: false,
|
|
71
|
+
goalArm: null,
|
|
72
|
+
disarmGoal: () => {},
|
|
69
73
|
pending: false,
|
|
70
74
|
planAvailable: true,
|
|
71
75
|
error: null,
|
|
72
76
|
clearError: () => {},
|
|
73
77
|
onTogglePlan: () => {},
|
|
74
|
-
onGoalAction: () => {},
|
|
78
|
+
onGoalAction: async () => ({ ok: true }),
|
|
75
79
|
};
|
|
76
80
|
|
|
77
81
|
/** The selectors are off: this file is about the right-hand action strip. */
|
|
78
|
-
async function mount({ isGenerating, chatRunning, isMobile = false, onStop, withModes = false }: MountOptions): Promise<HTMLElement> {
|
|
82
|
+
async function mount({ isGenerating, chatRunning, isMobile = false, onStop, withModes = false, sendDisabled = false }: MountOptions): Promise<HTMLElement> {
|
|
79
83
|
container = document.createElement('div');
|
|
80
84
|
document.body.appendChild(container);
|
|
81
85
|
await act(async () => {
|
|
@@ -91,7 +95,7 @@ async function mount({ isGenerating, chatRunning, isMobile = false, onStop, with
|
|
|
91
95
|
chatRunning,
|
|
92
96
|
onStop,
|
|
93
97
|
onSend: () => {},
|
|
94
|
-
sendDisabled
|
|
98
|
+
sendDisabled,
|
|
95
99
|
showModel: false,
|
|
96
100
|
showThinking: false,
|
|
97
101
|
showAccess: withModes,
|
|
@@ -128,6 +132,64 @@ describe('composer toolbar Stop', () => {
|
|
|
128
132
|
});
|
|
129
133
|
});
|
|
130
134
|
|
|
135
|
+
/**
|
|
136
|
+
* The action pair's contract, as the UI states it: one geometry for both
|
|
137
|
+
* controls, an accessible name on each, and a disabled send that still reports
|
|
138
|
+
* what it is. None of this is cosmetic — the pair had no `focus-visible`
|
|
139
|
+
* treatment at all and the square relied on `title` alone for its name, which
|
|
140
|
+
* is not a reliable accessible name across screen readers.
|
|
141
|
+
*/
|
|
142
|
+
describe('composer toolbar action pair', () => {
|
|
143
|
+
const send = '[aria-label="Send message"], [aria-label="Queue follow-up message"]';
|
|
144
|
+
|
|
145
|
+
test('names Stop for assistive tech, not only for a tooltip', async () => {
|
|
146
|
+
const el = await mount({ isGenerating: true });
|
|
147
|
+
const stop = el.querySelector(stops) as HTMLButtonElement;
|
|
148
|
+
expect(stop.getAttribute('aria-label')).toBe('Stop generation');
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
test('gives both controls the same box on a desktop', async () => {
|
|
152
|
+
const el = await mount({ isGenerating: true, onStop: () => {} });
|
|
153
|
+
const stop = el.querySelector(stops) as HTMLButtonElement;
|
|
154
|
+
const submit = el.querySelector(send) as HTMLButtonElement;
|
|
155
|
+
for (const box of ['w-7', 'h-7', 'rounded-lg']) {
|
|
156
|
+
expect(stop.className.split(/\s+/)).toContain(box);
|
|
157
|
+
expect(submit.className.split(/\s+/)).toContain(box);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
test('gives both controls the same box on a phone', async () => {
|
|
162
|
+
const el = await mount({ isGenerating: true, isMobile: true, onStop: () => {} });
|
|
163
|
+
const stop = el.querySelector(stops) as HTMLButtonElement;
|
|
164
|
+
const submit = el.querySelector(send) as HTMLButtonElement;
|
|
165
|
+
for (const box of ['w-8', 'h-8', 'rounded-lg']) {
|
|
166
|
+
expect(stop.className.split(/\s+/)).toContain(box);
|
|
167
|
+
expect(submit.className.split(/\s+/)).toContain(box);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
test('keeps Send usable and labelled while nothing is typed', async () => {
|
|
172
|
+
const el = await mount({ isGenerating: false });
|
|
173
|
+
const submit = el.querySelector(send) as HTMLButtonElement;
|
|
174
|
+
expect(submit.disabled).toBe(false);
|
|
175
|
+
expect(submit.getAttribute('title')).toBe('Send message');
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
test('states the queue action once a run is in flight', async () => {
|
|
179
|
+
const el = await mount({ isGenerating: false, chatRunning: true });
|
|
180
|
+
const submit = el.querySelector('[aria-label="Queue follow-up message"]') as HTMLButtonElement;
|
|
181
|
+
expect(submit).not.toBeNull();
|
|
182
|
+
expect(submit.disabled).toBe(false);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
test('renders a disabled Send as disabled, with no hover lift', async () => {
|
|
186
|
+
const el = await mount({ isGenerating: false, sendDisabled: true });
|
|
187
|
+
const submit = el.querySelector(send) as HTMLButtonElement;
|
|
188
|
+
expect(submit.disabled).toBe(true);
|
|
189
|
+
expect(submit.className).toContain('disabled:hover:bg-ink');
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
|
|
131
193
|
/**
|
|
132
194
|
* Where the Plan/Goal group is drawn. The bottom row is a single line whose
|
|
133
195
|
* left cluster already fills it on a 320px phone, so a third group there
|
|
@@ -55,6 +55,34 @@ export interface ComposerToolbarProps {
|
|
|
55
55
|
text?: string;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* The chat's two ACTION controls, one geometry.
|
|
60
|
+
*
|
|
61
|
+
* They used to state their own boxes: `rounded` on send (4px, below DESIGN.md
|
|
62
|
+
* §5's 6-8px control radius) and `rounded-md` on a phone's stop, so the pair
|
|
63
|
+
* disagreed on radius and only agreed on size by coincidence. Both are 28px on
|
|
64
|
+
* a desktop and 32px on a phone, from ONE pair of classes below, so a future
|
|
65
|
+
* size change cannot land on one control and miss the other.
|
|
66
|
+
*
|
|
67
|
+
* `focus-visible` is not decoration: the send and stop controls had no focus
|
|
68
|
+
* treatment at all, so the two controls that start and end a turn were the only
|
|
69
|
+
* interactive elements in the composer a keyboard user could not see. The ring
|
|
70
|
+
* is ink at 50%, not the `/20`-`/30` the timeline cards use: WCAG 1.4.11 wants
|
|
71
|
+
* 3:1 for a focus indicator, and on `paper` the ramp measures `/30` 1.97, `/45`
|
|
72
|
+
* 2.96 and `/50` 3.43. It is offset by 2px of the card's own paper so it reads
|
|
73
|
+
* as a halo on the filled send button too. The voice control shares this base
|
|
74
|
+
* because it is the third member of the same cluster.
|
|
75
|
+
*
|
|
76
|
+
* The transition is Tailwind's own `transition` (colour, background, border,
|
|
77
|
+
* box-shadow, transform), not a hand-listed property set: those are the five
|
|
78
|
+
* things this button changes, and they are the default for a reason.
|
|
79
|
+
*/
|
|
80
|
+
const ACTION_BASE =
|
|
81
|
+
'tap-target flex items-center justify-center rounded-lg flex-shrink-0 cursor-pointer ' +
|
|
82
|
+
'transition duration-150 ' +
|
|
83
|
+
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ink/50 ' +
|
|
84
|
+
'focus-visible:ring-offset-2 focus-visible:ring-offset-paper active:scale-95';
|
|
85
|
+
|
|
58
86
|
/**
|
|
59
87
|
* Bottom config row of the composer: model + thinking + access + plan/goal
|
|
60
88
|
* selectors on the left, Stop/Send on the right.
|
|
@@ -96,6 +124,11 @@ export function ComposerToolbar({
|
|
|
96
124
|
}: ComposerToolbarProps) {
|
|
97
125
|
const chatInFlight = chatRunning ?? isGenerating;
|
|
98
126
|
const showStop = chatInFlight && (isMobile ? Boolean(onStop) : true);
|
|
127
|
+
// The pair's box, and its glyph, from the one layout flag: 32px on a phone
|
|
128
|
+
// (the touch floor's real geometry) and 28px on the desktop toolbar the
|
|
129
|
+
// comment above measured.
|
|
130
|
+
const actionSize = isMobile ? 'w-8 h-8' : 'w-7 h-7';
|
|
131
|
+
const iconSize = isMobile ? 14 : 12;
|
|
99
132
|
|
|
100
133
|
return (
|
|
101
134
|
<div
|
|
@@ -143,6 +176,7 @@ export function ComposerToolbar({
|
|
|
143
176
|
<ModeToggles
|
|
144
177
|
plan={modes.plan}
|
|
145
178
|
goal={modes.goalOpen}
|
|
179
|
+
goalArm={modes.goalArm}
|
|
146
180
|
goalRecord={modes.goalRecord}
|
|
147
181
|
pending={modes.pending}
|
|
148
182
|
onTogglePlan={modes.onTogglePlan}
|
|
@@ -158,20 +192,21 @@ export function ComposerToolbar({
|
|
|
158
192
|
order. An empty slot renders nothing, so this row is unchanged. */}
|
|
159
193
|
<PluginComposerActions text={text} isSubmitting={chatInFlight} />
|
|
160
194
|
{/* Voice input — only when the browser can capture audio. Idle ▸ mic,
|
|
161
|
-
recording ▸ pulsing red mic-off, transcribing ▸ spinner.
|
|
195
|
+
recording ▸ pulsing red mic-off, transcribing ▸ spinner. It shares
|
|
196
|
+
the action pair's geometry: it is the third control of one cluster,
|
|
197
|
+
and a 4px radius beside two 8px ones was the same class of drift
|
|
198
|
+
this file's `ACTION_BASE` exists to stop. */}
|
|
162
199
|
{voiceSupported && (
|
|
163
200
|
<button
|
|
164
201
|
type="button"
|
|
165
202
|
onClick={onVoiceToggle}
|
|
166
203
|
disabled={voiceBusy}
|
|
167
|
-
className={
|
|
204
|
+
className={`${ACTION_BASE} ${actionSize} ${
|
|
168
205
|
voiceBusy
|
|
169
206
|
? 'text-ink/40 cursor-wait'
|
|
170
207
|
: voiceListening
|
|
171
|
-
? 'bg-error text-canvas animate-pulse shadow-xs
|
|
172
|
-
: 'text-ink/50 hover:text-ink hover:bg-ink/10
|
|
173
|
-
} ${
|
|
174
|
-
isMobile ? 'w-8 h-8 rounded-md' : 'w-7 h-7'
|
|
208
|
+
? 'bg-error text-canvas animate-pulse shadow-xs'
|
|
209
|
+
: 'text-ink/50 hover:text-ink hover:bg-ink/10'
|
|
175
210
|
}`}
|
|
176
211
|
title={
|
|
177
212
|
voiceBusy
|
|
@@ -182,41 +217,56 @@ export function ComposerToolbar({
|
|
|
182
217
|
}
|
|
183
218
|
>
|
|
184
219
|
{voiceBusy ? (
|
|
185
|
-
<Loader2 size={
|
|
220
|
+
<Loader2 size={iconSize} className="animate-spin" />
|
|
186
221
|
) : voiceListening ? (
|
|
187
|
-
<MicOff size={
|
|
222
|
+
<MicOff size={iconSize} />
|
|
188
223
|
) : (
|
|
189
|
-
<Mic size={
|
|
224
|
+
<Mic size={iconSize} />
|
|
190
225
|
)}
|
|
191
226
|
</button>
|
|
192
227
|
)}
|
|
193
228
|
|
|
229
|
+
{/* Stop is the SECONDARY of the pair while a run is in flight: an
|
|
230
|
+
outline on the card's own surface, so it sits beside the filled
|
|
231
|
+
send without a second black block claiming equal weight. No shadow:
|
|
232
|
+
elevation is rarity (`DESIGN.md` §5), and the one control that must
|
|
233
|
+
read as primary in this row is Send.
|
|
234
|
+
Its hover is a red TINT rather than the solid `bg-error` it used to
|
|
235
|
+
switch to: a solid signal fill makes the glyph take the fill's own
|
|
236
|
+
colour (see `solidSignalFillRules`), and in the colour icon mode the
|
|
237
|
+
square then measured **1.27:1** against `#c8321e`. On a 10% tint the
|
|
238
|
+
ink-mode square reads 17.5:1 and the colour-mode one 3.4:1.
|
|
239
|
+
The entrance animation this used to carry was `animate-in
|
|
240
|
+
zoom-in-90`, which no build has ever emitted (no animate plugin in
|
|
241
|
+
the bundle): it was a dead class, and the composer's motion is
|
|
242
|
+
reserved for live state anyway. */}
|
|
194
243
|
{showStop && (
|
|
195
244
|
<button
|
|
196
245
|
type="button"
|
|
197
246
|
onClick={onStop}
|
|
198
|
-
className={
|
|
199
|
-
isMobile
|
|
200
|
-
? 'w-8 h-8 rounded-md border border-ink/25 text-ink hover:bg-error hover:text-canvas hover:border-error'
|
|
201
|
-
: 'w-7 h-7 bg-ink text-canvas hover:bg-error hover:text-canvas'
|
|
202
|
-
}`}
|
|
247
|
+
className={`${ACTION_BASE} ${actionSize} border border-ink/25 text-ink hover:border-error/50 hover:bg-error/10 hover:text-error`}
|
|
203
248
|
title="Stop generation"
|
|
249
|
+
aria-label="Stop generation"
|
|
204
250
|
>
|
|
205
|
-
<Square size={
|
|
251
|
+
<Square size={iconSize} className="fill-current" />
|
|
206
252
|
</button>
|
|
207
253
|
)}
|
|
208
254
|
|
|
255
|
+
{/* Send is the primary: the only filled control in the row, and the
|
|
256
|
+
one that must stay findable at rest. A one-pixel lift on hover and
|
|
257
|
+
a press-scale are the whole state language; the disabled state is
|
|
258
|
+
the house pair (`bg-ink` at 40% opacity, no shadow) rather than a
|
|
259
|
+
washed-out fill, because a lighter FILL moves the glyph off the
|
|
260
|
+
inverted-surface rule and into the icon mode's own hue. */}
|
|
209
261
|
<button
|
|
210
262
|
type="button"
|
|
211
263
|
onClick={onSend}
|
|
212
264
|
disabled={sendDisabled}
|
|
213
|
-
className={
|
|
214
|
-
isMobile ? 'w-8 h-8 rounded-md' : 'w-7 h-7'
|
|
215
|
-
}`}
|
|
265
|
+
className={`${ACTION_BASE} ${actionSize} bg-ink text-canvas shadow-xs hover:bg-ink/85 hover:shadow-sm disabled:opacity-40 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-ink`}
|
|
216
266
|
title={chatInFlight ? 'Queue follow-up message' : 'Send message'}
|
|
217
267
|
aria-label={chatInFlight ? 'Queue follow-up message' : 'Send message'}
|
|
218
268
|
>
|
|
219
|
-
<Send size={
|
|
269
|
+
<Send size={iconSize} className="ml-px" />
|
|
220
270
|
</button>
|
|
221
271
|
</div>
|
|
222
272
|
</div>
|
package/src/client/components/workspace/chat-timeline/chat-input/WaitingDependencyPicker.tsx
CHANGED
|
@@ -112,7 +112,7 @@ export function WaitingDependencyPicker({
|
|
|
112
112
|
title={unavailable && !value ? 'No session is running right now' : 'Wait for another session to finish'}
|
|
113
113
|
aria-label={value ? `Waiting for ${value.title}` : 'Wait for session'}
|
|
114
114
|
aria-expanded={open}
|
|
115
|
-
className={`group flex items-center gap-1.5 rounded-md px-1.5 py-1 text-xs font-medium transition-all
|
|
115
|
+
className={`tap-chip group flex items-center gap-1.5 rounded-md px-1.5 py-1 text-xs font-medium transition-all focus-visible:bg-ink/5 cursor-pointer select-none disabled:cursor-not-allowed disabled:opacity-50 ${
|
|
116
116
|
value ? 'bg-ink/10 text-ink' : 'text-ink/75 hover:text-ink hover:bg-ink/5'
|
|
117
117
|
}`}
|
|
118
118
|
>
|
|
@@ -162,7 +162,7 @@ export function WaitingDependencyPicker({
|
|
|
162
162
|
setOpen(false);
|
|
163
163
|
}}
|
|
164
164
|
className={`w-full text-left px-3 py-1.5 flex items-center justify-between transition-colors cursor-pointer ${
|
|
165
|
-
selected ? 'bg-ink/10 text-ink font-semibold' : 'text-
|
|
165
|
+
selected ? 'bg-ink/10 text-ink font-semibold' : 'text-muted hover:bg-ink/5 hover:text-ink'
|
|
166
166
|
}`}
|
|
167
167
|
>
|
|
168
168
|
<span className="flex items-center gap-2 truncate pr-2">
|