Skip to content

feat(command palette): Ctrl/Cmd+K search over workspaces, shots, lessons, glossary - #65

Merged
obvious-autobuild[bot] merged 1 commit into
release/task-mode-ia-redesign-20261011-170103from
feat/tmia-palette
Oct 11, 2026
Merged

obvious-autobuild[bot] merged 1 commit into
release/task-mode-ia-redesign-20261011-170103from
feat/tmia-palette

Conversation

@obvious-autobuild

Copy link
Copy Markdown
Contributor

Summary

Adds the command palette from the spec's "What we build" §2 (L6): a new web/palette.js — a native <dialog> opened by Ctrl/Cmd+K or the header ⌘K button (the stub shipped disabled with the router PR). Case-insensitive substring search over:

  • the three workspaces (Replay / Compare / Explore),
  • the shot catalog — /shots fetched once per session and cached, labelled like the existing picker (#30192 · 2 Beams,SS Beam,SW Beam · 0.95 MA),
  • the 43 lesson titles and 47 glossary terms,
  • five actions: Share this view (copies location.href), OpenUSD export, start/resume the guided study, open the edit drawer, open the catalog.

Keyboard-first: ↑/↓ move the selection, Enter runs it, Esc closes; focus is trapped by native showModal() and restored to the opener on close; the header button carries aria-haspopup="dialog" + aria-expanded. No dependencies, ES5-compatible IIFE, and every action runs through existing public surfaces — the router hash grammar (workspaces.js), window.FusionLab hooks and the replay/app handlers — with no DOM reach into other modules.

Companion edits: web/index.html loads the script last and enables the ⌘K stub; web/style.css styles the palette from the existing token set (no new colors, no framework); web/guide.js gains one small additive hook — window.FusionLab.guided.start(lessonId) — so a lesson item opens that exact lesson through the same jump the per-panel "?" buttons take. Existing FusionLab keys and all data-guide anchors are untouched.

Acceptance criteria

  • V5 — Ctrl/Cmd+K opens the palette; typing 30192 narrows to the shot; Enter loads it; Esc closes from anywhere (evidence below).
  • Focus is trapped inside the dialog (native modal) and restored to the opener on close (asserted: activeElement.id === 'cmdk' after Esc; aria-expanded resets).
  • Lessons and glossary terms appear as sources; a lesson item starts the guided study at that lesson (body.guided, rail on chapter 3 · "The operating map").
  • Runs through public surfaces only: workspaces via the router grammar (#/explore…), shots via the replay loader (now the feat(shotload): shared shot-load state machine with a visible load chip #63 state machine — the recording shows the load chip working), lessons via the new FusionLab.guided.start hook, USD/share/catalog via the existing handlers.
  • No new dependencies; ES5-compatible; palette styles reuse the token system.
  • V1 — uv run pytest -q: 352 passed, 1 skipped; uv run ruff check: clean; uv run mypy fusionlab: clean (run on this exact tree, 02c5775).

Evidence (QA uploaded against tested head 02c5775)

Captured with Playwright (Chromium 1440×900) against a live server on the tested head. Notes for reviewers: with the guided-study spotlight active, the header ⌘K button is dimmed inert by design (the spotlight dims header chrome) — the palette still opens there with Ctrl/Cmd+K since that shortcut is a document-level listener. When the palette opens before /shots has resolved (first open of the session), the empty-query message already says sources load as you type, and the list repaints when the fetch lands.

How to review

  • web/palette.js is the whole feature (one IIFE, ~240 lines): items are data + run() closures over public surfaces; refreshDynamic() fetches lessons/glossary/shots once and re-renders on arrival; search() is pure substring + starts-with ranking, capped at 30 rows.
  • Deliberately out of scope: lessons.json copy changes (no surface it anchors to was renamed in this lane), any backend change, any new styling tokens beyond what existed.
  • Known minor polish (not blocking): the "Nothing matches" note says "shots, lessons and glossary load as you type" — accurate, but the shot row can appear a beat after typing on a cold session.

Sibling PRs (Lane B · explore → palette)

Human author: Tapan Ganatma Nakkina ([email protected])

🔗 Obvious Project · 🧵 Obvious Thread · 🔀 Obvious PR Artifact

…ons, glossary

Native <dialog> palette (web/palette.js): case-insensitive substring search
over the three workspaces, the shot catalog (/shots, fetched once and cached),
the 43 lesson titles and 47 glossary terms, plus actions — share this view,
OpenUSD export, start/resume the guided study, open the edit drawer, open the
catalog. Keyboard-first (arrows/Enter/Esc), focus trapped by native showModal
and restored to the opener on close; runs every action through existing public
surfaces (router hash grammar, window.FusionLab hooks, replay/app handlers) —
no new app paths, no dependencies, ES5-compatible IIFE.

Companion edits: header ⌘K stub enabled with aria-haspopup/aria-expanded;
palette styles from the existing token set (no new palette); a small additive
window.FusionLab.guided.start(lessonId) hook in guide.js so a lesson item opens
that exact lesson through the same jump the per-panel "?" buttons use.

Co-authored-by: Tapan Ganatma Nakkina <[email protected]>
@obvious-autobuild
obvious-autobuild Bot marked this pull request as ready for review October 11, 2026 20:53
@obvious-autobuild
obvious-autobuild Bot merged commit 5a2d99e into release/task-mode-ia-redesign-20261011-170103 Oct 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants