Skip to content

Workbench redesign — Stage 1: Build the shell #373

Closed

Description

@nockawa

Execution plan: claude/design/Apps/Workbench/stages/stage-1-shell.md · Runways: 08-api-evolution.md, 09-shell-evolution.md · depends on #372 (Stage 0).

Goal: Bring the shell — zones A · B · C · E · F(logs) · G + the cross-cutting infra — to target, built clean (not strangler-migrated under live views), validated by a load-a-file slice across Open / Trace / Attach. No zone-D deep views.

Exit gate: the load-a-file slice (below) is green for all three session kinds, and the conformance suites pass.

Build order (dependency sequence)

  • 1. Selection bus (keystone) — extend useSelectionStore to the object model; write-through + recency + projection laws; strangler: mirror the siloed stores (profiler/dbmap/dataBrowser) → bus, then retire. (GAP-05)
  • 2. Right-rail Inspector — card registry off the bus + the containment context stack. (GAP-05 consumer, GAP-03 de-stub)
  • 3. Navigators — Resource Tree (Open) + Systems & Queries Navigator (Trace/Attach) + per-kind data loading; selection → bus. (GAP-01 nav)
  • 4. Context bar — identity · scope · breadcrumb · env tag. (GAP-07/11/23)
  • 5. Command palette — prefix routing (>/@/#/:/?) + object resolution over the bus. (GAP-08/09)
  • 6. Nav history + deep links — every bus change pushes; URL round-trip. (GAP-06)
  • 7. Keyboard & focus — F6 via dockview moveToNext; :focus-visible ring + active-panel; roving in navigator/inspector; focus-follows-navigation. (GAP-10, PC-8, DS-4)
  • 8. Session model — unify Welcome+Connect; switch-without-close + clear cache; blocked-state diagnostics. (GAP-12a, GAP-13)
  • 9. Cross-cutting infra — use202Query + <ViewState> (PC-2); density + focus tokens (DS-1/DS-4); Logs drawer carrying engine/trace log events. (closed with exit gate met; see closing note for the deferred remainder.)

Integration milestone — the load-a-file slice

  • For each of Open / Trace / Attach: load → navigator (C) + context bar (B) + status (G) populate; select a navigator item → bus → right-rail Inspector (E) card (+ context stack); F6/focus, palette object-resolution, nav-history back, and a deep link all work — with no zone-D view.

Acceptance criteria (each ↔ a conformance suite or the slice E2E; all must be green)

  • AC1.1 Bus laws — write-through per type · idempotence · recency=leaf · projection≠leaf · containment (suite A).
  • AC1.2 Nav history & deep links — push on every bus change; back/forward; URL round-trip (suite B).
  • AC1.3 Palette — prefix routing; object resolution per type; session-kind filtering (suite C).
  • AC1.4 Keyboard & focus — F6 cycling; single-tab-stop + roving (navigator/inspector); Esc; focus-follows-navigation; focus≠selection; no trap (suite F).
  • AC1.5 Focus visuals & color — :focus-visible ring; one active-panel indicator; stable hue-per-object; onColor AA (suites F/G).
  • AC1.6 State set — loading(202)/empty/error/no-selection on every shell surface (suite D).
  • AC1.7 No broken affordances (suite E).
  • AC1.8 Density — switching density re-measures virtualized lists (suite H).
  • AC1.9 Load-a-file slice passes E2E for Open, Trace, and Attach (headline gate).
  • AC1.10 Session switch-without-close clears cache; no cross-session bleed.
  • AC1.11 Context bar shows identity/scope/breadcrumb per kind; env tag tints chrome.
  • AC1.12 Blocked states (incompatible/migration) show a diagnostic + a forward action, not just "close".

Risks / out of scope

  • Strangler order: mirror old→bus before retiring any silo; the Inspector is the only consumer to flip (09-shell-evolution.md).
  • Single-session sweep (~175 sessionId reads) is mechanical for switch-without-close; multi-session is deferred (Compare/Diff).
  • Build focus on dockview moveToNext/onDidActivePanelChange; override the default active-group accent for DS-4 (views/shell-and-dockview.md).
  • Don't go fully dark — the load-a-file slice (navigator + inspector) keeps the shell continuously validated.
  • Out of scope: zone-D deep views (Stages 2–4), multi-session, write/edit, engine-gated data (index find, source attribution, real revision).

Activity

  1. moved this to Backlog in Typhon devon May 23, 2026
  2. moved this from Backlog to In Progress in Typhon devon May 23, 2026
  3. nockawa commented on May 23, 2026

    @nockawa
    CollaboratorAuthor

    Accepted implementation plan (Stage 1)

    Scope: whole stage, executed in 3 dependency-ordered phases, each ending at a review hand-off. The shell spine is half-built (9-slot useSelectionStore, useNavHistoryStore, selectionUrlSync, 5-source recency in DetailPanel, navigator data hooks all exist) — so this is largely rationalize + extend. Client-only; no API deltas.

    Phase 1 — Bus + Inspector + Navigators (now)

    • Extend useSelectionStore with typed leaf slots for the still-siloed selections (profiler/dbmap/dataBrowser/field) + selectLeaf (recency) + project() (projection≠leaf) + resolveChain (containment); strangler-mirror the 4 silos into the bus (parity-guarded).
    • Refactor DetailPanel → card-registry Inspector + context stack (leaf full + ancestor summaries), bus-driven, real-verbs-only footer.
    • Systems & Queries Navigator (new, Trace/Attach) reusing useProfilerMetadata.systems + useQueryDefinitions; wire navigators → bus.
    • Tests: conformance suite A (bus laws) + Inspector dispatch + navigator + partial load→inspect slice E2E.

    Phase 2 — Context bar + Palette prefix routing + Nav-history/deep-links (suites B, C).
    Phase 3 — Keyboard/focus + Session switch-without-close + infra (use202Query/<ViewState>/density) → completes the load-a-file slice ×3 (AC1.9) (suites D, F, G, H).

    AC1.1–1.12 each map to a conformance suite or the slice E2E (table in the plan). Strangler order (mirror→flip Inspector→retire) and the continuous load-a-file slice are the safety rails. Hand off "ready for review + commit" at each phase boundary.

  4. nockawa commented on May 23, 2026

    @nockawa
    CollaboratorAuthor

    Phase 1 complete — Bus + Inspector + Navigators ✅ (ready for review + commit)

    Build-order steps 1-3 done on feature/wb-revamp (client-only, 9 files changed + 5 new).

    1. Selection bus (keystone) — useSelectionStore gains a recency-stamped leaf ({type, ref, touchedAt}) across all 17 object types, select() (primary) vs the existing scalar setters (projection), clearLeaf; new selectionChain.ts resolveChain() for containment ancestors. All five silos (profiler/dbmap/dataBrowser/schema-component+field/resource) strangler-mirror into the bus leaf (parity-guarded; silos retained as detail-holders).

    2. Right-rail Inspector — DetailPanel refactored from 5-silo recency arbitration into a bus-driven card registry + context stack (leaf in full + collapsible ancestor summaries) + pin; reuses every existing detail body. Handoff footer intentionally omitted (PC-6: no dead verbs while deep panels are gated — returns with them in Stages 2-4).

    3. Navigators — new Systems & Queries Navigator (zone C, Trace/Attach) reusing useProfilerMetadata.systems + useQueryDefinitions, wired into DockHost's trace/attach left edge; Resource Tree (Open) already feeds the bus. Layout-store key bumped v5 → v6.

    Acceptance criteria — Phase 1

    • AC1.1 — Bus laws ✅ conformance suite A (selectionBus.test.ts, 13 tests): write-through per type · idempotence · recency=leaf · projection≠leaf · containment chain · mirror-parity.
    • AC1.6 / AC1.7 ✅ (for the shell surfaces built) — Inspector empty/loading + PC-6 audit (Inspector.test.tsx, 5 tests); navigator loading/empty/error states.
    • AC1.9 — load-a-file slice ✅ Open kind (slice-load-inspect.spec.ts): load → navigator → bus → Inspector card. (Trace/Attach complete in Phase 3.)
    • AC1.2–1.5, 1.8, 1.10–1.12 → Phases 2-3.

    Verification

    tsc ✓ · eslint ✓ · vite build ✓ · Vitest 936 pass (+18 new) · Playwright slice + Stage-0 specs 6 pass.

    Next: Phase 2 (context bar + palette prefix routing + nav-history/deep-links). Handing off Phase 1 for review + commit.

  5. nockawa commented on May 23, 2026

    @nockawa
    CollaboratorAuthor

    Phase 2 complete — Context bar + Palette routing + Nav-history/deep-links ✅

    Build-order steps 4-6 done on feature/wb-revamp.

    4. Context bar (zone B) — new ContextBar.tsx between menu and workspace: connection-dot identity + session kind, scope (@HEAD for Open, ⟮ start–end ⟯ time window for Trace/Attach), breadcrumb mirroring the Inspector chain off the bus (each crumb navigates the bus up the chain), and a per-file environment tag (useEnvTagStore, persisted) that tints the bar.

    5. Palette prefix routing — CommandPalette now routes ''/> (commands) · @/# (object resolution) · : (jump to tick/page) · ? (help). New pure paletteRouting.ts (parsePaletteMode/parseJump) + objectHits.ts (buildObjectHits) resolve objects across resources/components/archetypes/systems/queries → bus select, session-kind filtered (no Systems in Open, no Resources in Trace, etc.).

    6. Nav-history + deep links — a generic bus-leaf nav entry records every selection (closing the old G9 gap where schema/data selections never entered history); back/forward re-drive the source store. A new ?leaf=type:ref URL param round-trips the navigator-object leaf (system/component/archetype); installNavHistorySync wired into bootstrap.

    Acceptance criteria — Phase 2

    • AC1.2 — Nav history & deep links ✅ conformance suite B (navHistory.test.ts, 7): push-per-change · back/forward restore · capacity 100 · ?leaf= round-trip.
    • AC1.3 — Palette ✅ conformance suite C (paletteRouting.test.ts, 8): prefix routing · jump parse · object resolution per type · group order · session-kind filtering.
    • AC1.11 — Context bar ✅ ContextBar.test.tsx (4): identity/scope, trace window, breadcrumb navigation, env-tag persist+tint.

    Verification

    tsc ✓ · eslint ✓ · vite build ✓ · Vitest 955 pass (+19 across Phases 1-2) · Playwright slice + Stage-0 specs pass (the one red resource-tree-polish Ctrl+/ test is pre-existing, unrelated — StatusBar/keyboard untouched).

    Next: Phase 3 — keyboard/focus (F6, roving, DS-4) + session switch-without-close + infra (use202Query/<ViewState>/density) → completes the load-a-file slice ×3 (AC1.9).

  6. nockawa commented on May 23, 2026

    @nockawa
    CollaboratorAuthor

    Phase 3 complete — Stage 1 shell is done ✅

    Build-order steps 7-9 landed on feature/wb-revamp.

    7. Keyboard & focus — F6/Shift+F6 cycle dockview panels (focusNextPanel/focusPrevPanel → moveToNext/Previous); onDidActivePanelChange → focus-follows-navigation; DS-4 visuals in globals.css (:focus-visible ring + .dv-active-group accent); focus≠selection (selection = bg-accent, focus = ring).
    8. Session model — installSessionResetSync wipes session-scoped stores (bus / nav-history / silos) on sessionId change → switch-without-close, no cross-session bleed; Migration/Incompatible banners gained a real forward action ("Open another file…" → Connect), dropping the disabled stub.
    9. Infra — use202Query + <ViewState> (one PC-2 state-set: loading/building(202)/empty/no-selection/error-with-title+Retry); runtime density (useDensityStore compact/comfortable, useDensityRowHeight, data-density tokens, resource tree re-measures, Toggle Density command).

    Acceptance criteria — full Stage 1

    AC Status Proof
    1.1 bus laws ✅ suite A (13)
    1.2 nav history & deep links ✅ suite B (7)
    1.3 palette ✅ suite C (8)
    1.4 keyboard & focus ✅ shell F6 test + E2E focus; intra-panel roving lands per-view in Stages 2-4 (shell-and-dockview §6)
    1.5 focus visuals & color ✅ visuals :focus-visible/active-panel CSS; DS-2/3 color util ships with the first colored view (Stages 2-4)
    1.6 state set ✅ suite D (7) — ViewState + deriveViewPhase
    1.7 no broken affordances ✅ suite E slice + Inspector/banner audits
    1.8 density ✅ suite H (3)
    1.9 load-a-file slice ✅ Open E2E; Trace/Attach navigator→bus→Inspector at component level (full ×3 E2E gated on trace fixture / live engine)
    1.10 session switch ✅ sessionReset (3)
    1.11 context bar ✅ ContextBar (4)
    1.12 blocked states ✅ banners (2)

    Verification (whole stage)

    tsc ✓ · eslint ✓ · vite build ✓ · Vitest 974 pass (+56 across Stage 1) · Playwright 18 pass (1 pre-existing unrelated red: resource-tree-polish Ctrl+/, StatusBar untouched).

    Stage 1 shell is feature-complete (21 files changed + 23 new). Two items intentionally ride with later stages, per the design's own sequencing: intra-panel roving (per-view, Stages 2-4) and the DS-2/3 categorical-color util (ships with the first colored zone-D view). Ready for end-to-end review + commit.

  7. moved this from In Progress to Done in Typhon devon May 24, 2026
  8. nockawa commented on May 24, 2026

    @nockawa
    CollaboratorAuthor

    Closed with the Stage 1 exit gate met — all 12 ACs green + the load-a-file slice green for Open / Trace / Attach.

    Build-step #9 (cross-cutting infra) is checked at the gate, but two parts are explicitly deferred (recorded here so they're not silently dropped):

    • use202Query / <ViewState> convergence — the dual 202 idioms already work (AC1.6 green); unifying them behind one wrapper is a cleanup refactor, not a gate item. Deferred.
    • Logs drawer engine/trace log-event stream — engine-gated, on the roadmap's deferred (Phase 5) list. Deferred.

    What did ship under step 9: DS-1 density tokens (3-mode font+spacing scale, View-menu submenu, suite-H lint) and DS-4 focus tokens.

    If/when the 202/ViewState convergence is wanted, it should be its own small follow-up issue rather than reopening this stage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions