@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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "/",
|
|
3
3
|
"name": "Kabmo",
|
|
4
4
|
"short_name": "Kabmo",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "Web console and diagnostic workbench for AI coding agents.",
|
|
6
6
|
"display": "standalone",
|
|
7
7
|
"display_override": ["window-controls-overlay", "standalone"],
|
|
8
8
|
"background_color": "#0B5D3B",
|
package/index.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<meta name="apple-mobile-web-app-title" content="Kabmo" />
|
|
13
13
|
<meta
|
|
14
14
|
name="description"
|
|
15
|
-
content="A light e-ink paper developer dashboard for AI Oh-My-Pi agent sessions — a
|
|
15
|
+
content="A light e-ink paper developer dashboard for AI Oh-My-Pi agent sessions — a web console for CI/CD deployments."
|
|
16
16
|
/>
|
|
17
17
|
<title>Kabmo</title>
|
|
18
18
|
<!-- Inline and in the head on purpose: this has to be registered BEFORE the
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "command-runner",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Lists a repository's commands and runs them, in the foreground or as background jobs.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"kabmo": {
|
|
8
8
|
"id": "command-runner",
|
|
9
9
|
"name": "Runner",
|
|
10
|
-
"version": "0.
|
|
10
|
+
"version": "0.3.0",
|
|
11
11
|
"description": "Lists a repository's commands and runs them, in the foreground or as background jobs.",
|
|
12
12
|
"app": "dist/app.js",
|
|
13
13
|
"server": "dist/server.js",
|
|
14
14
|
"icon": "icon.svg",
|
|
15
|
+
"color": "#f59e0b",
|
|
15
16
|
"author": { "name": "Kabmo Labs", "url": "https://github.com/kabmo-labs" },
|
|
16
17
|
"slots": ["rightPanel"],
|
|
17
18
|
"capabilities": ["server", "storage", "rpc", "realtime", "repo-scope"],
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git-forge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Reads and acts on a repository's issues, pull/merge requests and releases on GitHub, GitLab, Gitea or Bitbucket.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"kabmo": {
|
|
8
8
|
"id": "git-forge",
|
|
9
9
|
"name": "Forge",
|
|
10
|
-
"version": "0.
|
|
10
|
+
"version": "0.4.0",
|
|
11
11
|
"description": "Reads and acts on a repository's issues, pull/merge requests and releases on GitHub, GitLab, Gitea or Bitbucket.",
|
|
12
12
|
"app": "dist/app.js",
|
|
13
13
|
"server": "dist/server.js",
|
|
14
14
|
"icon": "icon.svg",
|
|
15
|
+
"color": "#a855f7",
|
|
15
16
|
"author": { "name": "Kabmo Labs", "url": "https://github.com/kabmo-labs" },
|
|
16
17
|
"slots": ["rightPanel"],
|
|
17
18
|
"capabilities": ["server", "storage", "rpc", "settings", "repo-scope"],
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "session-info",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Shows the active workspace and keeps a note per session.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"kabmo": {
|
|
8
8
|
"id": "session-info",
|
|
9
9
|
"name": "Session Info",
|
|
10
|
-
"version": "0.
|
|
10
|
+
"version": "0.2.0",
|
|
11
11
|
"description": "Shows the active workspace and keeps a note per session.",
|
|
12
12
|
"app": "dist/app.js",
|
|
13
13
|
"server": "dist/server.js",
|
|
14
14
|
"icon": "icon.svg",
|
|
15
|
+
"color": "#38bdf8",
|
|
15
16
|
"author": { "name": "Kabmo Labs", "url": "https://github.com/kabmo-labs" },
|
|
16
17
|
"slots": ["rightPanel", "panel", "headerPanel"],
|
|
17
18
|
"settings": {
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stats",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "CPU and RAM used by the omp stack — Kabmo, every omp child, the daemons and the shells.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"kabmo": {
|
|
8
8
|
"id": "stats",
|
|
9
9
|
"name": "Stats",
|
|
10
|
-
"version": "0.
|
|
10
|
+
"version": "0.4.0",
|
|
11
11
|
"description": "CPU and RAM used by the omp stack — Kabmo, every omp child, the daemons and the shells.",
|
|
12
12
|
"app": "dist/app.js",
|
|
13
13
|
"server": "dist/server.js",
|
|
14
14
|
"icon": "icon.svg",
|
|
15
|
+
"color": "#34d399",
|
|
15
16
|
"author": { "name": "Kabmo Labs", "url": "https://github.com/kabmo-labs" },
|
|
16
17
|
"slots": ["rightPanel", "headerPanel"],
|
|
17
18
|
"settings": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kabmo-labs/kabmo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "Web console and diagnostic workbench for AI coding agents — Elysia + Preact on Bun.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Wijanarko Putra Rajeb <wijanarko.rajeb@gmail.com>",
|
|
@@ -46,6 +46,8 @@
|
|
|
46
46
|
"dev:lan": "HOST=0.0.0.0 bun run --hot src/server/index.ts --kabmo-server",
|
|
47
47
|
"build": "bun run scripts/build-client.ts",
|
|
48
48
|
"editor:themes": "bun run scripts/editor-themes.mjs",
|
|
49
|
+
"icons:tints": "bun run scripts/icon-tints.mjs",
|
|
50
|
+
"icons:tints:check": "bun run scripts/icon-tints.mjs --check",
|
|
49
51
|
"editor:themes:check": "bun run scripts/editor-themes.mjs --check",
|
|
50
52
|
"omp:schema": "bun run scripts/omp-schema.mjs",
|
|
51
53
|
"omp:schema:check": "bun run scripts/omp-schema.mjs --check",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "/",
|
|
3
3
|
"name": "Kabmo",
|
|
4
4
|
"short_name": "Kabmo",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "Web console and diagnostic workbench for AI coding agents.",
|
|
6
6
|
"display": "standalone",
|
|
7
7
|
"display_override": ["window-controls-overlay", "standalone"],
|
|
8
8
|
"background_color": "#0B5D3B",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* session entitles it to.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
import { CHECKBOX_CLASS } from '@/client/components/common/checkbox/style';
|
|
21
22
|
import { useEffect, useState } from 'preact/hooks';
|
|
22
23
|
import type { FunctionComponent } from 'preact/compat';
|
|
23
24
|
import { Eye, EyeOff, Loader2 } from 'lucide-preact';
|
|
@@ -129,7 +130,7 @@ export const LoginScreen: FunctionComponent = () => {
|
|
|
129
130
|
checked={trustDevice}
|
|
130
131
|
onChange={(event) => setTrustDevice(event.currentTarget.checked)}
|
|
131
132
|
disabled={busy}
|
|
132
|
-
className=
|
|
133
|
+
className={`${CHECKBOX_CLASS} size-3.5 accent-ink`}
|
|
133
134
|
/>
|
|
134
135
|
<span>Remember this device for 7 days</span>
|
|
135
136
|
</label>
|
|
@@ -88,7 +88,7 @@ export function ComposerPicker({
|
|
|
88
88
|
role="listbox"
|
|
89
89
|
id={listboxId}
|
|
90
90
|
aria-label={ariaLabel}
|
|
91
|
-
className={`absolute left-0 right-0 z-50 min-w-[260px] flex max-h-60 flex-col rounded-md border border-ink/20 bg-paper shadow-lg text-sm ${
|
|
91
|
+
className={`glass-popover absolute left-0 right-0 z-50 min-w-[260px] flex max-h-60 flex-col rounded-md border border-ink/20 bg-paper shadow-lg text-sm ${
|
|
92
92
|
placement === 'over' ? 'top-2' : 'bottom-full mb-1'
|
|
93
93
|
}`}
|
|
94
94
|
>
|
|
@@ -88,11 +88,11 @@ export function FolderPicker({ initialPath, onSelect, onClose }: FolderPickerPro
|
|
|
88
88
|
|
|
89
89
|
return (
|
|
90
90
|
<div
|
|
91
|
-
className="fixed inset-0
|
|
91
|
+
className="fixed inset-0 modal-scrim z-[60] flex items-center justify-center p-4"
|
|
92
92
|
onClick={onClose}
|
|
93
93
|
>
|
|
94
94
|
<div
|
|
95
|
-
className="bg-paper border border-ink/15 rounded-lg shadow-2xl w-full max-w-lg flex flex-col overflow-hidden"
|
|
95
|
+
className="glass-overlay bg-paper border border-ink/15 rounded-lg shadow-2xl w-full max-w-lg flex flex-col overflow-hidden"
|
|
96
96
|
onClick={(e) => e.stopPropagation()}
|
|
97
97
|
>
|
|
98
98
|
{/* Header */}
|
|
@@ -50,7 +50,7 @@ export function Modal({
|
|
|
50
50
|
|
|
51
51
|
return (
|
|
52
52
|
<div
|
|
53
|
-
className={`fixed inset-0
|
|
53
|
+
className={`fixed inset-0 modal-scrim backdrop-blur-[2px] ${zClass} flex items-center justify-center p-4`}
|
|
54
54
|
style={{
|
|
55
55
|
paddingTop: 'max(1rem, env(safe-area-inset-top, 0px))',
|
|
56
56
|
paddingBottom: 'max(1rem, env(safe-area-inset-bottom, 0px))',
|
|
@@ -69,7 +69,7 @@ export function Modal({
|
|
|
69
69
|
role="dialog"
|
|
70
70
|
aria-modal="true"
|
|
71
71
|
aria-label={ariaLabel}
|
|
72
|
-
className={`bg-paper border border-ink/15 rounded-xl shadow-2xl w-full ${maxWidthClass} max-h-full flex flex-col overflow-hidden text-ink`}
|
|
72
|
+
className={`glass-overlay bg-paper border border-ink/15 rounded-xl shadow-2xl w-full ${maxWidthClass} max-h-full flex flex-col overflow-hidden text-ink`}
|
|
73
73
|
onClick={(e) => e.stopPropagation()}
|
|
74
74
|
>
|
|
75
75
|
<div className="px-5 py-4 border-b border-ink/10 flex items-center justify-between flex-shrink-0">
|
|
@@ -89,8 +89,8 @@ export const PWAInstallButton: FunctionComponent = () => {
|
|
|
89
89
|
<Download size={16} />
|
|
90
90
|
</button>
|
|
91
91
|
{showIOSGuide && (
|
|
92
|
-
<div className="fixed inset-0 z-50 flex items-center justify-center
|
|
93
|
-
<div className="w-full max-w-sm rounded bg-paper border border-ink/10 p-6 shadow-xl text-ink">
|
|
92
|
+
<div className="fixed inset-0 z-50 flex items-center justify-center modal-scrim p-4">
|
|
93
|
+
<div className="glass-overlay w-full max-w-sm rounded bg-paper border border-ink/10 p-6 shadow-xl text-ink">
|
|
94
94
|
<h3 className="text-sm font-semibold">Install on iPhone / iPad</h3>
|
|
95
95
|
<p className="mt-2 text-xs opacity-80">
|
|
96
96
|
1. Tap the <strong>Share</strong> button in Safari toolbar.<br />
|
|
@@ -114,7 +114,7 @@ export function BrowserViewportSelector({
|
|
|
114
114
|
</button>
|
|
115
115
|
|
|
116
116
|
{dropdownOpen && (
|
|
117
|
-
<div className="absolute right-0 top-full mt-1 w-56 bg-paper border border-ink/15 rounded-lg shadow-xl py-1 z-50 text-xs font-mono">
|
|
117
|
+
<div className="glass-popover absolute right-0 top-full mt-1 w-56 bg-paper border border-ink/15 rounded-lg shadow-xl py-1 z-50 text-xs font-mono">
|
|
118
118
|
{/* Responsive Section */}
|
|
119
119
|
<div className="px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold">
|
|
120
120
|
Responsive Testing
|
|
@@ -131,7 +131,11 @@ export function AnchoredMenu({
|
|
|
131
131
|
ref={panelRef}
|
|
132
132
|
role={role}
|
|
133
133
|
aria-label={ariaLabel}
|
|
134
|
-
|
|
134
|
+
// `glass-popover` belongs to the PRIMITIVE, not to each caller: every
|
|
135
|
+
// menu this renders is an anchored floating panel, and the tier is inert
|
|
136
|
+
// in the classic look (all of its rules are `[data-surface="glass"]`), so
|
|
137
|
+
// a caller that forgets it is the only way a dropdown stays opaque.
|
|
138
|
+
className={`glass-popover fixed z-[70] overflow-y-auto overscroll-contain ${className}`}
|
|
135
139
|
style={style}
|
|
136
140
|
onClick={(event) => event.stopPropagation()}
|
|
137
141
|
>
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { useEffect, useRef } from 'preact/hooks';
|
|
20
|
+
import { CHECKBOX_CLASS } from '@/client/components/common/checkbox/style';
|
|
20
21
|
|
|
21
22
|
export interface SelectionCheckboxProps {
|
|
22
23
|
checked: boolean;
|
|
@@ -50,7 +51,7 @@ export function SelectionCheckbox({
|
|
|
50
51
|
aria-label={label}
|
|
51
52
|
onChange={onChange}
|
|
52
53
|
onClick={(event) => event.stopPropagation()}
|
|
53
|
-
className={
|
|
54
|
+
className={`${CHECKBOX_CLASS} shrink-0 accent-ink cursor-pointer ${
|
|
54
55
|
size === 'md' ? 'w-3.5 h-3.5' : 'w-3 h-3'
|
|
55
56
|
}`}
|
|
56
57
|
/>
|
|
@@ -47,10 +47,10 @@ afterEach(() => {
|
|
|
47
47
|
container?.remove();
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
function mount(className?: string): HTMLElement {
|
|
50
|
+
function mount(className?: string, glow = false): HTMLElement {
|
|
51
51
|
container = document.createElement('div');
|
|
52
52
|
document.body.appendChild(container);
|
|
53
|
-
render(h(BrandWordmark, className ? { className } : {}), container);
|
|
53
|
+
render(h(BrandWordmark, { ...(className ? { className } : {}), ...(glow ? { glow } : {}) }), container);
|
|
54
54
|
return container;
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -112,4 +112,15 @@ describe('BrandWordmark', () => {
|
|
|
112
112
|
expect(root.className).toContain('tracking-tight');
|
|
113
113
|
expect(root.className).toContain('font-extrabold');
|
|
114
114
|
});
|
|
115
|
+
|
|
116
|
+
test('the halo is opt-in and rides with the size, never instead of it', () => {
|
|
117
|
+
// The default (login screen, About dialog) is unchanged: the halo belongs
|
|
118
|
+
// to the four header surfaces that pass it.
|
|
119
|
+
const plain = mount().firstElementChild as HTMLElement;
|
|
120
|
+
expect(plain.className).not.toContain('brand-wordmark-glow');
|
|
121
|
+
const halo = mount('text-sm', true).firstElementChild as HTMLElement;
|
|
122
|
+
expect(halo.className).toContain('brand-wordmark-glow');
|
|
123
|
+
expect(halo.className).toContain('text-sm');
|
|
124
|
+
expect(halo.className).toContain('tracking-tight');
|
|
125
|
+
});
|
|
115
126
|
});
|
|
@@ -42,12 +42,23 @@
|
|
|
42
42
|
* `className` carries the SIZE (each surface sets its own) and nothing else: the
|
|
43
43
|
* colour split and the tracking are the brand and are not a per-call-site
|
|
44
44
|
* decision.
|
|
45
|
+
*
|
|
46
|
+
* `glow` adds the soft halo every HEADER surface wears — both layouts' sidebar
|
|
47
|
+
* headers and both top navbars — and nothing else does. It is a variant rather
|
|
48
|
+
* than another `className` value for the reason above: the effect is the same
|
|
49
|
+
* brand decision on all four, and a caller that spelled it itself would be the
|
|
50
|
+
* second copy this module exists to prevent. All four or none: the desktop
|
|
51
|
+
* draws its sidebar and its navbar side by side, so a wordmark that glowed in
|
|
52
|
+
* one and not the other would be two products on one screen. The halo is drawn
|
|
53
|
+
* by `.brand-wordmark-glow` in `tailwind.css`, which applies it on dark
|
|
54
|
+
* palettes only: on a near-black canvas the lockup needs the light, on paper a
|
|
55
|
+
* white glow would only muddy the ink it is drawn on.
|
|
45
56
|
*/
|
|
46
57
|
import { BrandMark } from '@/client/components/common/brand-wordmark/Mark';
|
|
47
58
|
|
|
48
|
-
export function BrandWordmark({ className = 'text-[15px]' }: { className?: string }) {
|
|
59
|
+
export function BrandWordmark({ className = 'text-[15px]', glow = false }: { className?: string; glow?: boolean }) {
|
|
49
60
|
return (
|
|
50
|
-
<span className={`font-extrabold tracking-tight ${className}`}>
|
|
61
|
+
<span className={`font-extrabold tracking-tight${glow ? ' brand-wordmark-glow' : ''} ${className}`}>
|
|
51
62
|
<BrandMark />
|
|
52
63
|
<span className="sr-only">K</span>
|
|
53
64
|
<span className="text-transparent bg-clip-text bg-gradient-to-r from-amber-500 to-orange-600" style={{ paddingRight: '0.06em', marginRight: '-0.06em' }}>ab</span>
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The checkbox's own contract: the class is applied everywhere, and the styles
|
|
8
|
+
* that make "on" and "off" readable exist.
|
|
9
|
+
*
|
|
10
|
+
* Both halves are pinned because they failed for different reasons. The MARKUP
|
|
11
|
+
* half is a count: 22 `<input type="checkbox">` call sites across the app, and a
|
|
12
|
+
* control that is styled in the sidebar but native in Settings is two controls
|
|
13
|
+
* that disagree about what a checkbox looks like. The CSS half is a measurement:
|
|
14
|
+
* the native unchecked box composited 1.10:1 against its row while the checked
|
|
15
|
+
* one was 10.84:1 — "checkbox gk kelihatan on off nya".
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { describe, expect, test } from 'bun:test';
|
|
19
|
+
import { Glob } from 'bun';
|
|
20
|
+
|
|
21
|
+
describe('checkbox', () => {
|
|
22
|
+
test('every checkbox input carries the shared class', async () => {
|
|
23
|
+
// The glob is rooted at the REPOSITORY, not at this folder: a path that
|
|
24
|
+
// resolves wrong walks zero files and every assertion passes vacuously —
|
|
25
|
+
// which is exactly what the first version of this test did.
|
|
26
|
+
//
|
|
27
|
+
// `Bun.fileURLToPath` and `new URL(file, repoUrl)`, never `URL.pathname`:
|
|
28
|
+
// on Windows the pathname is `/D:/a/kabmo/kabmo/`, which walks nothing —
|
|
29
|
+
// the same vacuous pass this comment warns about, arriving by another
|
|
30
|
+
// route. `Bun.fileURLToPath` rather than `node:url` because this module is
|
|
31
|
+
// under `src/`, where a `node:` import is not allowed.
|
|
32
|
+
const repoUrl = new URL('../../../../..', import.meta.url);
|
|
33
|
+
const repo = Bun.fileURLToPath(repoUrl);
|
|
34
|
+
const glob = new Glob('src/client/**/*.tsx');
|
|
35
|
+
const offenders: string[] = [];
|
|
36
|
+
for await (const file of glob.scan({ cwd: repo })) {
|
|
37
|
+
if (file.includes('.test.')) continue;
|
|
38
|
+
// Comments first: `SelectionCheckbox` documents itself with the literal
|
|
39
|
+
// markup (`A native <input type="checkbox"> rather than a styled span`),
|
|
40
|
+
// and a scanner that reads prose reports the file that explains the rule.
|
|
41
|
+
const source = (await Bun.file(new URL(file, repoUrl)).text())
|
|
42
|
+
.replace(/\/\*[\s\S]*?\*\//g, '')
|
|
43
|
+
.replace(/^\s*\/\/.*$/gm, '');
|
|
44
|
+
if (!source.includes('type="checkbox"')) continue;
|
|
45
|
+
// Every `<input … type="checkbox" … />` element must name the class; the
|
|
46
|
+
// primitive itself imports the constant rather than spelling it.
|
|
47
|
+
const inputs = source.split('<input').filter((chunk) => chunk.includes('type="checkbox"'));
|
|
48
|
+
for (const chunk of inputs) {
|
|
49
|
+
const tag = chunk.slice(0, chunk.indexOf('/>') + 2);
|
|
50
|
+
if (!tag.includes('CHECKBOX_CLASS') && !tag.includes('kabmo-checkbox')) {
|
|
51
|
+
offenders.push(`${file}: ${tag.slice(0, 60).replace(/\s+/g, ' ')}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
expect(offenders).toEqual([]);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test('the styles state all three states in palette tokens', async () => {
|
|
59
|
+
const css = await Bun.file(new URL('../../../tailwind.css', import.meta.url)).text();
|
|
60
|
+
// The recipe lives in `@layer components`, NOT unlayered: an unlayered
|
|
61
|
+
// `width` beat every call site's `w-4`, so six Settings rows collapsed to the
|
|
62
|
+
// border box ("4x4"). A layer loses to utilities, which is the whole point.
|
|
63
|
+
const layer = css.slice(css.indexOf('@layer components {'), css.indexOf('/* Dot grain texture'));
|
|
64
|
+
expect(layer).toContain('.kabmo-checkbox {');
|
|
65
|
+
expect(layer).toContain('appearance: none;');
|
|
66
|
+
// A DEFAULT size, because `appearance: none` removes the intrinsic one.
|
|
67
|
+
expect(layer).toContain('width: 0.875rem;');
|
|
68
|
+
|
|
69
|
+
// The ring's alpha is a contrast budget: `ink 75%` is the first alpha whose
|
|
70
|
+
// worst case over all 63 palettes clears WCAG's 3:1 non-text floor
|
|
71
|
+
// (3.02:1 on solarized-light); 40% measured 1.71:1, which was the bug. The
|
|
72
|
+
// COLOURED ring below clears 3.56:1 on the same sweep. 2px
|
|
73
|
+
// rather than 1.5px because a half-pixel border antialiases into a 50% blend
|
|
74
|
+
// and the intended alpha never reaches the screen.
|
|
75
|
+
expect(layer).toContain('border: 2px solid color-mix(in srgb, var(--theme-ink) 75%, transparent);');
|
|
76
|
+
// Checked is the full ink, so the tick is `paper` — the palette's own pair.
|
|
77
|
+
expect(layer).toContain('.kabmo-checkbox:checked,');
|
|
78
|
+
expect(layer).toContain('background-color: var(--theme-ink);');
|
|
79
|
+
// The tick is a MASK, not a glyph: a glyph would inherit the row's text
|
|
80
|
+
// colour, and these rows set `text-ink/NN` for their own reasons.
|
|
81
|
+
expect(layer).toContain('background-color: var(--theme-paper);');
|
|
82
|
+
expect(layer).toContain('mask: center / contain no-repeat');
|
|
83
|
+
expect(layer).toContain('.kabmo-checkbox:indeterminate::after {');
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test('the colour mode states on as green and off as red, and mono does not', async () => {
|
|
87
|
+
const css = await Bun.file(new URL('../../../tailwind.css', import.meta.url)).text();
|
|
88
|
+
// The colour mode is the one place a user asks for chroma, so the states are
|
|
89
|
+
// colour there. Both are MIXED TOWARD THE INK, which is a contrast budget:
|
|
90
|
+
// at full strength the ring measured 2.73:1 and the fill 1.75:1 worst case
|
|
91
|
+
// over the 63 palettes, both under the 3:1 non-text floor; 75%/55% clear
|
|
92
|
+
// 3.56:1 (`solarized-dark`) and 3.63:1 (`nord-light`) on the real chrome
|
|
93
|
+
// composite, and the tick's `paper` clears 3.59:1 on the same fill.
|
|
94
|
+
expect(css).toContain('[data-icon-style="color"] .kabmo-checkbox {\n border-color: color-mix(in srgb, var(--theme-error) 75%, var(--theme-ink));');
|
|
95
|
+
expect(css).toContain('background-color: color-mix(in srgb, var(--theme-success) 55%, var(--theme-ink));');
|
|
96
|
+
// Hover stops at 85%, not the raw error colour: at 100% the ring drops to
|
|
97
|
+
// 2.77:1 on `mono-light`, i.e. the highlight would be less legible than the
|
|
98
|
+
// idle state it is meant to emphasise.
|
|
99
|
+
expect(css).toContain('border-color: color-mix(in srgb, var(--theme-error) 85%, var(--theme-ink));');
|
|
100
|
+
// Gated on the attribute: monochrome has no colour to state a state with, so
|
|
101
|
+
// it keeps the ink pair the base layer declares.
|
|
102
|
+
expect(css).not.toContain(':root:not([data-icon-style="color"]) .kabmo-checkbox {');
|
|
103
|
+
const mono = css.slice(0, css.indexOf('[data-icon-style="color"] .kabmo-checkbox'));
|
|
104
|
+
expect(mono).toContain('background-color: var(--theme-ink);');
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The switch knob is a SHAPE, and `bg-canvas` is the app's ground.
|
|
110
|
+
*
|
|
111
|
+
* Under the glass surface a canvas well goes transparent — correct for a chat
|
|
112
|
+
* well, fatal for a knob: measured on the plugin switches in dark, the 12px knob
|
|
113
|
+
* composited to `rgba(0,0,0,0)` and the control rendered as a plain pill with no
|
|
114
|
+
* "on" position at all. The mark is the switch ROLE, so any control that declares
|
|
115
|
+
* itself a switch owns its knob whatever it paints it with.
|
|
116
|
+
*/
|
|
117
|
+
describe('switch knob', () => {
|
|
118
|
+
test('the switch track states on/off in the same two colours as the checkbox', async () => {
|
|
119
|
+
const css = await Bun.file(new URL('../../../tailwind.css', import.meta.url)).text();
|
|
120
|
+
// Keyed on the ROLE and `aria-checked`, not a class: six call sites paint the
|
|
121
|
+
// track with five different utilities, and none of them is the fact "on".
|
|
122
|
+
expect(css).toContain('[data-icon-style="color"] [role="switch"][aria-checked="true"] {');
|
|
123
|
+
expect(css).toContain('background-color: color-mix(in srgb, var(--theme-success) 55%, var(--theme-ink));');
|
|
124
|
+
expect(css).toContain('[data-icon-style="color"] [role="switch"][aria-checked="false"] {');
|
|
125
|
+
expect(css).toContain('background-color: color-mix(in srgb, var(--theme-error) 75%, var(--theme-ink));');
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
test('a knob on a switch keeps its fill under the glass surface', async () => {
|
|
129
|
+
const glass = await Bun.file(new URL('../../../glass.css', import.meta.url)).text();
|
|
130
|
+
// The exemption lives INSIDE the well rule, as an `:not()`. It was a second
|
|
131
|
+
// rule first ("…except a knob on a switch"), and that rule never applied:
|
|
132
|
+
// `[role="switch"] .bg-canvas` is (0,4,0) against the well's (0,5,0), so the
|
|
133
|
+
// well won and every knob computed `rgba(0,0,0,0)` — a plain pill with no
|
|
134
|
+
// "on" position, on both layouts.
|
|
135
|
+
const start = glass.indexOf('[data-surface="glass"] .app-window .bg-canvas');
|
|
136
|
+
expect(start).toBeGreaterThan(-1);
|
|
137
|
+
const selector = glass.slice(start, glass.indexOf('{', start));
|
|
138
|
+
expect(selector).toContain(':not([role="switch"] *)');
|
|
139
|
+
// A same-property override anywhere would be the same race again.
|
|
140
|
+
expect(glass).not.toContain('[data-surface="glass"] .app-window [role="switch"] .bg-canvas');
|
|
141
|
+
});
|
|
142
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The checkbox, drawn by us instead of by the engine.
|
|
8
|
+
*
|
|
9
|
+
* A native `<input type="checkbox">` with `accent-color` is the right CONTROL —
|
|
10
|
+
* it carries checked/indeterminate, keyboard behaviour and the announcement for
|
|
11
|
+
* free — but its rendering is the platform's, and the platform disagrees with
|
|
12
|
+
* this app about what "on" and "off" look like:
|
|
13
|
+
*
|
|
14
|
+
* - **The unchecked box is nearly invisible.** Measured in the session sidebar
|
|
15
|
+
* (batch selection), the unchecked box composited to `(236,238,235)` on a
|
|
16
|
+
* `(250,248,242)` row — **1.10:1** — while the checked one was 10.84:1. Two
|
|
17
|
+
* states 10 points apart in luminance are not a control you can read; the
|
|
18
|
+
* report was "checkbox gk kelihatan on off nya".
|
|
19
|
+
* - **The checked box is the platform's accent**, not the palette's: Chromium
|
|
20
|
+
* paints `accent-color` as a FILL and then whichever glyph it likes, so the
|
|
21
|
+
* tint tracks `--theme-ink` here but the tick colour, the corner radius and the
|
|
22
|
+
* size are the engine's.
|
|
23
|
+
* - **The indeterminate dash** is a property with no attribute equivalent, so a
|
|
24
|
+
* styled span could not carry it anyway.
|
|
25
|
+
*
|
|
26
|
+
* So the input STAYS (same semantics, same `indeterminate` assignment) and only
|
|
27
|
+
* its box is replaced: `appearance: none` plus a pseudo-element that states each
|
|
28
|
+
* state explicitly, in palette tokens.
|
|
29
|
+
*
|
|
30
|
+
* **The numbers are a contrast budget, not taste.** The unchecked ring needs 3:1
|
|
31
|
+
* against the surface it sits on — WCAG's non-text floor, the same one the brand
|
|
32
|
+
* marks use — and a `text-ink/NN` alpha is the only way to reach it on every
|
|
33
|
+
* palette: measured across all 43, `ink 75%` is the first alpha whose worst case
|
|
34
|
+
* clears the floor (3.02:1 on `solarized-light`); 60% is 2.34:1 and 40% — the
|
|
35
|
+
* `border-ink/30` these controls shipped with — is **1.71:1**. The checked fill
|
|
36
|
+
* is the full ink, which makes the tick `paper`, so the pair is the palette's
|
|
37
|
+
* own `ink`/`paper` contrast: 4.85:1 worst case, 17.5:1 on `paper`.
|
|
38
|
+
*
|
|
39
|
+
* `accent-color` is left set as well: a browser that cannot draw the
|
|
40
|
+
* pseudo-element still gets the platform control rather than a blank square.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* `appearance: none` plus a state pseudo-element, in ONE class so 22 call sites
|
|
45
|
+
* cannot drift into 22 slightly different boxes.
|
|
46
|
+
*
|
|
47
|
+
* The rules live in `tailwind.css` (`.kabmo-checkbox`) rather than here because
|
|
48
|
+
* they are CSS-only facts about a state selector — `checked`, `indeterminate`,
|
|
49
|
+
* `disabled` — that no component can express.
|
|
50
|
+
*/
|
|
51
|
+
export const CHECKBOX_CLASS = 'kabmo-checkbox';
|
|
@@ -99,8 +99,8 @@ export function ContextUsageButton({ sessionId, layout = 'desktop' }: ContextUsa
|
|
|
99
99
|
aria-label="Context usage"
|
|
100
100
|
className={
|
|
101
101
|
layout === 'mobile'
|
|
102
|
-
? 'fixed z-50 bg-paper border border-ink/20 rounded-xl shadow-xl p-3 text-xs font-mono'
|
|
103
|
-
: 'absolute right-0 top-full z-50 mt-2 w-56 bg-paper border border-ink/20 rounded-xl shadow-xl p-3 text-xs font-mono'
|
|
102
|
+
? 'glass-popover fixed z-50 bg-paper border border-ink/20 rounded-xl shadow-xl p-3 text-xs font-mono'
|
|
103
|
+
: 'glass-popover absolute right-0 top-full z-50 mt-2 w-56 bg-paper border border-ink/20 rounded-xl shadow-xl p-3 text-xs font-mono'
|
|
104
104
|
}
|
|
105
105
|
style={
|
|
106
106
|
layout === 'mobile'
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
FolderOpen,
|
|
12
12
|
} from 'lucide-preact';
|
|
13
13
|
import type { ReactNode } from 'preact/compat';
|
|
14
|
-
import { BRAND_ICONS, BRAND_VIEWBOX, type BrandIconName } from '@/
|
|
14
|
+
import { BRAND_ICONS, BRAND_VIEWBOX, type BrandIconName } from '@/shared/lib/icons/file-brand-paths';
|
|
15
15
|
import { getImageMimeType } from '@/shared/lib/fs/file-kind';
|
|
16
16
|
|
|
17
17
|
interface FileIconProps {
|
|
@@ -22,9 +22,18 @@ interface FileIconProps {
|
|
|
22
22
|
className?: string;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
/**
|
|
26
|
+
* A brand icon rendered from static path data.
|
|
27
|
+
*
|
|
28
|
+
* The paint is CSS, not a prop: the mark is always `fill="currentColor"` and
|
|
29
|
+
* carries `data-file-brand`, which `icon-paint-css.ts` colours under
|
|
30
|
+
* `[data-icon-style="color"]` (and leaves ink otherwise). That is what makes the
|
|
31
|
+
* setting reach 30-odd call sites without a prop at any of them.
|
|
32
|
+
*
|
|
33
|
+
* `monochrome` is the explicit OPT-OUT, for a surface that must stay free of
|
|
34
|
+
* chroma whatever the setting says — the chat's tool cards, where a coloured
|
|
35
|
+
* logo beside every tool name would compete with the tool's own state colour.
|
|
36
|
+
*/
|
|
28
37
|
function BrandIconSvg({ name, size, className, monochrome = false }: { name: BrandIconName; size: number; className?: string; monochrome?: boolean }) {
|
|
29
38
|
const brand = BRAND_ICONS[name];
|
|
30
39
|
return (
|
|
@@ -32,7 +41,8 @@ function BrandIconSvg({ name, size, className, monochrome = false }: { name: Bra
|
|
|
32
41
|
viewBox={BRAND_VIEWBOX}
|
|
33
42
|
width={size}
|
|
34
43
|
height={size}
|
|
35
|
-
fill=
|
|
44
|
+
fill="currentColor"
|
|
45
|
+
data-file-brand={monochrome ? undefined : name}
|
|
36
46
|
className={className}
|
|
37
47
|
aria-hidden="true"
|
|
38
48
|
>
|
|
@@ -126,7 +136,7 @@ export function FileIcon({ name, isFolder, isOpen, size = 14, className = '' }:
|
|
|
126
136
|
}
|
|
127
137
|
|
|
128
138
|
if (lowerName.endsWith('.json')) {
|
|
129
|
-
return <Braces size={size}
|
|
139
|
+
return <Braces size={size} className={className} />;
|
|
130
140
|
}
|
|
131
141
|
if (lowerName.endsWith('.css') || lowerName.endsWith('.scss')) {
|
|
132
142
|
return <BrandIconSvg name="Css" size={size} className={className} />;
|
|
@@ -138,11 +148,15 @@ export function FileIcon({ name, isFolder, isOpen, size = 14, className = '' }:
|
|
|
138
148
|
// document icon for PDF/Word. Each has a viewer behind it, so the glyph is
|
|
139
149
|
// what tells a user at a glance that the file opens as something other than
|
|
140
150
|
// source text.
|
|
151
|
+
// These four used to carry inline hexes (`#22c55e`, `#f97316`, `#c084fc`),
|
|
152
|
+
// which made them the only icons in the app that ignored BOTH modes. Their
|
|
153
|
+
// hue is now a role in `shared/lib/icons/tint.ts`, so the palette decides it
|
|
154
|
+
// and `monochrome` finally reaches them.
|
|
141
155
|
if (lowerName.endsWith('.csv') || lowerName.endsWith('.tsv') || lowerName.endsWith('.xlsx') || lowerName.endsWith('.xlsm')) {
|
|
142
|
-
return <FileSpreadsheet size={size}
|
|
156
|
+
return <FileSpreadsheet size={size} className={className} />;
|
|
143
157
|
}
|
|
144
158
|
if (lowerName.endsWith('.pdf') || lowerName.endsWith('.docx')) {
|
|
145
|
-
return <FileType size={size}
|
|
159
|
+
return <FileType size={size} className={className} />;
|
|
146
160
|
}
|
|
147
161
|
if (lowerName.endsWith('.md') || lowerName.endsWith('.txt')) {
|
|
148
162
|
return <FileText size={size} className={`text-ink/70 ${className}`} />;
|
|
@@ -150,7 +164,7 @@ export function FileIcon({ name, isFolder, isOpen, size = 14, className = '' }:
|
|
|
150
164
|
// SVG is text the editor edits as code, but it is still a picture to the eye,
|
|
151
165
|
// so the icon stays the image glyph for it.
|
|
152
166
|
if (getImageMimeType(lowerName) || lowerName.endsWith('.svg')) {
|
|
153
|
-
return <FileImage size={size}
|
|
167
|
+
return <FileImage size={size} className={className} />;
|
|
154
168
|
}
|
|
155
169
|
if (lowerName.endsWith('.sh') || lowerName.endsWith('.bash')) {
|
|
156
170
|
return <BrandIconSvg name="Gnubash" size={size} className={className} />;
|
|
@@ -111,7 +111,7 @@ export function HeaderMoreMenu({ entries = [] }: { entries?: HeaderEntry[] }) {
|
|
|
111
111
|
{open && (
|
|
112
112
|
<div
|
|
113
113
|
role="menu"
|
|
114
|
-
className="absolute right-0 top-full mt-1 w-44 bg-paper border border-ink/15 rounded-xl shadow-lg z-50 py-1 text-xs"
|
|
114
|
+
className="glass-popover absolute right-0 top-full mt-1 w-44 bg-paper border border-ink/15 rounded-xl shadow-lg z-50 py-1 text-xs"
|
|
115
115
|
>
|
|
116
116
|
<button
|
|
117
117
|
type="button"
|
|
@@ -70,7 +70,7 @@ export function ReviewPopover({ block, verdict, note, anchor, onSave, onRemove,
|
|
|
70
70
|
aria-label={`Review block ${rangeOf(block)}`}
|
|
71
71
|
// `fixed`, from the click's own rectangle — see the module note.
|
|
72
72
|
style={{ top: `${anchor.top}px`, left: `${anchor.left}px` }}
|
|
73
|
-
className="fixed z-[65] w-[min(24rem,calc(100vw-2rem))] rounded-md border border-ink/15 bg-paper shadow-lg p-2 font-sans text-[11.5px] text-ink"
|
|
73
|
+
className="glass-popover fixed z-[65] w-[min(24rem,calc(100vw-2rem))] rounded-md border border-ink/15 bg-paper shadow-lg p-2 font-sans text-[11.5px] text-ink"
|
|
74
74
|
onClick={(event) => event.stopPropagation()}
|
|
75
75
|
>
|
|
76
76
|
<div className="flex items-center gap-1.5 text-[10.5px] font-mono text-ink/50">
|