Skip to content

feat(#483): add keyboard Library assignment chooser - #516

Merged
BorisTyshkevich merged 4 commits into
mainfrom
feat/library-assign-menu-483
Jul 28, 2026
Merged

feat(#483): add keyboard Library assignment chooser#516
BorisTyshkevich merged 4 commits into
mainfrom
feat/library-assign-menu-483

Conversation

@BorisTyshkevich

@BorisTyshkevich BorisTyshkevich commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

What & why

Closes #483.

Every Library query now exposes a compact, keyboard-reachable Add to dashboard… action. The Plus is hidden at rest and appears on row hover or keyboard focus. Its named two-stage chooser selects a Dashboard and confirms creation of a new panel, then calls the same assignLibraryQueryToPanel application command as drag/drop. The resulting workspace candidate is byte-identical to the service-driven drag path: an independent owned query copy plus a new tile, with the Library source unchanged.

The chooser fails closed for duplicate Dashboard ids, distinguishes legitimate duplicate titles with collision-safe id fragments, uses canonical fallback names, and suppresses stale navigation/toasts when a write completes after the user changes surfaces. Both stages measure their rendered height and flip above bottom-edge query rows; unusually tall menus are clamped into a scrollable viewport area, keeping Add/Cancel reachable. After a successful add, the sidebar switches to the Dashboard tree and expands, selects, and focuses the new panel before opening its owned query. Menu focus, arrows, Enter, Cancel, Escape, trigger focus restoration, viewport placement, and post-add tree positioning are covered in unit tests and real Chromium/WebKit flows.

Validation:

  • npm test — 6,099 tests passed; 100% statements and lines
  • npm run builddist/sql.html built successfully
  • Chromium/WebKit targeted keyboard and bottom-edge placement flows — 4 passed
  • Full Playwright run — Chromium/WebKit green; Firefox hit the repository-documented local launch/setup limitation

Checklist

  • npm test passes (the per-file coverage gate is non-negotiable)
  • Tests added/updated in the same change as the code
  • npm run build succeeds (single-file dist/sql.html)
  • Layers kept honest: pure logic in src/core/, network in src/net/ (injected fetch), DOM in src/ui/
  • No new runtime dependency (or it's a deliberate, justified addition — see CONTRIBUTING)
  • README / CHANGELOG.md ([Unreleased]) updated if behavior or the deployed surface changed
  • Reconciled affected tracked work (roadmap Roadmap to 1.0.0 #68, the issue body, ADR/CHANGELOG) if this change reshaped it

Add an always-visible Library row action with a named, two-stage Dashboard-to-panel menu. Route assignments through the existing drag/drop service, preserve stale-surface safety, and distinguish duplicate Dashboard titles without guessing ambiguous ids.

Cover candidate byte identity, keyboard and focus behavior, async renderer races, canonical fallback names, typography, and real Chromium/WebKit interaction.

Co-Authored-By: OpenAI Codex <noreply@openai.com>

Claude-Session: unavailable (OpenAI Codex)
Hide the Library assignment Plus at rest while retaining hover and keyboard-focus visibility. After a successful add, switch to the Dashboard tree and reveal, select, and focus the newly created panel through the same settlement helper as drag/drop.

Co-Authored-By: OpenAI Codex <noreply@openai.com>

Claude-Session: unavailable (OpenAI Codex)
Measure shared menus after mounting, flip them above bottom-edge triggers, and clamp oversized menus into a scrollable viewport area. Cover both Library chooser stages in Chromium and WebKit plus pure anchor and menu geometry tests.

Co-Authored-By: OpenAI Codex <noreply@openai.com>

Claude-Session: unavailable (OpenAI Codex)
Resolve the styles conflict by preserving #483's Library chooser rules while retaining main's removal of obsolete variable-history styles.

Co-Authored-By: OpenAI Codex <noreply@openai.com>

Claude-Session: unavailable (OpenAI Codex)
@BorisTyshkevich
BorisTyshkevich merged commit 998baf8 into main Jul 28, 2026
7 checks passed
@BorisTyshkevich
BorisTyshkevich deleted the feat/library-assign-menu-483 branch July 28, 2026 10:53
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.

Keyboard-accessible "Add to dashboard…" command for Library queries

1 participant