Skip to content

fix(#553): unify Dashboard-tree row counts and move Add panel to the Panels row - #562

Merged
BorisTyshkevich merged 1 commit into
mainfrom
fix/dashboard-tree-rows-553
Jul 29, 2026
Merged

fix(#553): unify Dashboard-tree row counts and move Add panel to the Panels row#562
BorisTyshkevich merged 1 commit into
mainfrom
fix/dashboard-tree-rows-553

Conversation

@BorisTyshkevich

Copy link
Copy Markdown
Collaborator

What & why

Closes #553. Dashboard tree rows used inconsistent columns for counts and actions: the Dashboard row's panel count was right-aligned trailing text competing with the action cluster, while Variables and Panels used an inline · N. At narrow sidebar widths that right-aligned metadata ate the space the Dashboard and group names needed.

Now all three rows use one placement, and the rightmost column is actions only:

On-time flights · 7   … edit  delete
  Variables · 4
  Panels · 7          … +

The change is in the pure model, not the renderer. src/ui/dashboard-tree.ts renders row.count / row.actions generically, so both halves flowed through src/application/dashboard-tree-model.ts with no render change:

  • the Dashboard row's panel count moves from meta (right-aligned) into count (inline), and its meta is now always '';
  • add-panel moves off the Dashboard row's actions onto the Panels group row, because it creates a member of that group rather than acting on the Dashboard document. A new addPanelAction helper preserves the availability rules exactly — an ambiguous Dashboard id or the 100-tile ceiling still render the control disabled with a reason rather than withholding it (Dashboard tree: replace overflow menus with direct Panel focus, edit and delete actions (#429 phase 4) #494's "vocabulary must not silently shrink"). The Variables group row still has no actions.

The accessible name is provably unchanged. rowAccessibleName composes [label, count, status, meta, marker] and drops empties, so a Dashboard row that was count: null, meta: '7'"Sales revenue 7" is now count: 7, meta: '' → the same string. Hiding the count at the breakpoint is purely visual: the row's aria-label is set explicitly, so a screen reader still announces the count. There's an explicit e2e assertion for that at ≤220px.

Narrow width reuses #552's breakpoint

One line added to the existing @container sidebar (max-width: 220px) block from #552.dash-tree-count { display: none; }. No second container, no second threshold, no new class.

Verification

npm test → 201 files / 6630 tests, dashboard-tree-model.ts and ui/dashboard-tree.ts both clear the per-file floor. npm run build and npm run check:arch pass.

New e2e coverage: a Dashboard tree counts at the narrow sidebar (#553) block (3 tests) plus a Panels-row keyboard/Tab-order test, covering the narrow state, the restored wider state, and that expand/collapse and row actions stay usable by mouse and keyboard at both widths. tests/e2e/tile-open-workbench.spec.js's Add-panel flow is retargeted to the Panels row.

Verified visually in Chromium at 1280px and dragged to 200px: counts disappear, a long dashboard title visibly gains the recovered space, and Panels' + stays present and reachable.

Note on two unrelated e2e failures

tests/e2e/tile-open-workbench.spec.js has 2 failures (grid-tile widen width/height) that reproduce on the base branch — confirmed by stashing this branch's changes and re-running on a private port, after checking via /proc/<pid>/cwd that the shared Playwright port was held by another worktree (see #560). They are pre-existing and outside this issue's scope; filed separately rather than folded in here.

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
  • 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

🤖 Generated with Claude Code

https://claude.ai/code/session_01GiubaoqEuBzAyo5C4P8Vqr

…ls row

Dashboard, Variables and Panels rows now share one inline `· N` count
placement after the label instead of the Dashboard row's own count competing
with its action cluster on the right; the rightmost column is actions only.
Add panel moves from the Dashboard row to the Panels group row, since it
creates a member of that group. #552's narrow-sidebar container query
(reused verbatim, no second breakpoint) now also hides these counts, with the
count staying in each row's accessible name while visually hidden.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiubaoqEuBzAyo5C4P8Vqr
@BorisTyshkevich
BorisTyshkevich merged commit c274a29 into main Jul 29, 2026
8 checks passed
@BorisTyshkevich
BorisTyshkevich deleted the fix/dashboard-tree-rows-553 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.

Make Dashboard tree row metadata and actions responsive and consistent

1 participant