molecule-core/canvas/src/components
hongmingwang 43844e0af0
Some checks failed
Secret scan / Scan diff for credential-shaped strings (pull_request) Failing after 2s
sop-tier-check / tier-check (pull_request) Failing after 2s
feat(canvas): mobile-first shell with 6-screen iOS design + responsive desktop fixes
Implements the Claude Design handoff (Molecules AI Mobile.html) as a
viewport-gated React tree under canvas/src/components/mobile/. < 640px
renders the new shell instead of the desktop ReactFlow canvas.

Six screens, all bound to live store data:
- Home (agent list + filter chips + spawn FAB)
- Canvas (mini-graph with pinch-to-zoom + pan + reset)
- Detail (status pills, tabs: Overview / Activity / Config / Memory;
  Activity hits /workspaces/:id/activity)
- Chat (textarea composer, IME-safe Enter, sendInFlightRef guard;
  bootstraps from agentMessages so the prior thread shows on entry)
- Comms (live A2A feed via /workspaces/:id/activity + ACTIVITY_LOGGED)
- Spawn (bottom sheet; fetches /templates so users pick what's actually
  installed on their platform)

Plus a Me tab for mobile theme/accent/density.

Design system (palette.ts + primitives.tsx) ports tokens 1:1 from the
handoff: cream + dark palettes, T1-T4 tier chips, status dots with
halo, JetBrains Mono for IDs/timestamps. Inter + JetBrains Mono are
self-hosted via next/font/google so CSP `font-src 'self'` is honoured.

URL routing: routes sync to ?m=<route>&a=<id>; popstate restores route;
deep links seed initial state. /?m=detail without ?a collapses to home.

Accent override flows through React context (MobileAccentProvider) —
not by mutating the static MOL_LIGHT/MOL_DARK singletons.

SSR flash: isMobile is tri-state; loading spinner stays up until
matchMedia resolves so mobile devices never paint the desktop tree.

Desktop responsiveness fixes (separate but ride along):
- Toolbar: full-width with overflow-x-auto on mobile, logo text + count
  hidden < sm, divider/border collapse to sm: only.
- SidePanel: full-screen on mobile via matchMedia, resize handle hidden.
- Canvas: MiniMap hidden < sm (was overlapping the New Workspace FAB).

Tests (51 total, 33 new):
- palette.test.ts (12) - normalizeStatus, tierCode, light/dark parity
- components.test.ts (10) - toMobileAgent field mapping + classifyForFilter
- MobileApp.test.tsx (12) - route stack, deep links, popstate, tab bar
  hidden on chat, spawn overlay
- SidePanel.tabs.test.tsx (18) - regression-clean

Verified: tsc --noEmit clean across mobile/, page.tsx, layout.tsx.
Not yet verified: live phone browser (needs CP backend hydrated).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 06:06:24 -07:00
..
__tests__ Merge pull request 'test(canvas): add pure-function tests for runtimeProfiles, getIcon, and createMessage' (#235) from test/canvas-runtimeprofiles-tests into main 2026-05-10 05:03:47 +00:00
canvas fix(canvas): correct KeyboardShortcutsDialog descriptions + fix min-clamp test expectations 2026-05-10 00:01:40 +00:00
mobile feat(canvas): mobile-first shell with 6-screen iOS design + responsive desktop fixes 2026-05-10 06:06:24 -07:00
settings fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
tabs fix(canvas): toYaml always emits tools: [] and serializes nested lists 2026-05-10 11:05:02 +00:00
ui fix(canvas/a11y): add aria-hidden to 6 decorative SVGs + aria-label to OrgTokensTab input 2026-04-24 12:40:52 +00:00
A2ATopologyOverlay.tsx feat(canvas): A2ATopologyOverlay subscribes to ACTIVITY_LOGGED — drop 60s polling 2026-05-07 15:17:19 -07:00
ApprovalBanner.tsx fix(canvas): ApprovalBanner Approve/Deny button polish 2026-05-03 12:56:00 -07:00
AuditTrailPanel.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
AuthGate.tsx feat(canvas): warm-paper theme + Tailwind v4 migration 2026-05-03 01:43:55 -07:00
BatchActionBar.tsx canvas/BatchActionBar: wire Esc to clear selection (matches button title) 2026-05-03 16:31:23 -07:00
BundleDropZone.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
Canvas.tsx feat(canvas): mobile-first shell with 6-screen iOS design + responsive desktop fixes 2026-05-10 06:06:24 -07:00
CommunicationOverlay.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
ConfirmDialog.tsx fix(canvas): ConfirmDialog hover + focus polish 2026-05-03 12:28:24 -07:00
ConsoleModal.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
ContextMenu.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
ConversationTraceModal.tsx Revert "Re-export extractMessageText for ConversationTraceModal tests" 2026-05-10 03:29:46 +00:00
CookieConsent.tsx canvas/CookieConsent: stop pretending to be a modal + fix link/button focus 2026-05-03 15:37:06 -07:00
CreateWorkspaceDialog.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
DeleteCascadeConfirmDialog.tsx canvas/DeleteCascadeConfirmDialog: fix Cancel no-op hover + Delete light hover + focus rings 2026-05-03 17:53:29 -07:00
EmptyState.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
ErrorBoundary.tsx fix(canvas): restore text-white on saturated buttons + close zinc gaps 2026-05-03 02:04:20 -07:00
ExternalConnectModal.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
KeyboardShortcutsDialog.tsx fix(canvas): correct KeyboardShortcutsDialog descriptions + fix min-clamp test expectations 2026-05-10 00:01:40 +00:00
Legend.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
MemoryInspectorPanel.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
MissingKeysModal.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
OnboardingWizard.tsx canvas/OnboardingWizard: theme-flip colors + fix hover traps + focus rings 2026-05-03 18:49:19 -07:00
OrgImportPreflightModal.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
PricingTable.tsx fix(canvas): restore text-white on saturated buttons + close zinc gaps 2026-05-03 02:04:20 -07:00
ProviderModelSelector.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
ProvisioningTimeout.tsx fix(canvas): restore text-white on saturated buttons + close zinc gaps 2026-05-03 02:04:20 -07:00
PurchaseSuccessModal.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
SearchDialog.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
SidePanel.tsx feat(canvas): mobile-first shell with 6-screen iOS design + responsive desktop fixes 2026-05-10 06:06:24 -07:00
Spinner.tsx fix(canvas): address all code review findings on PR #482 2026-04-16 07:48:47 -07:00
StatusDot.tsx fix(canvas): a11y fixes + budget_used TypeScript guard + orgs-page test fix (#1367) 2026-04-21 11:08:24 +00:00
TemplatePalette.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
TermsGate.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
ThemeToggle.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00
Toaster.tsx canvas/Toaster: add Esc dismiss + focus-visible ring + larger touch target 2026-05-03 13:55:24 -07:00
Toolbar.tsx feat(canvas): mobile-first shell with 6-screen iOS design + responsive desktop fixes 2026-05-10 06:06:24 -07:00
Tooltip.tsx a11y(canvas): Tooltip Esc-to-dismiss (WCAG 1.4.13) 2026-05-03 13:23:08 -07:00
WorkspaceNode.tsx feat(canvas): keyboard-accessible edge anchors via Enter/Space 2026-05-09 22:52:33 +00:00
WorkspaceUsage.tsx fix(canvas): text-ink-soft → text-ink-mid for WCAG AA contrast 2026-05-09 23:18:14 +00:00