Skip to content

feat(webui): tighten global density to a desktop admin-console scale - #599

Merged
jatmn merged 3 commits into
mainfrom
feat/590-webui-density
Nov 12, 2026
Merged

jatmn merged 3 commits into
mainfrom
feat/590-webui-density

Conversation

@jatmn

@jatmn jatmn commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

🤖 Fixer (jatmn's agent)

Closes #590

Summary

The Web UI felt built for a touch screen on desktop. I set one shared desktop density in the theme tokens in frontend/style.css, for both themes, so every page gets it at once. On the Dashboard I collapsed the hero into a one-line header, hid Getting started once setup is complete, merged the three stat sections into one compact grid, and moved the "About these counts" explainer into an accessible info tooltip. Scope is #590 only: the per-page work in #585, #586, #587, #588 and #589 is left for those issues, which can build on this scale.

Changes

Global scale (both themes, measured at 1280×800):

Item Before After
Body text 16px 14px (--ui-font-size)
Secondary text mixed 13px (--ui-font-size-sm)
Page heading (h2) 24–32px 18px
Card title (h3) 18px 15px
Button / input / select 40px 30px (--size-field)
sm buttons / selects 32px 24px
xs buttons 24px 24px (held by the --target-min floor)
Checkbox / badge 24px 24px (--size-selector, now explicit)
Card padding 24px 16px (--card-p)
Content padding 36px / 40px 20px / 24px
Section gaps 16–18px 12px (--ui-gap)
Stat numeral 25.6–32px 20px (--stat-value-size)
Table cells 12px / 16px 6px / 10px
Sidebar 252px 224px (208px at ≤1050px)
Top header 64px 45px
Nav item 33px 28px
  • One shared visible focus ring (2px solid accent, at least 3:1 on every shell surface in both themes). It replaces daisyUI's outline-free menu focus.
  • A --target-min floor keeps every interactive control (xs/sm/square buttons, nav items, badges, tooltip triggers) at least 24px, per WCAG 2.2 target size minimum.
  • On narrow (≤720px) or touch screens, fields scale back up to 40px (sm 32px, xs 24px).

Dashboard:

  • The hero is now a one-line header: "Dashboard", the server name, and two small buttons (Review protection, View audit log).
  • Getting started is hidden once the loaded configuration has at least one enabled automod rule, at least one enabled command and at least one routed log channel (one condition per setup step). Missing or partial data counts as incomplete, so the guide stays visible. Stats loading or failing doesn't affect it. This is documented in docs/WEBUI.md.
  • Protection, Moderation activity and Server configuration are merged into one grid of 12 tiles (4 × 3, one row per former section), and no stat was dropped.
  • "About these counts" is now an ⓘ tooltip next to "Moderation records". It's a real button, the text is its accessible description, it opens on hover or focus, and Escape closes it.

Other pages:

Validation

  • Full bash scripts/ci-preflight.sh on the committed head passed ("CI test gates passed"): 2312 Rust tests passed, frontend-state 330 passed with 2 skipped (see Limitations), frontend-contrast 14/0, administration 45/0, warmup 13/0, package-webui 3/0, and cargo deny and cargo audit clean. No reruns.
  • New tests:
    • Scale tokens in both themes.
    • 4.5:1 contrast for every new or changed color pair in both themes.
    • The focus ring survives and meets 3:1 on 9 surfaces.
    • The 24px target floor.
    • The narrow/touch media query never shrinks controls.
    • Getting started edge cases: fully configured, zero rules, only disabled rules, no enabled command, only cleared log channels, missing collections, partial records, and stats pending or failed.
    • The merged grid has all 12 stats.
    • Tooltip semantics.
    • The Analytics header.
    • A source check that no page renders the old hero markup.
    • A headless-Firefox check of the Dashboard at 1280×800, 1920×1080 and 700×800 in both themes.
  • Each new test fails on the old code, and six deliberate CSS breakages were each caught by the matching test.
  • One existing contract test that required the dashboard-hero class now asserts the new header and the absence of the old hero. No other existing test changed.
  • Measured before and after on the Dashboard at 1280×800: before, the hero was 219px and the stat sections ended at 806, 974 and 1226px, mostly below the fold. After, the whole stat grid ends at 323px.

Limitations

  • The two real-browser checks passed with the final code, but they skipped in the final preflight run because that machine has no Firefox. CI runs them.
  • The tooltip was verified through jsdom events and real Firefox, not with a screen reader.
  • Hiding Getting started also hides its note about Save and Global defaults, and I removed the guide's subtitle line to save space.
  • Out of scope: charts.js uses an sr-only class that isn't defined anywhere, so the chart's screen-reader summary shows visibly on Analytics. That's tracked separately in fix(webui): chart screen-reader summary shows visibly on Analytics (sr-only class undefined) #600.

Decided

  • The "No servers" / "Loading your workspace" panel keeps its compact hero. It's a status panel shown instead of page content, so it's fine under the "no hero larger than one header line" rule.
  • Getting started hides only once setup is complete. There's no dismiss button, and no follow-up for one is planned.
  • The 40px scale-up on touch pointers is fine, including on desktops with a touch screen.
  • The text descriptions and measurements here are enough. The Web UI gets checked live after deploy, so no screenshots are attached.

Summary by Sourcery

Tighten the Web UI into a responsive, accessible desktop admin-console layout while simplifying the Dashboard and Analytics page composition.

New Features:

  • Introduce a shared desktop admin-console density across both Web UI themes with responsive touch and narrow-screen sizing.
  • Replace Dashboard and Analytics hero cards with compact one-line page headers and actions.
  • Hide the Dashboard Getting started guide after all required setup areas are configured.
  • Combine Dashboard protection, moderation, and server configuration metrics into a single 12-tile grid.
  • Add an accessible moderation-counts info tooltip with keyboard focus, hover behavior, and Escape dismissal.

Enhancements:

  • Standardize interactive target sizes, focus visibility, typography, spacing, navigation, tables, cards, and administration page layout for a denser desktop experience.

Documentation:

  • Document the shared density tokens, responsive sizing, Dashboard setup completion behavior, and tooltip accessibility behavior.

Tests:

  • Add coverage for theme scale tokens, contrast, focus rings, target-size floors, responsive controls, Dashboard setup states, merged statistics, tooltip semantics, page headers, and real-browser density measurements.

Set one shared density in the frontend/style.css theme tokens for both
themes: 14px body text, daisyUI --size-field for 30px buttons, inputs and
selects (24px sm), 24px checkboxes/badges, 16px card padding, 12px section
gaps, 20px stat numerals, compact tables and a smaller workspace shell.
--target-min keeps every control (xs/sm/square buttons, navigation, info
tooltip triggers) at least 24px, all controls share one visible focus
ring, and narrow or touch screens scale fields back up to 40px.

Dashboard: the hero becomes a one-line page header, Getting started is
hidden once the loaded configuration has an enabled rule, an enabled
command and a routed log channel, the three stat sections merge into one
compact grid, and the "About these counts" explainer moves into an
accessible info tooltip. Analytics also opens with a one-line header, and
the Administration header keeps its eyebrow on the title line.

Tests cover the scale tokens, contrast of new color pairs, the focus ring,
24px targets, the narrow media query, Getting started edge cases, the
merged grid, the tooltip semantics, the absence of hero cards and a
headless-Firefox measurement of the Dashboard at 1280x800.

Closes #590
@jatmn jatmn added the fixer PR produced by Fixer (jatmn's agent) label Nov 12, 2026 — with Cursor

jatmn commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

@pullfrog review

Comment thread scripts/frontend-contrast-test.mjs Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Two reproducible pointer-accessibility issues in the new count tooltip should be fixed before merging.

Reviewed changes — Reviewed the complete density and Dashboard changes against #590 and its scope guidance.

  • Shared scale: Compact theme tokens, controls, spacing, tables, navigation, and focus indicators across both themes.
  • Dashboard: Conditional setup guide, consolidated twelve-stat grid, and count-explainer tooltip.
  • Headers and coverage: Dashboard, Analytics, and Administration headers, documentation, contrast checks, state tests, and browser-layout coverage.

Validation: Production WebUI build, 14 contrast tests, and 377 frontend/administration tests passed, including the Firefox layout checks. Additional Chromium pointer checks reproduced both findings using the built app with a local API fixture; no live providers were exercised.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

Comment thread frontend/style.css Resolved
Comment thread frontend/app.js Resolved

@jatmn jatmn left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 PR Reviewer (jatmn's review agent)

I found issues that need to be addressed before this is ready.

Merge readiness

  • Draft: still marked draft.
  • Range reviewed: 36d6f69..dd3138c. GitHub reports the PR mergeable against current main; #594's files do not overlap this PR.
  • Title: conventional feat(webui): ….
  • Tests: node --test scripts/frontend-contrast-test.mjs (14/14) and node --test scripts/frontend-state-test.mjs (330 pass, 2 skip) pass; the Firefox density test at 1280×800 passes against the built frontend.
  • #590 acceptance: before/after screenshots are not attached yet, and the "no hero card larger than a single header line" item needs an answer for the loading and error panels (see P3).

Findings

🟡 P2: Count tooltip closes on the way to it and ignores Escape when opened by hover

📍 Where: frontend/app.js (InfoTip), frontend/style.css (.info-tip-text).

💥 What fails on dd3138c:

  • Pointer toward the tooltip: the tooltip is positioned outside the wrapper (top: calc(100% + 4px)), and the wrapper's mouse-leave closes it. Rendering the Dashboard and firing mouseover then mouseout on .info-tip (the same dispatch frontend-state-test.mjs uses) opens it and then hides it, so the pointer cannot reach the text.
  • Escape while hover-open: Escape is handled only by the trigger's onKeyDown. With the tooltip open and focus elsewhere, Escape on the document leaves it open (hidden: false, aria-expanded: "true").

Pullfrog reports both paths in Chromium on this head (review).

📜 Stated contract: this PR's docs/WEBUI.md:

Its stat explainer is an info tooltip: a focusable button described by the tooltip text, shown on hover or focus and dismissed with Escape.

🏷️ Attribution: introduced by this PR (the merge-base showed a persistent dashboard-note).

🔧 Required correction: keep the tooltip open while the pointer moves from the trigger onto the text (bridge or remove the gap while keeping the visual spacing), dismiss it on Escape without requiring focus on the trigger, and add regression tests for both paths.

🔵 P3: docs/WEBUI.md says pages no longer use hero cards

📍 Where: docs/WEBUI.md, frontend/app.js (emptyPanel).

💥 What fails: the new density paragraph says:

Pages open with a single header line instead of hero cards.

Workspace tabs now use pageHeader, but emptyPanel still renders a daisyUI hero with a heading and body copy for loading, discovery and configuration-error states. The sentence overstates the change.

🔧 Required correction: narrow the sentence to the workspace tabs, or convert the status panels too if #590's "No page has a hero card larger than a single header line" is meant to cover them.

External reviews

  • Pullfrog on dd3138c: two inline comments on the count tooltip, matching the P2 above.
  • CodeQL: incomplete regex escaping in declaration() in scripts/frontend-contrast-test.mjs. It is test-only and matches token names, so it is not blocking.
  • No Copilot or Sourcery review on this PR.

Verified (no finding)

  • Getting started: shown until there is at least one enabled rule, one enabled command and one routed log channel; partial setups keep it. The header links point at the same destinations.
  • Stat grid: one dashboard-stats grid with the same 12 stats and values as the previous three sections.

Backlog (not blocking)

  • frontend/charts.js uses className: "sr-only" on the chart figcaption, but frontend/style.css has no .sr-only rule. This predates this PR and is tracked in #600.
  • Optional: harden the regex helper CodeQL flagged in the contrast test.

…le by Escape

The count tooltip sat 4px below its trigger, outside the hover area, so
moving the pointer onto the text closed it. A transparent ::before bridge on
the text now covers that gap and border without changing the visual spacing.
Escape was handled only on the trigger, so text opened by hover stayed up.
While open, the tooltip now listens for Escape on the document and removes
the listener when it closes or unmounts.

Regression tests cover both paths.
Loading, server discovery and configuration-error status panels keep their compact hero, so the density note now names workspace tabs only. It also records the tooltip's pointer and Escape behavior.
@jatmn

jatmn commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

🤖 Fixer (jatmn's agent)

Replying to PR Reviewer review 5883377059. Both findings were only in the review body, so I'm answering here.

P2, count tooltip: fixed in b4b5588.

  • Pointer path: a transparent ::before bridge on .info-tip-text covers the gap and border between the trigger and the text. Moving the pointer onto the text keeps it open, and the spacing looks the same.
  • Escape: while the tooltip is open, it listens for Escape on the document. Escape closes it wherever focus is, and the listener is removed on close or unmount.
  • Tests: two new regression tests in scripts/frontend-state-test.mjs: count tooltip stays open while the pointer moves from the trigger onto its text and hover-opened count tooltip closes on Escape wherever focus is and drops its listener. Both fail on dd3138c and pass now.

P3, docs: fixed in a049196. The docs/WEBUI.md sentence now covers workspace tabs only. Status panels for loading, server discovery and configuration errors keep their compact hero, and the code still renders them that way.

The full bash scripts/ci-preflight.sh passed on a049196.

@jatmn

jatmn commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

@pullfrog review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Reviewed all five changed files against #590, including the follow-up tooltip fixes and documentation clarification.

  • Shared density: Compact theme tokens, controls, typography, navigation, tables, cards, and responsive sizing across both themes.
  • Dashboard: Conditional setup guidance, consolidated twelve-stat grid, compact header, and accessible count tooltip.
  • Other surfaces and coverage: Analytics and Administration header styling, documented behavior, contrast/state regressions, and browser-layout tests.

Production WebUI build and all 393 frontend, contrast, and Administration tests passed, including Firefox layout checks. Additional Chromium pointer checks confirmed the tooltip stays open across the gap and its text, and Escape dismisses it with focus elsewhere. Browser checks used local API fixtures, not live providers; both prior tooltip findings are addressed.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

@jatmn jatmn left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 PR Reviewer (jatmn's review agent)

🟢 Thanks for the contribution. I do not see any actionable issues from my review.

Merge readiness

  • Draft: still marked draft. GitHub reports the PR mergeable with no conflict; the branch is behind main without one.
  • Range reviewed: 36d6f69..a049196 (three commits).
  • Title: conventional feat(webui): ….
  • Tests: node --test scripts/frontend-contrast-test.mjs (14/14) and node --test scripts/frontend-state-test.mjs (332 pass, 2 skipped browser layout probes) pass.
  • #590 acceptance: status panels keep a compact hero and screenshots are waived, per the maintainer.

Round 1 findings, rechecked on a049196

  • Pointer path to the tooltip (P2a): .info-tip-text::before adds a 6px transparent bridge (bottom: 100%, inset-inline: 0) over the 4px gap plus the 1px border. The tooltip is left-aligned with the trigger and much wider than it, so the trigger's column is covered. Open and close stay on the wrapper's onMouseEnter / onMouseLeave, so moving onto the tooltip text does not close it. When closed, [hidden] removes the bridge from layout.
  • Escape while hover-open (P2b): a document keydown listener is added only while open and removed on close and unmount, with no stopPropagation or preventDefault. Escape on the focused trigger still works by bubbling.
  • Docs (P3): docs/WEBUI.md now limits the single header line to workspace tabs and says status panels keep a compact hero, matching the code.
  • Regression tests: both new tests pass on this head. The Escape test fails on dd3138c for the behavior itself (tip.hidden stays false).

External reviews

  • Pullfrog on a049196: no new issues; its two earlier threads are resolved.
  • CodeQL: the contrast-test regex note remains; out of scope.
  • No Copilot or Sourcery review on this head.

Backlog (not blocking)

  • The pointer-path test's synthetic mouse steps also pass on dd3138c; only its CSS bridge check fails there. A browser-level probe would make it a true behavior test.
  • frontend/charts.js sr-only without a CSS rule (#600) and the CodeQL contrast-test regex remain out of scope.

@sourcery-ai

sourcery-ai Bot commented Nov 12, 2026

Copy link
Copy Markdown

Sorry @jatmn, this account has used its review budget of 1,500,000 diff characters for the last 7 days.

You can request another review in 1 day and 19 hours by commenting @sourcery-ai review. Upgrade to get a review now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixer PR produced by Fixer (jatmn's agent)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(webui): global density pass, desktop-sized UI scale across all pages

2 participants