Skip to content

feat(webui): colorful, meaningful icons for row actions and the sidebar menu - #602

Merged
jatmn merged 2 commits into
mainfrom
feat/588-webui-icons
Nov 13, 2026
Merged

jatmn merged 2 commits into
mainfrom
feat/588-webui-icons

Conversation

@jatmn

@jatmn jatmn commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

🤖 Fixer (jatmn's agent)

Closes #588

Summary

Every row or record action on the report-style pages, and every item in the left sidebar menu, is now a colored SVG icon with a fixed meaning. Each meaning has its own color from a dedicated --icon-* palette with a light and a dark shade, so switching themes never recolors an icon or changes what it means. Unban is now a green person-with-check icon instead of a padlock. The Web UI uses SVG icons only, never emoji.

I kept what #582 got right: aria-label and title on every icon button, the ActionButton busy and disabled path, the existing confirm dialogs and the owner-only handling.

Changes

  • Shared icon set (frontend/icons.js, new): one action → icon → intent map, and the existing Icon component moved here (same pattern as charts.js). IconButton stays in app.js. I drew the paths myself and added no new dependency: AGENTS.md doesn't allow committing third-party source such as copied Lucide paths, and an npm package would have meant lockfile, dependency-table and harness changes.
  • Icon palette (frontend/style.css): seven --icon-* colors in one commented block appended near the end of the file, each with a light and a dark shade. They don't use the theme's primary, secondary or accent colors. Icon buttons have a visible hover state and focus ring and a minimum target of 24px, via var(--target-min, 1.5rem).
Action Icon Color Light Dark
ban, Bans menu hammer red #c81e1e #fc9a9a
remove / delete trash red #c81e1e #fc9a9a
leave (remove the bot from a server) door with arrow red #c81e1e #fc9a9a
unban person with check (not a lock) green #15803d #4ade80
approve circle with check green #15803d #4ade80
edit pencil blue #1d5fd0 #6cb0ff
view / open eye blue #1d5fd0 #6cb0ff
download download blue #1d5fd0 #6cb0ff
retry circular arrow blue #1d5fd0 #6cb0ff
copy copy gray #4b5a6e #a6b4c6
cancel circled x gray #4b5a6e #a6b4c6
analytics bar chart purple #7e22ce #c99afd
members people teal #0f766e #2dd4bf

Pages audited and actions found

Page Actions found → now
Members Copy → copy icon; View history → eye icon; "Case X" link in member history → case ID text plus an eye icon "Open case X"
Bans Unban (padlock) → green person-with-check; confirmation text unchanged
Audit log No row actions (before or after)
Cases Case ID button → short ID text plus an eye icon "Open case …"; Remove case record → trash icon, still only shown when deletable; Download → evidence ID text plus a download icon; Retry cleanup → retry icon
Bot actions Cancel and Force cancel → gray circled-x, now colored
Known spam Remove → trash icon; non-owners still see "Owner only" on global rows
Known-bad images Remove → trash icon; confirmation and busy state kept
Commands Edit → pencil icon (Manage Server only); editor step "✕" → trash icon "Remove step"
Automod rules Edit → pencil icon; editor "Remove action N" → trash icon
Badwords "✕" → trash icon; non-owners still see "owner only" on global rows
Templates No row actions; Save and Reset to global are form-footer buttons and stay as text
Settings Access-role row Remove → trash icon "Remove role"
Bot servers (owner only) Red Remove text button → red leave icon
Administration page Status badge glyphs ✓ ↑ ↻ ! → SVG icons (Boot mismatch uses the red attention icon); "↻ Refresh status" and "← Back to workspace" → icon plus text
Login "Continue with Discord ↗" → external-link SVG in the button's text color

I left form-footer buttons (Save, Delete, Cancel, Set, Clear, Save ignores, Add note, Use global) and page toolbars (Refresh, First/Next page, Removed records) as text on purpose.

Sidebar menu

Every nav item gets an aria-hidden SVG icon. The label text is unchanged:

Item Icon Color
Dashboard grid blue
Automod Rules shield green
Badwords speech bubble with x amber
Known spam envelope red
Known-bad images image with a slash red
Commands terminal prompt blue
Templates document blue
Log Channels # gray
Analytics bar chart purple
Audit Log list gray
Members people teal
Bans hammer red
Bot actions robot blue
Cases briefcase amber
Settings sliders gray
Bot servers server teal

The sidebar's own text buttons use the same map and the same icon tile, with their labels unchanged:

Button Icon Color
Administration (owner) crown blue
View as… (owner) eye blue
Exit preview (preview tab) back arrow gray
Sign out door with arrow gray

The Administration page nav gets Updates (circle with up arrow, blue), Database Usage (database, gray) and Analytics (bar chart, purple). Each icon sits on a small panel-colored tile, so it stays readable on the inverted highlight of the active item. The icons also show in the narrow scrolling menu on small screens.

  • Docs: docs/WEBUI.md describes the icon set, the palette and the rules.

Validation

  • This round: bash scripts/ci-preflight.sh passed (exit 0, no reruns) on the pushed head. The frontend suites inside it: state 348/0, contrast 18/0, warmup 13/0, package 3/0, administration 46/0.
  • Tests added or changed this round:
    • scripts/frontend-state-test.mjs: new "the sidebar's own buttons show their colored SVG icons beside unchanged labels" covers Administration, View as…, Sign out (owner) and Exit preview (preview tab): one aria-hidden icon on the sidebar tile, its meaning color, and the label text unchanged. It fails on the previous head ("Administration has one icon"). The icon-map test no longer expects kick, timeout or warn.
    • scripts/frontend-contrast-test.mjs: the tile check now targets .sidebar svg.nav-icon (fails on the previous head: rule missing), and the palette floor is seven colors now that the orange kick color is gone.
  • Earlier rounds' tests, appended at the end of each file:
    • Contrast: every icon color is at least 3:1 against every surface it's drawn on (panel, hover, zebra rows, background, inputs, sidebar, sidebar hover, active item, soft badges) in both themes. The lowest values are 3.41:1 in light and 3.70:1 in dark, and every color is at least 4.5:1 on the main panel.
    • Palette independence: both themes define every --icon-* color as a fixed value, with one rule per meaning and the same hue in both themes. Icons never use theme primary, secondary or accent.
    • Target size and focus: icon buttons are at least 24px, with focus ring, hover state and disabled state present.
    • Icon map: one shared map; Unban is not a lock; no page defines its own icon paths.
    • Page coverage: each audited page's row actions render as colored icon buttons with an aria-label and title, with no text-only row actions left. Owner-only and busy/disabled cases are covered.
    • Sidebar: each item has its icon and label, and the Administration nav has a matching test.
    • No emoji or glyphs: a source scan of UI chrome.
  • Fail-on-old-code check: I ran the first round's new tests against main's frontend. Every one failed at an assertion except the Audit log check, because that page has no row actions on main either. Three deliberate breakages were each caught: a low-contrast amber, an icon using a theme color, and a text-only "View history".
  • Existing tests: tests that clicked buttons by their visible text now find them by accessible name, with the same assertions. The Administration badge assertions check the SVG icon name instead of the glyph.
  • Rendering: a headless browser render of the built CSS looked right in both themes, including the active item and disabled buttons.

#599 has merged

#599 (the #590 density pass) has merged, and this branch is rebased onto it. With that in place, I removed the dead #tabs button span rules (nav items no longer contain a span) and my duplicate .btn.btn-icon svg width, since .btn-icon svg already sets it.

Limitations

  • Dashboard (follow-up): dashboard card icons and the dashboard's decorative "→" arrows are still left alone. Now that feat(webui): tighten global density to a desktop admin-console scale #599 has merged they are a follow-up; the glyph scan allows U+2192 until then.
  • Sample text keeps its emoji: the Badwords placeholder and the pasteable Known spam example are sample text, not icons, so the scan excludes them by name.
  • CSS checks: the tests run in jsdom, which doesn't compute CSS, so color, hover and focus are checked by parsing the stylesheet.
  • Screenshots: waived for this PR, because I check it live after the deploy.

Decisions

  • Sidebar text buttons: Administration, View as…, Exit preview and Sign out now get icons from the same map (see the sidebar section).
  • Kick, timeout and warn: dropped from the set, along with the orange kick color. They come back when a page uses them.

Summary by Sourcery

Standardize the Web UI on meaningful, accessible SVG icons with fixed intent colors across row actions, navigation, and Administration controls.

New Features:

  • Add a shared SVG icon system for row actions, status controls, sidebar navigation, and Administration navigation.
  • Introduce fixed light and dark icon intent colors with accessible, compact icon-button styling.

Bug Fixes:

  • Replace ambiguous text glyphs and emoji-based UI icons, including the unban padlock, with meaningful accessible SVG icons while preserving existing permissions, confirmations, and busy states.

Enhancements:

  • Standardize icon meanings and rendering across audited Web UI pages, including case, member, moderation, settings, server, login, and Administration controls.
  • Keep form-footer and toolbar actions as text while improving icon-button hover, focus, disabled, target-size, and sidebar active-state behavior.

Documentation:

  • Document the shared SVG icon set, fixed palette, accessibility behavior, and usage rules in the Web UI guide.

Tests:

  • Expand frontend state, Administration, and contrast coverage for shared icon mappings, palette independence, accessibility, page actions, sidebar navigation, target sizes, and removal of glyph-based icons.

@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

@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 against #588 and its scope clarifications, including all eight changed files.

  • Shared icons: Centralizes SVG paths and semantic mappings, including the green user-check Unban icon.
  • Actions and navigation: Converts row actions, sidebar items, and Administration controls while preserving labels, confirmations, permissions, and shared busy handling.
  • Styling and regression coverage: Adds independent Light/Dark icon palettes, compact targets, focus/hover styles, contrast checks, and page-level tests.
  • Validation: bash scripts/ci-preflight.sh --only frontend passed, including all 410 tests and the ESLint gate. Sampled the built UI in both themes with local API fixtures and checked computed icon sizing, colors, and focus styling; no live Discord or Bunny testing. Full per-page screenshot acceptance remains unverified.

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

…ar menu

Every row and record action on the report pages is now a compact 24px
icon button from one shared SVG set (frontend/icons.js), drawn in a
fixed color by meaning: ban and delete red, unban (a person with a check,
no longer a padlock) green, edit and view blue, warn and timeout amber,
kick orange, copy and cancel gray. Members, Cases, Badwords, Settings
access roles, command steps and Bot servers lose their remaining
text-only row actions; aria-label/title, confirmations, owner-only rows
and the ActionButton busy path are unchanged.

Every sidebar item and Administration page link shows its icon beside
its label, on a small tile so it stays readable on the inverted active
row. The old glyph nav icons and the Administration glyph badges are
replaced with SVGs; the Web UI no longer uses emoji or glyph icons.

The --icon-* palette is separate from the daisyUI theme tokens, with a
light and a dark shade per meaning that keeps at least 3:1 on every
surface icons sit on. New contrast, palette, icon-map, per-page
coverage, sidebar, no-glyph and target-size tests.

Closes #588
@jatmn
jatmn force-pushed the feat/588-webui-icons branch from 189ee58 to 3c0831b Compare November 12, 2026 23:56

jatmn commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

@pullfrog review

1 similar comment

jatmn commented Nov 13, 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 across all eight files against #588 and its scope clarifications.

  • Shared icon system: Centralizes SVG paths and intent mappings, including the green user-check Unban icon.
  • Actions and navigation: Converts row actions, sidebar items, and Administration controls while preserving accessible names, confirmations, permissions, and shared busy handling.
  • Palette and coverage: Adds independent Light/Dark colors, compact targets, hover/focus styling, documentation, and regression tests.
  • Validation: bash scripts/ci-preflight.sh --only frontend passed with 427 tests, build, and ESLint checks. Browser spot checks of Bans, Cases, and navigation confirmed theme colors and 24px action targets, including a 390px viewport, using local API fixtures only. Full per-page screenshot acceptance remains unverified; no live Discord or Bunny testing. GitHub’s CI passed check is successful.

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

@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 across all eight changed files against #588 and its scope clarifications.

  • Shared icons: Centralizes SVG paths and intent mappings, replacing the Unban padlock with a green user-check.
  • Actions and navigation: Converts row actions, sidebar items, and Administration controls while preserving accessible names, permissions, confirmations, and shared busy handling.
  • Palette and coverage: Adds independent Light/Dark colors, compact targets, hover/focus styling, documentation, and regression tests.
  • Validation: bash scripts/ci-preflight.sh --only frontend passed all 427 tests and the ESLint/audit gates. Sampled the built Bans page and sidebar in both themes with local API fixtures, confirming 24px action targets and keyboard focus styling. Full per-page screenshot acceptance and live provider behavior were not verified.

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

Administration (crown, blue), View as… (eye, blue), Exit preview (back
arrow, gray) and Sign out (log-out, gray) now show aria-hidden SVG icons
from the shared map on the sidebar icon tile, with their labels
unchanged.

Kick, timeout and warn had no page using them, so their icons, the
orange kick color and their docs rows are gone; they come back when a
page needs them. The Administration boot-mismatch badge, the one place
that borrowed the warn icon, now uses the attention icon.

Remove the dead #tabs button span rules (nav items no longer contain a
span) and the .btn.btn-icon svg size rule that duplicated .btn-icon svg.

Refs #588

@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 code issues from my review.

Merge readiness

  • #588 screenshots: the acceptance asks that "Screenshots of each page in both themes are attached to the PR." The description says none are attached yet. That isn't a code issue, but Closes #588 is incomplete until screenshots are added or that bullet is waived.
  • Still a draft.
  • CI passed, frontend checks, CodeQL and Pullfrog succeeded on 3c0831b.
  • Conventional feat(webui) title.

#588 acceptance on 3c0831b

  1. Colored, meaningful row-action icons: met. frontend/icons.js maps every action to an icon and intent, and the state tests cover the audited pages.
  2. Unban no longer a lock: met (unban → user-check, green; tests assert no lock path).
  3. Screenshots: not yet (above).
  4. Frontend state and contrast tests pass: met. frontend-state-test.mjs 345 passed (2 skipped); frontend-contrast-test.mjs 18 passed.

What I verified

  • Icon move: every icon name referenced on this head (action map, sidebar map, direct name: uses and administration badges, 34 in total) resolves in ICON_PATHS, so no existing icon goes blank. icons.js is bundled into app.js and administration.js; index.html is unchanged.
  • Contrast: the new tests hold every --icon-* shade to at least 3:1 on each surface icons sit on, in both themes. The lowest passing pairs are --icon-warning on the selected sidebar item in light (3.41:1) and --icon-kick on the selected sidebar item in dark (3.7:1). The palette is independent of theme primary/secondary/accent, so switching themes only swaps shade, not meaning.
  • Accessibility: IconButton keeps aria-label and title, the focus ring and the var(--target-min, 1.5rem) target; busy/disabled still go through ActionButton; confirm dialogs and owner-only gates are unchanged.
  • Meaning: the map matches the PR table (ban/remove/leave red, kick orange, unban/approve green, and so on). Leave uses the log-out door-and-arrow glyph, distinct from kick's door.
  • Third-party source: the SVG paths are hand-authored in icons.js, with no new dependency.

External reviews (on 3c0831b)

  • Pullfrog: three passes, no issues; also noted the missing screenshots.
  • Sourcery: summary in the description only.
  • CodeQL: success, no comments.

Backlog (not blocking)

  • kick, timeout and warn icons are mapped but not wired to row actions yet (acknowledged in the description).

jatmn commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

@pullfrog review

1 similar comment

jatmn commented Nov 13, 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 across all eight files against #588 and its scope clarifications.

  • Shared icons: Centralizes SVG paths and semantic mappings, including the green user-check Unban icon.
  • Actions and navigation: Converts row actions, sidebar items and owner controls while preserving accessible names, confirmations, permission gates and busy handling.
  • Palette and coverage: Adds independent Light/Dark colors, compact targets, hover/focus styling, documentation and regression tests.
  • Validation: bash scripts/ci-preflight.sh --only frontend passed all 428 tests plus build, ESLint and audit gates. Browser spot checks confirmed 24px Unban targets and the action/sidebar colors in both themes using local API fixtures only. No live Discord or Bunny testing; screenshots are explicitly waived in the PR description. GitHub’s CI passed check is successful.

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

@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 across all eight files against #588 and its scope clarifications.

  • Shared icons: Centralizes SVG paths and semantic mappings, including the green user-check Unban icon.
  • Actions and navigation: Converts row actions, sidebar items and owner tools, and Administration controls while retaining accessible labels, permissions, confirmations, and busy handling.
  • Palette and coverage: Adds independent Light/Dark colors, compact targets, hover/focus styling, documentation, and regression tests.
  • Validation: bash scripts/ci-preflight.sh --only frontend passed all 428 tests and build/lint/audit gates. Chromium spot checks of the built Bans page and sidebar confirmed theme colors, 24px action targets, keyboard focus, and narrow-screen navigation using local API fixtures only. No live Discord/Bunny testing or full per-page visual acceptance was performed; GitHub’s CI passed check is successful.

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 code issues from my review.

Merge readiness

  • Still a draft PR.
  • #588 screenshots: waived in the PR Decisions section (Pullfrog on 6837870 notes the same); Closes #588 is fine with that waiver.
  • Checks on 683787047878233db9c67833b46791732cd9ebec: CI passed, Checks / frontend, CodeQL, Buildkite completion, and Pullfrog (including pullfrog-approval) are green. Pullfrog filed two reviews on this head with no inline review comments. GitHub Copilot did not post a review on this PR. Sourcery appears only as the auto-generated summary in the PR description, not as a separate review thread.

Round 2 (6837870) — verified on head

  1. Removed kick / timeout / warn action icons and --icon-kick: Nothing on head still references those icon keys, CSS vars, or ACTION_ICONS entries in a way that would render a blank or undefined icon color. Moderation kick, timeout, and warn strings in rule editors and API payloads are unchanged and are not icon-map keys. Boot mismatch now uses badge("Boot mismatch", "warn", "attention") — amber soft badge shell, red alert-circle icon — matching the PR Decisions note that unused warn icon paths were dropped.
  2. Icon registry: ICON_PATHS defines 32 paths; ICON_INTENTS lists 7 intents with matching --icon-* variables. Every ACTION_ICONS and NAV_ICONS entry resolves; direct Icon uses such as external-link resolve as well.
  3. CSS cleanup: Tab buttons have been Icon + label text nodes (no inner <span>) since the first commit on this branch, so removing #tabs button span rules does not drop styling anything still uses. Row icon sizing stays on .btn-icon svg at 1rem. The sidebar tile rule is .sidebar svg.nav-icon { … background: var(--panel); }, covering tab icons and the owner footer controls that pass className: "nav-icon".
  4. Sidebar text buttons: Each decorative SVG has aria-hidden="true"; visible names stay Administration, View as…, Exit preview, and Sign out; blue/gray intents pass the sidebar contrast suite in both themes.
  5. Palette floor 8 → 7: Matches the real seven intent colors after removing kick orange — not a weakened gate.
  6. Tests vs 3c0831b: The new state test the sidebar's own buttons show their colored SVG icons beside unchanged labels does not exist on 3c0831b. The contrast tile assertion now requires .sidebar svg.nav-icon; on 3c0831b the stylesheet still used #tabs svg.nav-icon, so that assertion fails for the right reason when the new test is run against the old head.
  7. Docs: docs/WEBUI.md matches the head maps (including sidebar text-button examples) and the seven-color palette rules.

Validation (this review)

  • npm run build --prefix tools/webui
  • node --test scripts/frontend-state-test.mjs — 346 passed, 2 skipped
  • node --test scripts/frontend-contrast-test.mjs — 18 passed
  • node --test scripts/administration-state-test.mjs — 46 passed

External reviews (on 6837870)

  • Pullfrog: ✅ no new issues (two head reviews); no unresolved inline feedback.
  • Sourcery: summary-only in the PR body.
  • CodeQL: success, no review comments.
  • Copilot: not requested / no review on head.

Backlog (not blocking this PR)

  • Dashboard card icons and decorative → on dashboard setup links remain the acknowledged dashboard follow-up (glyph scan still excludes U+2192). Info-tip ⓘ is older chrome outside the round-2 diff.
  • When row actions need kick, timeout, or warn icons, add them in that feature work — not by keeping unused paths in this PR.

@jatmn
jatmn marked this pull request as ready for review November 13, 2026 00:35
@sourcery-ai

sourcery-ai Bot commented Nov 13, 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 18 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@jatmn
jatmn merged commit 4d3811e into main Nov 13, 2026
16 checks passed
@jatmn
jatmn deleted the feat/588-webui-icons branch November 13, 2026 00:38
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): colorful, meaningful action icons across every report-style page (follow-up to #582)

1 participant