@kabmo-labs/kabmo 0.18.0 → 0.21.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 +43 -13
- package/dist/client/index.html +3 -3
- package/dist/client/index.js +485 -484
- package/dist/client/static/js/index-0721wrkf.css +1 -0
- package/dist/client/static/js/{index-tc09dtca.js → index-zg32n2sk.js} +778 -777
- package/dist/client/static/{manifest-42r8wcmg.webmanifest → manifest-q6h8k9e0.webmanifest} +1 -1
- package/index.html +1 -1
- 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/public/manifest.webmanifest +1 -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/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.tsx +5 -1
- 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 +142 -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 +1 -1
- package/src/client/components/common/panel-mark/index.test.tsx +124 -0
- package/src/client/components/common/panel-mark/index.tsx +105 -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/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 +3 -3
- 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/index.tsx +2 -2
- package/src/client/components/layout/session-sidebar/modern/ActionRow.tsx +1 -1
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +13 -5
- 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/mobile/LayoutWrapper.tsx +3 -1
- package/src/client/components/mobile/mobile-main-view/Header.tsx +2 -2
- package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +1 -1
- 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/apply-side-effects.test.ts +30 -0
- package/src/client/components/settings/apply-side-effects.ts +14 -0
- package/src/client/components/settings/categories/AppearanceSettings.tsx +6 -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/mcp-settings/DetailPane.tsx +2 -1
- package/src/client/components/settings/categories/mcp-settings/ImportModal.tsx +2 -2
- package/src/client/components/settings/categories/omp-settings/OrderedChips.tsx +1 -1
- 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/GitFreshness.test.tsx +46 -0
- package/src/client/components/settings/categories/panel-plugins/GitFreshness.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/InstalledList.tsx +7 -9
- package/src/client/components/settings/categories/panel-plugins/PluginCard.test.tsx +149 -0
- package/src/client/components/settings/categories/panel-plugins/PluginCard.tsx +34 -7
- package/src/client/components/settings/categories/panel-plugins/PluginMark.test.ts +66 -2
- package/src/client/components/settings/categories/panel-plugins/PluginMark.tsx +47 -10
- package/src/client/components/settings/categories/panel-plugins/Section.tsx +7 -1
- package/src/client/components/settings/categories/panel-plugins/Toolbar.tsx +35 -2
- 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 +2 -1
- package/src/client/components/settings/categories/token-usage-settings/Controls.tsx +1 -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/UndoConfirmModal.tsx +2 -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/context-panel/CostBreakdownPopover.tsx +1 -1
- package/src/client/components/workspace/diff-panel/index.tsx +2 -2
- package/src/client/components/workspace/editor/PluginRail.tsx +1 -1
- 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/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/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/glass-sticky.test.ts +46 -0
- package/src/client/glass.css +795 -0
- package/src/client/glass.test.ts +306 -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/stuck-header.test.ts +213 -0
- package/src/client/hooks/ui/stuck-header.ts +122 -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/workspace/panel-hues.ts +23 -0
- package/src/client/hooks/workspace/panel-registry.ts +8 -4
- package/src/client/main.tsx +10 -0
- package/src/client/tailwind.css +264 -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/lifecycle/tls.test.ts +6 -1
- 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 +28 -4
- 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 +11 -0
- package/src/server/lib/omp/rpc/terminal-settle.ts +29 -7
- package/src/server/lib/panels/bundled-catalog.server.ts +1 -0
- package/src/server/lib/panels/git-update.server.test.ts +20 -0
- package/src/server/lib/panels/git-update.server.ts +20 -4
- 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/panels/sync.server.ts +9 -1
- package/src/server/lib/panels/update.server.test.ts +193 -0
- package/src/server/lib/panels/update.server.ts +210 -0
- package/src/server/lib/plugins/server-half.server.ts +42 -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/terminal/attach-replay.test.ts +26 -8
- package/src/server/plugins/ssr.ts +22 -5
- package/src/server/routes/panels/install-route.test.ts +238 -0
- package/src/server/routes/panels/install.ts +36 -64
- package/src/server/routes/panels/panel-routes.test-util.ts +6 -1
- package/src/server/routes/panels/routes.test.ts +1 -118
- package/src/shared/lib/icons/file-brand-color.ts +38 -0
- package/src/shared/lib/icons/icon-paint-css.test.ts +235 -0
- package/src/shared/lib/icons/icon-paint-css.ts +285 -0
- package/src/shared/lib/icons/icon-paint-panel.ts +109 -0
- package/src/shared/lib/icons/icon-tone.ts +166 -0
- package/src/shared/lib/icons/tint-hues.generated.ts +277 -0
- package/src/shared/lib/icons/tint.test.ts +333 -0
- package/src/shared/lib/icons/tint.ts +248 -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/omp/rpc/frame.test.ts +65 -0
- package/src/shared/lib/omp/rpc/frame.ts +58 -3
- package/src/shared/lib/panels/update.test.ts +107 -0
- package/src/shared/lib/panels/update.ts +73 -0
- 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/color.ts +50 -0
- 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/workspace/panel-hues.test.ts +68 -0
- package/src/shared/lib/workspace/panel-hues.ts +57 -0
- package/src/shared/types/panels-registry.ts +6 -0
- package/src/shared/types/panels.ts +14 -0
- package/src/shared/types/settings/state.ts +26 -0
- package/src/test-support/fake-omp-frames.ts +163 -0
- package/dist/client/static/js/index-hp75vsv9.css +0 -1
- /package/src/{client/components/common/file-icon/brand-paths.ts → shared/lib/icons/file-brand-paths.ts} +0 -0
package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/index.tsx
CHANGED
|
@@ -142,11 +142,7 @@ export function ExtensionDialog({ request, onRespond }: ExtensionDialogProps) {
|
|
|
142
142
|
|
|
143
143
|
return (
|
|
144
144
|
<div
|
|
145
|
-
className="extension-dialog-backdrop fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"
|
|
146
|
-
style={{
|
|
147
|
-
background: 'color-mix(in srgb, var(--theme-ink) 55%, transparent)',
|
|
148
|
-
backdropFilter: 'blur(8px)',
|
|
149
|
-
}}
|
|
145
|
+
className="extension-dialog-backdrop modal-scrim fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6 backdrop-blur-[8px]"
|
|
150
146
|
onMouseDown={(e) => {
|
|
151
147
|
if (e.target === e.currentTarget) cancel();
|
|
152
148
|
}}
|
|
@@ -157,7 +153,7 @@ export function ExtensionDialog({ request, onRespond }: ExtensionDialogProps) {
|
|
|
157
153
|
aria-modal="true"
|
|
158
154
|
aria-label={request.title || methodMeta.label}
|
|
159
155
|
tabIndex={-1}
|
|
160
|
-
className="extension-dialog-panel w-full max-w-[560px] overflow-hidden rounded-2xl border border-ink/15 bg-paper shadow-2xl outline-none"
|
|
156
|
+
className="glass-overlay extension-dialog-panel w-full max-w-[560px] overflow-hidden rounded-2xl border border-ink/15 bg-paper shadow-2xl outline-none"
|
|
161
157
|
style={{
|
|
162
158
|
boxShadow: '0 24px 64px -8px color-mix(in srgb, var(--theme-ink) 28%, transparent)',
|
|
163
159
|
}}
|
|
@@ -40,7 +40,7 @@ export function CostBreakdownPopover({
|
|
|
40
40
|
return (
|
|
41
41
|
<div
|
|
42
42
|
ref={ref}
|
|
43
|
-
className="absolute top-full right-0 mt-1.5 z-50 w-64 bg-paper border border-ink/10 rounded-lg shadow-lg p-3"
|
|
43
|
+
className="glass-popover absolute top-full right-0 mt-1.5 z-50 w-64 bg-paper border border-ink/10 rounded-lg shadow-lg p-3"
|
|
44
44
|
role="dialog"
|
|
45
45
|
aria-modal="false"
|
|
46
46
|
>
|
|
@@ -259,8 +259,8 @@ export function DiffPanel({
|
|
|
259
259
|
|
|
260
260
|
{/* Discard Confirmation Modal */}
|
|
261
261
|
{showDiscardConfirm && (
|
|
262
|
-
<div className="fixed inset-0
|
|
263
|
-
<div className="bg-paper rounded-lg shadow-xl p-4 w-full max-w-sm border border-ink/15">
|
|
262
|
+
<div className="fixed inset-0 modal-scrim z-50 flex items-center justify-center p-4 backdrop-blur-xs">
|
|
263
|
+
<div className="glass-overlay bg-paper rounded-lg shadow-xl p-4 w-full max-w-sm border border-ink/15">
|
|
264
264
|
<h3 className="font-semibold text-ink mb-1.5 text-sm">Discard Changes?</h3>
|
|
265
265
|
<p className="text-xs text-ink/70 mb-4">
|
|
266
266
|
Are you sure you want to discard all unstaged changes in <span className="font-mono font-medium text-ink">{filePath}</span>? This cannot be undone.
|
|
@@ -70,7 +70,7 @@ export function EditorPluginRail({ activeKey, onSelect, plugins }: EditorPluginR
|
|
|
70
70
|
aria-label={plugin.title}
|
|
71
71
|
aria-pressed={active}
|
|
72
72
|
>
|
|
73
|
-
<PluginMark name={plugin.name} iconUrl={plugin.iconUrl} size={16} />
|
|
73
|
+
<PluginMark name={plugin.name} iconUrl={plugin.iconUrl} color={plugin.color} size={16} />
|
|
74
74
|
</button>
|
|
75
75
|
);
|
|
76
76
|
})}
|
|
@@ -33,14 +33,14 @@ export function SaveDeletedFileModal({ fileName, filePath, onClose, onConfirm }:
|
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
35
|
<div
|
|
36
|
-
className="fixed inset-0 z-50 flex items-center justify-center
|
|
36
|
+
className="fixed inset-0 z-50 flex items-center justify-center modal-scrim animate-in fade-in duration-200 p-4"
|
|
37
37
|
onClick={onClose}
|
|
38
38
|
role="dialog"
|
|
39
39
|
aria-modal="true"
|
|
40
40
|
aria-label="Save deleted file"
|
|
41
41
|
>
|
|
42
42
|
<div
|
|
43
|
-
className="bg-paper border border-ink/20 rounded-xl shadow-xl w-[min(94vw,440px)] overflow-hidden"
|
|
43
|
+
className="glass-overlay bg-paper border border-ink/20 rounded-xl shadow-xl w-[min(94vw,440px)] overflow-hidden"
|
|
44
44
|
onClick={(e) => e.stopPropagation()}
|
|
45
45
|
>
|
|
46
46
|
<div className="flex items-center gap-3 px-4 py-3 border-b border-ink/10">
|
|
@@ -50,7 +50,7 @@ export function TabContextMenu({ x, y, rows, onAction, onClose }: TabContextMenu
|
|
|
50
50
|
ref={menuRef}
|
|
51
51
|
role="menu"
|
|
52
52
|
aria-label="Tab actions"
|
|
53
|
-
className="absolute w-52 bg-paper border border-ink/15 rounded-md shadow-xl py-1 text-xs text-ink"
|
|
53
|
+
className="glass-popover absolute w-52 bg-paper border border-ink/15 rounded-md shadow-xl py-1 text-xs text-ink"
|
|
54
54
|
style={{ left: `${position.left}px`, top: `${position.top}px` }}
|
|
55
55
|
onClick={(event) => event.stopPropagation()}
|
|
56
56
|
>
|
|
@@ -244,7 +244,7 @@ export function EditorTabs({
|
|
|
244
244
|
</button>
|
|
245
245
|
|
|
246
246
|
{showDropdown && (
|
|
247
|
-
<div className="absolute right-0 top-full mt-1 w-52 bg-paper border border-ink/10 rounded shadow-lg z-50 py-1">
|
|
247
|
+
<div className="glass-popover absolute right-0 top-full mt-1 w-52 bg-paper border border-ink/10 rounded shadow-lg z-50 py-1">
|
|
248
248
|
<div className="px-3 py-1 text-[10px] uppercase font-mono text-ink/40 border-b border-ink/10 mb-1">
|
|
249
249
|
Older Tabs
|
|
250
250
|
</div>
|
|
@@ -129,7 +129,7 @@ export function FileContextMenu({ x, y, isFolder, hasGitStatus, pasteLabel, chai
|
|
|
129
129
|
>
|
|
130
130
|
<div
|
|
131
131
|
ref={menuRef}
|
|
132
|
-
className="fixed z-50 bg-paper border border-ink/15 shadow-2xl rounded-lg py-1 min-w-[185px] text-xs text-ink font-sans"
|
|
132
|
+
className="glass-popover fixed z-50 bg-paper border border-ink/15 shadow-2xl rounded-lg py-1 min-w-[185px] text-xs text-ink font-sans"
|
|
133
133
|
style={{ top: posY, left: posX }}
|
|
134
134
|
onClick={e => e.stopPropagation()}
|
|
135
135
|
>
|
|
@@ -35,8 +35,8 @@ interface NewFileModalProps {
|
|
|
35
35
|
export function FileCreateModal({ folderPath, kind, value, error, isLoading, onChange, onCancel, onSubmit }: NewFileModalProps) {
|
|
36
36
|
const label = kind === 'folder' ? 'Folder' : 'File';
|
|
37
37
|
return createPortal(
|
|
38
|
-
<div className="fixed inset-0
|
|
39
|
-
<form onSubmit={onSubmit} className="bg-paper rounded shadow-xl p-4 w-full max-w-sm border border-ink/10 font-sans">
|
|
38
|
+
<div className="fixed inset-0 modal-scrim z-[100] flex items-center justify-center p-4 backdrop-blur-sm">
|
|
39
|
+
<form onSubmit={onSubmit} className="glass-overlay bg-paper rounded shadow-xl p-4 w-full max-w-sm border border-ink/10 font-sans">
|
|
40
40
|
<h3 className="font-semibold text-ink mb-3 text-sm">New {label}</h3>
|
|
41
41
|
<div className="flex items-center gap-1 mb-1 text-xs font-mono text-ink/50 min-w-0">
|
|
42
42
|
<span className="truncate" title={folderPath}>{folderPath || '.'}/</span>
|
|
@@ -92,8 +92,8 @@ interface DeleteModalProps {
|
|
|
92
92
|
|
|
93
93
|
export function FileDeleteModal({ fileName, displayName, isFolder, isLoading, onCancel, onConfirm }: DeleteModalProps) {
|
|
94
94
|
return createPortal(
|
|
95
|
-
<div className="fixed inset-0
|
|
96
|
-
<div className="bg-paper rounded shadow-xl p-4 w-full max-w-sm border border-ink/10 font-sans">
|
|
95
|
+
<div className="fixed inset-0 modal-scrim z-[100] flex items-center justify-center p-4 backdrop-blur-sm">
|
|
96
|
+
<div className="glass-overlay bg-paper rounded shadow-xl p-4 w-full max-w-sm border border-ink/10 font-sans">
|
|
97
97
|
<h3 className="font-semibold text-ink mb-2 text-sm">Delete {isFolder ? 'Folder' : 'File'}</h3>
|
|
98
98
|
<p className="text-xs text-ink/70 mb-4">Are you sure you want to delete <span className="font-mono bg-canvas px-1 rounded">{fileName}</span>? This action cannot be undone.</p>
|
|
99
99
|
{/* A collapsed chain row is LABELLED `com/java/app/package` but its path
|
|
@@ -158,8 +158,8 @@ interface RenameModalProps {
|
|
|
158
158
|
*/
|
|
159
159
|
export function FileRenameModal({ isFolder, renameValue, originalPath, displayName, error, isLoading, onChange, onCancel, onSubmit }: RenameModalProps) {
|
|
160
160
|
return createPortal(
|
|
161
|
-
<div className="fixed inset-0
|
|
162
|
-
<form onSubmit={onSubmit} className="bg-paper rounded shadow-xl p-4 w-full max-w-sm border border-ink/10 font-sans">
|
|
161
|
+
<div className="fixed inset-0 modal-scrim z-[100] flex items-center justify-center p-4 backdrop-blur-sm">
|
|
162
|
+
<form onSubmit={onSubmit} className="glass-overlay bg-paper rounded shadow-xl p-4 w-full max-w-sm border border-ink/10 font-sans">
|
|
163
163
|
<h3 className="font-semibold text-ink mb-3 text-sm">Rename {isFolder ? 'Folder' : 'File'}</h3>
|
|
164
164
|
<input
|
|
165
165
|
autoFocus
|
|
@@ -215,8 +215,8 @@ interface HistoryModalProps {
|
|
|
215
215
|
export function FileHistoryModal({ filePath, fetcherState, fetcherData, onClose }: HistoryModalProps) {
|
|
216
216
|
const rows = fetcherData?.type === 'history' ? fetcherData.data : undefined;
|
|
217
217
|
return createPortal(
|
|
218
|
-
<div className="fixed inset-0
|
|
219
|
-
<div className="bg-paper rounded-lg shadow-xl w-full max-w-4xl border border-ink/10 flex flex-col max-h-[85vh]">
|
|
218
|
+
<div className="fixed inset-0 modal-scrim z-[100] flex items-center justify-center p-4 backdrop-blur-sm">
|
|
219
|
+
<div className="glass-overlay bg-paper rounded-lg shadow-xl w-full max-w-4xl border border-ink/10 flex flex-col max-h-[85vh]">
|
|
220
220
|
<div className="flex items-center justify-between p-4 border-b border-ink/10">
|
|
221
221
|
<h3 className="text-sm font-semibold text-ink flex items-center space-x-2">
|
|
222
222
|
<History size={16} className="text-ink/60" />
|
|
@@ -230,7 +230,7 @@ export function FileHistoryModal({ filePath, fetcherState, fetcherData, onClose
|
|
|
230
230
|
</button>
|
|
231
231
|
</div>
|
|
232
232
|
|
|
233
|
-
<div className="flex-1 scrollbar-overlay-container
|
|
233
|
+
<div className="flex-1 scrollbar-overlay-container p-2">
|
|
234
234
|
{fetcherState === 'idle' ? (
|
|
235
235
|
rows ? (
|
|
236
236
|
rows.length > 0 ? (
|
|
@@ -245,7 +245,7 @@ export function FileHistoryModal({ filePath, fetcherState, fetcherData, onClose
|
|
|
245
245
|
</thead>
|
|
246
246
|
<tbody className="divide-y divide-ink/5">
|
|
247
247
|
{rows.map((row, i) => (
|
|
248
|
-
<tr key={i} className="hover:bg-ink/[0.03] transition-colors group
|
|
248
|
+
<tr key={i} className="hover:bg-ink/[0.03] transition-colors group">
|
|
249
249
|
<td className="px-3 py-2 text-ink">
|
|
250
250
|
{row.message ? <span className="font-medium text-ink/90 group-hover:text-ink">{row.message}</span> : null}
|
|
251
251
|
</td>
|
|
@@ -50,7 +50,7 @@ export function RootContextMenu({ x, y, pasteLabel, busy, onAction, menuRef }: R
|
|
|
50
50
|
>
|
|
51
51
|
<div
|
|
52
52
|
ref={menuRef}
|
|
53
|
-
className="fixed z-50 bg-paper border border-ink/15 shadow-2xl rounded-lg py-1 min-w-[185px] text-xs text-ink font-sans"
|
|
53
|
+
className="glass-popover fixed z-50 bg-paper border border-ink/15 shadow-2xl rounded-lg py-1 min-w-[185px] text-xs text-ink font-sans"
|
|
54
54
|
style={{ top: posY, left: posX }}
|
|
55
55
|
onClick={(e) => e.stopPropagation()}
|
|
56
56
|
>
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The Sync button's spinner contract.
|
|
8
|
+
*
|
|
9
|
+
* The button carries the ahead/behind counts and a pull+push can run for
|
|
10
|
+
* seconds; a static `RefreshCw` made it look unpressed. `syncing` is derived
|
|
11
|
+
* from the ACTION, not from `isBusy` — `isBusy` also covers the status read and
|
|
12
|
+
* every other mutation, and a commit must not spin this badge.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
|
|
16
|
+
import { Window } from 'happy-dom';
|
|
17
|
+
import { h, render } from 'preact';
|
|
18
|
+
import { act } from 'preact/test-utils';
|
|
19
|
+
import { GitBranchToolbar } from '@/client/components/workspace/git-panel/BranchToolbar';
|
|
20
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
21
|
+
|
|
22
|
+
let container: HTMLElement;
|
|
23
|
+
let syncClicks: number;
|
|
24
|
+
|
|
25
|
+
beforeAll(() => {
|
|
26
|
+
installDomGlobals(new Window({ url: 'http://localhost' }));
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
afterEach(() => {
|
|
30
|
+
if (container) {
|
|
31
|
+
render(null, container);
|
|
32
|
+
container.remove();
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
afterAll(() => {
|
|
37
|
+
restoreDomGlobals();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
function mount({ syncing = false, isBusy = false }: { syncing?: boolean; isBusy?: boolean } = {}): void {
|
|
41
|
+
syncClicks = 0;
|
|
42
|
+
container = document.createElement('div');
|
|
43
|
+
document.body.appendChild(container);
|
|
44
|
+
act(() => {
|
|
45
|
+
render(
|
|
46
|
+
h(GitBranchToolbar, {
|
|
47
|
+
branchRef: { current: null },
|
|
48
|
+
showBranchMenu: false,
|
|
49
|
+
setShowBranchMenu: () => {},
|
|
50
|
+
branch: 'main',
|
|
51
|
+
branches: ['main'],
|
|
52
|
+
remoteBranches: [],
|
|
53
|
+
onCheckout: () => {},
|
|
54
|
+
onMerge: () => {},
|
|
55
|
+
onOpenBranchPrompt: () => {},
|
|
56
|
+
onManageBranches: () => {},
|
|
57
|
+
optionsRef: { current: null },
|
|
58
|
+
showOptions: false,
|
|
59
|
+
setShowOptions: () => {},
|
|
60
|
+
onHistory: () => {},
|
|
61
|
+
onGraph: () => {},
|
|
62
|
+
viewMode: 'flat',
|
|
63
|
+
setViewMode: () => {},
|
|
64
|
+
isBusy,
|
|
65
|
+
syncCount: { ahead: 2, behind: 1 },
|
|
66
|
+
syncing,
|
|
67
|
+
onSync: () => {
|
|
68
|
+
syncClicks += 1;
|
|
69
|
+
},
|
|
70
|
+
onFetch: () => {},
|
|
71
|
+
}),
|
|
72
|
+
container,
|
|
73
|
+
);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function syncButton(): HTMLButtonElement {
|
|
78
|
+
const el = container.querySelector('button[aria-label="Sync with upstream"]');
|
|
79
|
+
if (!el) throw new Error('no Sync button rendered');
|
|
80
|
+
return el as HTMLButtonElement;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
describe('GitBranchToolbar Sync spinner', () => {
|
|
84
|
+
test('idle: no rotation, counts still printed', () => {
|
|
85
|
+
mount();
|
|
86
|
+
|
|
87
|
+
const button = syncButton();
|
|
88
|
+
expect(button.querySelector('svg.animate-spin')).toBeNull();
|
|
89
|
+
expect(button.getAttribute('aria-busy')).not.toBe('true');
|
|
90
|
+
expect(button.textContent).toContain('↑2');
|
|
91
|
+
expect(button.textContent).toContain('↓1');
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test('syncing: the SAME glyph rotates — the icon is not swapped', () => {
|
|
95
|
+
mount();
|
|
96
|
+
const idleGlyph = syncButton().querySelector('svg')?.innerHTML;
|
|
97
|
+
render(null, container);
|
|
98
|
+
container.remove();
|
|
99
|
+
|
|
100
|
+
mount({ syncing: true });
|
|
101
|
+
const spinning = syncButton().querySelector('svg');
|
|
102
|
+
expect(spinning).not.toBeNull();
|
|
103
|
+
expect(spinning!.classList.contains('animate-spin')).toBe(true);
|
|
104
|
+
// Rotating one glyph is the point: a swap would change the paths, and a
|
|
105
|
+
// different mark makes the control look like it changed identity mid-press.
|
|
106
|
+
expect(spinning!.innerHTML).toBe(idleGlyph ?? '');
|
|
107
|
+
expect(syncButton().getAttribute('aria-busy')).toBe('true');
|
|
108
|
+
expect(syncButton().getAttribute('title')).toBe('Syncing with upstream…');
|
|
109
|
+
// The counts stay visible — the spin marks the ACTION, the numbers mark
|
|
110
|
+
// how much work it covers.
|
|
111
|
+
expect(syncButton().textContent).toContain('↑2');
|
|
112
|
+
expect(syncButton().textContent).toContain('↓1');
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
test('clicking dispatches onSync', () => {
|
|
116
|
+
mount();
|
|
117
|
+
|
|
118
|
+
act(() => {
|
|
119
|
+
syncButton().click();
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
expect(syncClicks).toBe(1);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
test('busy disables the button', () => {
|
|
126
|
+
mount({ isBusy: true, syncing: true });
|
|
127
|
+
|
|
128
|
+
expect(syncButton().disabled).toBe(true);
|
|
129
|
+
});
|
|
130
|
+
});
|
|
@@ -23,6 +23,8 @@ interface GitBranchToolbarProps {
|
|
|
23
23
|
setViewMode: (mode: 'flat' | 'tree') => void;
|
|
24
24
|
isBusy?: boolean;
|
|
25
25
|
syncCount?: { ahead: number; behind: number };
|
|
26
|
+
/** A pull/push (the Sync action) is in flight — the button shows a spinner. */
|
|
27
|
+
syncing?: boolean;
|
|
26
28
|
onSync: () => void;
|
|
27
29
|
/** Refresh the remote-tracking refs without moving the branch. */
|
|
28
30
|
onFetch: () => void;
|
|
@@ -50,6 +52,7 @@ export function GitBranchToolbar({
|
|
|
50
52
|
setViewMode,
|
|
51
53
|
isBusy = false,
|
|
52
54
|
syncCount = { ahead: 0, behind: 0 },
|
|
55
|
+
syncing = false,
|
|
53
56
|
onSync,
|
|
54
57
|
onFetch,
|
|
55
58
|
detached = false,
|
|
@@ -68,7 +71,7 @@ export function GitBranchToolbar({
|
|
|
68
71
|
</button>
|
|
69
72
|
|
|
70
73
|
{showBranchMenu && (
|
|
71
|
-
<div className="absolute top-full left-0 mt-1 w-56 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs">
|
|
74
|
+
<div className="glass-popover absolute top-full left-0 mt-1 w-56 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs">
|
|
72
75
|
<div className="max-h-48 scrollbar-overlay-container py-1">
|
|
73
76
|
{branches.length > 0 && (
|
|
74
77
|
<>
|
|
@@ -178,18 +181,25 @@ export function GitBranchToolbar({
|
|
|
178
181
|
onClick={onSync}
|
|
179
182
|
disabled={isBusy}
|
|
180
183
|
title={
|
|
181
|
-
|
|
182
|
-
?
|
|
183
|
-
: syncCount.ahead > 0
|
|
184
|
-
? `
|
|
185
|
-
: syncCount.
|
|
186
|
-
? `
|
|
187
|
-
:
|
|
184
|
+
syncing
|
|
185
|
+
? 'Syncing with upstream…'
|
|
186
|
+
: syncCount.ahead > 0 && syncCount.behind > 0
|
|
187
|
+
? `Pull ${syncCount.behind} then push ${syncCount.ahead} commit(s)`
|
|
188
|
+
: syncCount.ahead > 0
|
|
189
|
+
? `Push ${syncCount.ahead} commit(s)`
|
|
190
|
+
: syncCount.behind > 0
|
|
191
|
+
? `Pull ${syncCount.behind} commit(s)`
|
|
192
|
+
: 'Up to date — sync anyway'
|
|
188
193
|
}
|
|
189
194
|
aria-label="Sync with upstream"
|
|
190
|
-
|
|
195
|
+
aria-busy={syncing}
|
|
196
|
+
className={`flex items-center gap-1 p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors disabled:cursor-not-allowed ${syncing ? '' : 'disabled:opacity-40'}`}
|
|
191
197
|
>
|
|
192
|
-
|
|
198
|
+
{/* The glyph ROTATES rather than being swapped for a spinner: the
|
|
199
|
+
button keeps one identity (the refresh mark it always had), its
|
|
200
|
+
width cannot shift under the counts, and the spin is the same
|
|
201
|
+
idiom the panel's own Refresh uses (`RepoHeader`). */}
|
|
202
|
+
<RefreshCw size={13} className={syncing ? 'animate-spin' : ''} aria-hidden="true" />
|
|
193
203
|
<span className="font-mono tabular-nums text-[10px]">↑{syncCount.ahead} ↓{syncCount.behind}</span>
|
|
194
204
|
</button>
|
|
195
205
|
|
|
@@ -225,7 +235,7 @@ export function GitBranchToolbar({
|
|
|
225
235
|
</button>
|
|
226
236
|
|
|
227
237
|
{showOptions && (
|
|
228
|
-
<div className="absolute right-0 top-full mt-1 w-36 bg-paper border border-ink/15 rounded-md shadow-lg z-50 py-1 font-mono text-xs">
|
|
238
|
+
<div className="glass-popover absolute right-0 top-full mt-1 w-36 bg-paper border border-ink/15 rounded-md shadow-lg z-50 py-1 font-mono text-xs">
|
|
229
239
|
<button
|
|
230
240
|
type="button"
|
|
231
241
|
onClick={() => { setViewMode('flat'); setShowOptions(false); }}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CHECKBOX_CLASS } from '@/client/components/common/checkbox/style';
|
|
1
2
|
import { Check } from 'lucide-preact';
|
|
2
3
|
|
|
3
4
|
interface GitCommitBoxProps {
|
|
@@ -79,7 +80,7 @@ export function GitCommitBox({
|
|
|
79
80
|
type="checkbox"
|
|
80
81
|
checked={amend}
|
|
81
82
|
onChange={(e) => onToggleAmend?.(e.currentTarget.checked)}
|
|
82
|
-
className=
|
|
83
|
+
className={`${CHECKBOX_CLASS} accent-ink cursor-pointer`}
|
|
83
84
|
/>
|
|
84
85
|
Amend
|
|
85
86
|
</label>
|
|
@@ -7,13 +7,13 @@ export { GitCommitModal as GitOutputModal } from '@/client/components/workspace/
|
|
|
7
7
|
function ModalShell({ children, onClose }: { children: ReactNode; onClose: () => void }) {
|
|
8
8
|
return (
|
|
9
9
|
<div
|
|
10
|
-
className="fixed inset-0 z-50
|
|
10
|
+
className="fixed inset-0 z-50 modal-scrim flex items-center justify-center p-4"
|
|
11
11
|
onClick={onClose}
|
|
12
12
|
role="dialog"
|
|
13
13
|
aria-modal="true"
|
|
14
14
|
>
|
|
15
15
|
<div
|
|
16
|
-
className="bg-paper border border-ink/20 rounded-lg shadow-xl flex flex-col overflow-hidden w-[min(94vw,420px)] max-h-[80vh]"
|
|
16
|
+
className="glass-overlay bg-paper border border-ink/20 rounded-lg shadow-xl flex flex-col overflow-hidden w-[min(94vw,420px)] max-h-[80vh]"
|
|
17
17
|
onClick={(e) => e.stopPropagation()}
|
|
18
18
|
>
|
|
19
19
|
{children}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CHECKBOX_CLASS } from '@/client/components/common/checkbox/style';
|
|
1
2
|
import { useCallback, useEffect, useId, useState } from 'preact/hooks';
|
|
2
3
|
import { Archive, Download, Plus, Trash2 } from 'lucide-preact';
|
|
3
4
|
import type { GitStashEntry } from '@/shared/types/git';
|
|
@@ -176,7 +177,7 @@ export function GitStashSection({ rootPath, repo, isBusy, onAction }: GitStashSe
|
|
|
176
177
|
type="checkbox"
|
|
177
178
|
checked={untracked}
|
|
178
179
|
onChange={(e) => setUntracked(e.currentTarget.checked)}
|
|
179
|
-
className=
|
|
180
|
+
className={`${CHECKBOX_CLASS} accent-ink cursor-pointer`}
|
|
180
181
|
/>
|
|
181
182
|
-u
|
|
182
183
|
</label>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CHECKBOX_CLASS } from '@/client/components/common/checkbox/style';
|
|
1
2
|
import { AlertTriangle } from 'lucide-preact';
|
|
2
3
|
import { Modal } from '@/client/components/common/Modal';
|
|
3
4
|
import type { GitBranchDetail } from '@/shared/types/git';
|
|
@@ -73,7 +74,7 @@ export function DeleteBranchDialog({
|
|
|
73
74
|
type="checkbox"
|
|
74
75
|
checked={force}
|
|
75
76
|
onChange={(e) => onForceChange(e.currentTarget.checked)}
|
|
76
|
-
className=
|
|
77
|
+
className={`${CHECKBOX_CLASS} accent-error cursor-pointer mt-0.5`}
|
|
77
78
|
/>
|
|
78
79
|
<span className="flex flex-col gap-0.5">
|
|
79
80
|
<span className="text-error font-medium">Delete even if its commits are not merged</span>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CHECKBOX_CLASS } from '@/client/components/common/checkbox/style';
|
|
1
2
|
import { useState } from 'preact/hooks';
|
|
2
3
|
import { Modal } from '@/client/components/common/Modal';
|
|
3
4
|
import type { GitBranchDetail } from '@/shared/types/git';
|
|
@@ -117,7 +118,7 @@ function RenameBranchForm({
|
|
|
117
118
|
type="checkbox"
|
|
118
119
|
checked={remote}
|
|
119
120
|
onChange={(e) => setRemote(e.currentTarget.checked)}
|
|
120
|
-
className=
|
|
121
|
+
className={`${CHECKBOX_CLASS} accent-ink cursor-pointer mt-0.5`}
|
|
121
122
|
/>
|
|
122
123
|
<span className="flex flex-col gap-0.5">
|
|
123
124
|
<span>Also rename it on the remote</span>
|
|
@@ -224,13 +224,13 @@ export function GitCommitModal({
|
|
|
224
224
|
|
|
225
225
|
return (
|
|
226
226
|
<div
|
|
227
|
-
className="fixed inset-0 z-50
|
|
227
|
+
className="fixed inset-0 z-50 modal-scrim backdrop-blur-xs flex items-center justify-center p-0 lg:p-5"
|
|
228
228
|
onClick={onClose}
|
|
229
229
|
role="dialog"
|
|
230
230
|
aria-modal="true"
|
|
231
231
|
>
|
|
232
232
|
<div
|
|
233
|
-
className="bg-paper border-ink/20 shadow-2xl flex flex-col overflow-hidden
|
|
233
|
+
className="glass-overlay bg-paper border-ink/20 shadow-2xl flex flex-col overflow-hidden
|
|
234
234
|
w-full h-full rounded-none border-0
|
|
235
235
|
lg:w-[min(94vw,1200px)] lg:h-[88vh] lg:rounded-xl lg:border
|
|
236
236
|
pt-[env(safe-area-inset-top,0px)] lg:pt-0"
|
|
@@ -141,6 +141,12 @@ export function GitPanel({ className = '', enabled = true, rootPath, refreshKey
|
|
|
141
141
|
// controls; a topic PUSH must not, or a background tool call would lock the
|
|
142
142
|
// commit box for a beat.
|
|
143
143
|
const isBusy = isReading || actionFetcher.state !== 'idle';
|
|
144
|
+
// The Sync button's own spinner. `isBusy` covers every action plus the status
|
|
145
|
+
// read, but only a pull/push is "syncing" — a commit or a stage must not spin
|
|
146
|
+
// the badge. `lastAction` is recorded by `execute` before the submit, so the
|
|
147
|
+
// first render after the fetch starts already names the right action.
|
|
148
|
+
const runningAction = actionFetcher.state === 'idle' ? null : actionFetcher.lastAction?.actionType ?? null;
|
|
149
|
+
const isSyncing = runningAction === 'sync' || runningAction === 'push' || runningAction === 'pull';
|
|
144
150
|
|
|
145
151
|
// Unmerged pairs are excluded for the same reason `GitChangesList` excludes
|
|
146
152
|
// them: their two letters are the two SIDES of a conflict, so the column test
|
|
@@ -264,6 +270,7 @@ export function GitPanel({ className = '', enabled = true, rootPath, refreshKey
|
|
|
264
270
|
setViewMode={setViewMode}
|
|
265
271
|
isBusy={isBusy}
|
|
266
272
|
syncCount={syncCount}
|
|
273
|
+
syncing={isSyncing}
|
|
267
274
|
onSync={() => executeAction('sync')}
|
|
268
275
|
onFetch={() => executeAction('fetch')}
|
|
269
276
|
detached={data?.state?.detached ?? false}
|
|
@@ -86,7 +86,7 @@ export function ModelDropdownPanel({
|
|
|
86
86
|
|
|
87
87
|
return (
|
|
88
88
|
<div className="absolute bottom-full left-0 mb-2.5 z-50 flex items-start">
|
|
89
|
-
<div ref={panelRef} className="w-84 sm:w-96 bg-paper border border-ink/20 rounded-xl shadow-2xl flex flex-col overflow-hidden text-xs max-h-[460px] animate-in fade-in zoom-in-95 duration-100">
|
|
89
|
+
<div ref={panelRef} className="glass-popover w-84 sm:w-96 bg-paper border border-ink/20 rounded-xl shadow-2xl flex flex-col overflow-hidden text-xs max-h-[460px] animate-in fade-in zoom-in-95 duration-100">
|
|
90
90
|
<ModelDropdownHeader
|
|
91
91
|
search={search}
|
|
92
92
|
onSearchChange={onSearchChange}
|
|
@@ -114,7 +114,7 @@ export function ModelSpecsTooltip({ model }: ModelSpecsTooltipProps) {
|
|
|
114
114
|
// `pointer-events-none`: the card sits beside the list, so a card that
|
|
115
115
|
// captured the pointer would take the hover off the row it describes and
|
|
116
116
|
// flicker as the reader moved toward it.
|
|
117
|
-
className="w-72 bg-paper/95 backdrop-blur-sm border border-ink/20 rounded-xl shadow-2xl p-3.5 text-xs text-ink select-none pointer-events-none animate-in fade-in zoom-in-95 duration-100"
|
|
117
|
+
className="glass-popover w-72 bg-paper/95 backdrop-blur-sm border border-ink/20 rounded-xl shadow-2xl p-3.5 text-xs text-ink select-none pointer-events-none animate-in fade-in zoom-in-95 duration-100"
|
|
118
118
|
>
|
|
119
119
|
{facts.length > 0 && (
|
|
120
120
|
<dl className={GRID}>
|
|
@@ -66,6 +66,12 @@ export interface ResolvedPanel {
|
|
|
66
66
|
icon?: ReactNode;
|
|
67
67
|
/** A plugin's icon URL, when its manifest declares one. */
|
|
68
68
|
iconUrl?: string;
|
|
69
|
+
/**
|
|
70
|
+
* The colour a plugin's mark is drawn in, when its manifest declares one.
|
|
71
|
+
* A built-in view never carries this: its mark is a glyph, and the palette
|
|
72
|
+
* decides its colour.
|
|
73
|
+
*/
|
|
74
|
+
color?: string;
|
|
69
75
|
/** The plugin's display name; empty for a built-in view. */
|
|
70
76
|
name: string;
|
|
71
77
|
builtin: boolean;
|
|
@@ -178,6 +184,7 @@ export function usePanelCatalog(side: PanelCatalogSide = 'right'): ResolvedPanel
|
|
|
178
184
|
defaultWidth: widths.px,
|
|
179
185
|
defaultFraction: widths.fraction,
|
|
180
186
|
...(panel.iconUrl ? { iconUrl: panel.iconUrl } : {}),
|
|
187
|
+
...(panel.color ? { color: panel.color } : {}),
|
|
181
188
|
// Wrapped so the kit's participant hooks resolve THIS plugin's id while
|
|
182
189
|
// its panel renders — the scope is what `useRpc`/`useRealtime` read.
|
|
183
190
|
// The boundary is the other half: a plugin component that throws must
|
|
@@ -19,6 +19,8 @@ export interface ResolvedPluginPanel {
|
|
|
19
19
|
title: string;
|
|
20
20
|
Component: ComponentType<RightPanelProps>;
|
|
21
21
|
iconUrl?: string;
|
|
22
|
+
/** The mark colour the plugin's manifest declares, when it declares one. */
|
|
23
|
+
color?: string;
|
|
22
24
|
/** Sizing the bundle declared, passed through to the width resolver. */
|
|
23
25
|
minWidth?: number;
|
|
24
26
|
defaultFraction?: number;
|
|
@@ -61,6 +63,7 @@ export function usePluginPanels(activePanel: string): PluginPanels {
|
|
|
61
63
|
title: entry?.titles.rightPanel ?? panel.name,
|
|
62
64
|
Component,
|
|
63
65
|
...(panel.iconUrl ? { iconUrl: panel.iconUrl } : {}),
|
|
66
|
+
...(panel.color ? { color: panel.color } : {}),
|
|
64
67
|
...(size?.minWidth !== undefined ? { minWidth: size.minWidth } : {}),
|
|
65
68
|
...(size?.defaultFraction !== undefined ? { defaultFraction: size.defaultFraction } : {}),
|
|
66
69
|
});
|
|
@@ -135,6 +138,7 @@ export function usePanelSlotPlugins(): ResolvedPluginPanel[] {
|
|
|
135
138
|
title: entry?.titles.panel ?? panel.name,
|
|
136
139
|
Component: Component as ResolvedPluginPanel['Component'],
|
|
137
140
|
...(panel.iconUrl ? { iconUrl: panel.iconUrl } : {}),
|
|
141
|
+
...(panel.color ? { color: panel.color } : {}),
|
|
138
142
|
...(size?.minWidth !== undefined ? { minWidth: size.minWidth } : {}),
|
|
139
143
|
...(size?.defaultFraction !== undefined ? { defaultFraction: size.defaultFraction } : {}),
|
|
140
144
|
});
|
|
@@ -160,7 +160,7 @@ export function SearchPanelBody({
|
|
|
160
160
|
</button>
|
|
161
161
|
|
|
162
162
|
{showMenu && (
|
|
163
|
-
<div className="absolute right-0 top-full mt-1 w-48 bg-paper border border-ink/10 rounded shadow-lg z-10 py-1">
|
|
163
|
+
<div className="glass-popover absolute right-0 top-full mt-1 w-48 bg-paper border border-ink/10 rounded shadow-lg z-10 py-1">
|
|
164
164
|
<button
|
|
165
165
|
onClick={() => {
|
|
166
166
|
setShowIncludeField(!showIncludeField);
|
|
@@ -144,7 +144,7 @@ export function ProviderSelect({ providers, value, onChange }: ProviderSelectPro
|
|
|
144
144
|
</button>
|
|
145
145
|
|
|
146
146
|
{open && (
|
|
147
|
-
<div className="absolute top-full left-0 mt-1 w-52 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs">
|
|
147
|
+
<div className="glass-popover absolute top-full left-0 mt-1 w-52 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs">
|
|
148
148
|
<div className="px-2 py-1.5 border-b border-ink/10 flex items-center gap-1.5">
|
|
149
149
|
<Search size={11} className="text-ink/40 flex-shrink-0" />
|
|
150
150
|
<input
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The sticky folder header's material, split from `glass.test.ts` by subject:
|
|
8
|
+
* it is the one element in `glass.css` that matches BOTH a tier rule (the
|
|
9
|
+
* `bg-canvas` well) and a state rule (`.glass-sticky[data-stuck]`).
|
|
10
|
+
*
|
|
11
|
+
* The phone drawer's header paints `bg-canvas` because its rows sit on canvas
|
|
12
|
+
* (see `modern/WorkspaceHeader.tsx`), so the well rule matched it. That
|
|
13
|
+
* selector is (0,4,0) and the stuck fill is (0,3,0), so the well won: measured
|
|
14
|
+
* at 412x900 with the drawer open and 420px scrolled, a PINNED header computed
|
|
15
|
+
* to `rgba(0,0,0,0)` — sticky active, background transparent — while the
|
|
16
|
+
* desktop column's `bg-paper` header painted its fill. A sticky header is a
|
|
17
|
+
* sticky header, never a well.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { describe, expect, test } from 'bun:test';
|
|
21
|
+
|
|
22
|
+
const read = (file: string): Promise<string> => Bun.file(new URL(file, import.meta.url)).text();
|
|
23
|
+
|
|
24
|
+
describe('glass sticky header material', () => {
|
|
25
|
+
test('the canvas well rule steps aside for a sticky header', async () => {
|
|
26
|
+
const glass = await read('./glass.css');
|
|
27
|
+
const well = glass.slice(glass.indexOf('[data-surface="glass"] .app-window .bg-canvas'));
|
|
28
|
+
expect(well.slice(0, well.indexOf('{'))).toContain(':not(.glass-sticky)');
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('the fill belongs to the stuck state and outlives the well rule', async () => {
|
|
32
|
+
const glass = await read('./glass.css');
|
|
33
|
+
// At rest: nothing, so a folder header is not a stripe across the list.
|
|
34
|
+
const rest = glass.slice(glass.indexOf('[data-surface="glass"] .glass-sticky {'));
|
|
35
|
+
expect(rest.slice(0, rest.indexOf('}'))).toContain('background-color: transparent;');
|
|
36
|
+
|
|
37
|
+
// While pinned: the opaque composite, painted AFTER the rest rule so source
|
|
38
|
+
// order agrees with the state it describes.
|
|
39
|
+
const restAt = glass.indexOf('[data-surface="glass"] .glass-sticky {');
|
|
40
|
+
const stuckAt = glass.indexOf('[data-surface="glass"] .glass-sticky[data-stuck] {');
|
|
41
|
+
expect(stuckAt).toBeGreaterThan(restAt);
|
|
42
|
+
const stuck = glass.slice(stuckAt);
|
|
43
|
+
expect(stuck.slice(0, stuck.indexOf('}'))).toContain('background-color: var(--glass-stuck);');
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|