refactor(ui): fold diagnostic decks into one DIAGNOSTICS menu #173
No reviewers
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral!173
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/admin-diagnostics-menu"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The admin deck selector had seven entries. SYSTEM_DIAG, API_CONSOLE and EVENT_LOGS are now one
[ F4: DIAGNOSTICS ▾ ]entry that opens a menu. This clears up the main tab strip and makes room for the upcoming historical-flow import menu (#170).DIAGNOSTICS: API_CONSOLE.menuitemradiowitharia-checked.overflow-x: auto).Architectural impact
app/static/js/src/ui/deck_menu.js(DeckMenu,DIAGNOSTICS_DECKS), loaded by the module block inindex.html.app.jscreates it and syncs the active state inswitchTab.position: fixedunder its button, clamped to the viewport, so the strip's overflow cannot clip it. It follows the button on scroll and resize.probes,console,logs) and their content panels are unchanged.Redesign alternatives considered
Say if you prefer 2 or 3. The
DeckMenumodule can back either.Verification
tests/frontend/test_deck_menu.test.js(8 tests: grouping, keyboard navigation, Escape/outside close, positioning and viewport clamping, active-deck sync, focus on reopen).pytest: 417 passed, including the node frontend suite. Ruff clean. Pre-commit passed.loadEventLogs is not defined.switchTabcalls a function that no longer exists. Tracked in #174.Checklist
docs/standards/git-and-workflow.md.🤖 Generated with Claude Code
WIP: refactor(ui): fold diagnostic decks into one DIAGNOSTICS menuto refactor(ui): fold diagnostic decks into one DIAGNOSTICS menugabogg referenced this pull request2026-09-28 10:28:14 +00:00
Review pass 1 —
3ce41df(DIAGNOSTICS menu)Reviewed
master...3ce41dfagainst the PR's stated behavior, AGENTS.md, the code standards, the UI design guidelines, and the Fowler smell baseline.Standards
No actionable findings. The menu follows the documented frontend design rules and has focused tests.
Spec
DeckMenu._position()(app/static/js/src/ui/deck_menu.js, around lines 159–167) clampslefttoinnerWidthbut always placestopbelow the button. After a resize or scroll in a short viewport, the menu can extend below the visible area. The PR says the menu is “clamped to the viewport” and “follows the button on scroll and resize.” Clamp its vertical position or available height as well, and test that case.syncActive()closes the menu only when the new deck is outside the diagnostics group (app/static/js/src/ui/deck_menu.js, around line 136). The PR says these shortcuts “still jump straight to each deck.” Close the menu on a direct shortcut so the selected deck is visible, and cover that interaction in a test.Totals: Standards 0 findings; Spec 2 findings (both P2). First-pass P1/P2/P3 findings require fixes before requesting pass 2.
Review pass 1: resolution in
ce92049Both findings are fixed. Current
master, including #166 and #179, is merged into the branch (b96a6a5).menuPlacement()opens the menu below the button, or above when that side has more room and the menu does not fit below.max-heightto the visible space on the chosen side, so the menu scrolls instead of overflowing._position()uses it on open, scroll and resize.syncActive()runs on every deck switch (menu choice, F4/F6/F7 or another tab) and now always closes the menu.Tests: 11 menu tests (was 8), adding below/above/scroll placement, the short-viewport flip and the F-key close.
Checked in Chromium:
Suite: full suite 450 passed; pre-commit passed. It reported 2 warnings from an intermittent aiosqlite teardown thread in
test_counting_integrity.py; they are unrelated to this frontend-only change.Ready for review pass 2.
Review pass 2 —
ce92049Reviewed master...ce92049 on two axes: Standards (AGENTS.md, code standards, UI design guidelines, Fowler smell baseline) and Spec (the PR description plus the pass-1 resolution). Frontend tests: 242/242, including 11/11 for
test_deck_menu. CIlint-and-testpassed once92049.Neither axis has P1 or P2 findings, and both pass-1 fixes are verified:
menuPlacementflips the menu above the button and capsmax-height.syncActivealways closes the menu. Focus still returns to the button after a menu choice.RBAC is unchanged. The button keeps
admin-only, and menu items still go through theROLE_ALLOWED_DECKScheck inswitchTab.Standards — 5 × P3
DIAGNOSTICS_DECKS(deck_menu.js:10-14) repeats the F-key-to-deck pairs fromKEY_DECK_MAP(app.js:44-53). Filed as #183..deck-menu.hidden(css:1386) repeats the global.hiddenrule. Filed as #183.<kbd>, but shortcuts are plain text. No action, since this matches the existing deck buttons..deck-menu-item. No action, since this matches the existing deck buttons.Spec — 3 × P3 (all filed as #182)
<body>.destroy().Totals: Standards 5 × P3 (worst: duplicated shortcut map). Spec 3 × P3 (worst: the menu detaching from its button). The deferred P3s are filed as #182 and #183, both in the milestone Historical passenger-flow backfill with
ready-for-agent. Merging.