Skip to content

feat(ui): consistency polish — disclosure chevrons, toast dismiss, popover autofocus, open-state signals (#102) - #108

Merged
BorisTyshkevich merged 3 commits into
mainfrom
feat/ui-consistency-polish-102
Jul 1, 2026
Merged

feat(ui): consistency polish — disclosure chevrons, toast dismiss, popover autofocus, open-state signals (#102)#108
BorisTyshkevich merged 3 commits into
mainfrom
feat/ui-consistency-polish-102

Conversation

@BorisTyshkevich

Copy link
Copy Markdown
Collaborator

What & why

Four small, independently-shippable UI-consistency items from #102 (Phase 3 — Windows, roadmap #68), in the style of #85:

  1. Disclosure chevron: rotate vs swap. The schema tree's expand/collapse chevron swapped between two icons; the login screen's Advanced disclosure already rotated a single icon. Unified on rotate (cheaper, no icon-swap flash) — src/ui/schema.js now renders one Icon.chevDown() rotated 0deg/-90deg via CSS transform, matching login.js.
  2. Toast: no manual dismiss. flashToast only auto-hid after ~1.6s. .share-toast.show now allows pointer events + shows a pointer cursor; a click handler clears the pending timer and hides immediately (guarded against a stale timer double-firing after a manual dismiss).
  3. Popover autofocus inconsistency. openSavePopover, the library-title rename input, and the saved-edit form already autofocused. openUserMenu (focuses "Log out") and openFileMenu's dropdown (focuses "New Library") now do too.
  4. Open-state tracking: unify on signals. shortcutsOpen, editingSavedId, and bannerDismissedFor were plain fields (the latter two lived on app directly). Converted to signal(...) and consolidated into state.js alongside the codebase's other session-only fields (libraryFilter, resultSort) — more consistent with every other slice in that file than leaving two of the three on app. Pure .value mechanical migration; no reactive reader added (each write site already calls its own repaint).

Closes #102

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
  • CHANGELOG.md ([Unreleased]) updated
  • Reconciled affected tracked work: roadmap Roadmap to 1.0.0 #68 (checked off UI consistency polish: disclosure chevrons, toast dismiss, popover autofocus, open-state tracking #102), the issue body (acceptance boxes ticked, one annotated for the state.js vs app placement), ADR-0001 (new addendum for the three-field signal conversion)

Test plan

  • npm test — 1266 tests passing, per-file coverage gate green
  • npm run builddist/sql.html builds clean
  • npm run test:e2e — full Playwright suite (Chromium/Firefox/WebKit) green (two Firefox timeouts on unrelated specs were confirmed flaky on isolated re-run)
  • Manually verified live against the clickhouse-play demo cluster via npm run local + Playwright: chevron rotate on expand/collapse, toast click-to-dismiss + pointer cursor, user-menu/file-menu autofocus (document.activeElement), saved-query inline rename, and the shortcuts modal open/close

🤖 Generated with Claude Code

https://claude.ai/code/session_01DM8nrNFDkSbfappoez2Snb

BorisTyshkevich and others added 3 commits July 1, 2026 14:04
…pover autofocus, open-state signals (#102)

Unifies the schema tree's expand/collapse chevron on the same rotate
technique the login screen's Advanced disclosure already used (one icon,
no icon-swap flash). The share toast can now be dismissed early by
clicking it. openUserMenu/openFileMenu autofocus a sensible first item
on open. shortcutsOpen/editingSavedId/bannerDismissedFor move into
state.js as signals, consistent with the rest of the ADR-0001 migration.

Closes #102

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DM8nrNFDkSbfappoez2Snb
Code-review findings on #102: the expand/collapse chevron's CSS
transition never animated because renderSchema() fully rebuilds each
row's DOM on toggle, so the rebuilt node was born already at its
target rotation with nothing to interpolate from — flipChevron() now
flashes the fresh node back to its pre-toggle rotation and forces a
layout read before restoring the target, giving the transition an
actual two-frame change to play across. Also move flashToast's
auto-hide timer from a module-level field to a per-element field, so a
toast in a detached tab's document can't clobber a pending timer that
belongs to a toast in the main document's realm.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01784dKCpk5W7rdpUAwcQnix
@BorisTyshkevich
BorisTyshkevich merged commit 79259f3 into main Jul 1, 2026
6 checks passed
@BorisTyshkevich
BorisTyshkevich deleted the feat/ui-consistency-polish-102 branch August 6, 2026 15:28
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.

UI consistency polish: disclosure chevrons, toast dismiss, popover autofocus, open-state tracking

1 participant