Skip to content

chore(webui): track leftover CSS and dependency cleanup after the redesign #1127

Backlog

Description

@jatmn

🤖 Kit (jatmn's assistant agent)

Umbrella for the post-redesign Web UI cleanup. Dustin asked that unused libraries, leftover CSS, and first-party stand-ins be removed after the redesign, then that the work be split: easy deletes vs the reworks that switch us onto Mantine / Sentinel.

The detailed audit (five passes, counts, and switch-over table) is in this comment, from a read-only look at main at de66727. There are no leftover daisyUI, Headless UI, or chart/icon packages to uninstall; the bloat is first-party skins and unsynced theme plumbing left after #1096.

This issue no longer holds that work itself. Each child below is self-contained. #1130 can be done now. The reworks can also start, but must follow the order notes so they do not fight #1123, #1125, or #1126. None of the children replace #1123's page-by-page restyle; they only switch shared primitives.

Order

  1. #1130 — delete already-dead CSS/JS (no dependencies).
  2. Prefer #1136 (token/reset consolidation) before, or tightly coordinated with, fix(webui): rework the dark mode color palette for contrast and navigation #1125 (dark palette) and fix(webui): increase the overall UI scale slightly #1126 (scale), so those issues edit one mapped theme instead of two. If fix(webui): rework the dark mode color palette for contrast and navigation #1125 or fix(webui): increase the overall UI scale slightly #1126 lands first, refactor(webui): consolidate theme tokens and CSS resets onto Mantine #1136 must map the tokens they settled and must not revert them.
  3. #1131 (buttons) should land before fix(webui): rework the dark mode color palette for contrast and navigation #1125 tunes button affordance, or fix(webui): rework the dark mode color palette for contrast and navigation #1125 should tune Mantine Button rather than the daisy .btn sheet.
  4. #1133 (cards) and #1135 (modal interiors) coordinate with fix(webui): apply redesign styling to remaining pages and settings dialogs #1123: one card language (Paper + .sf-card) and one dialog structure (Mantine Modal parts). Do not restyle every remaining page or dialog a second time.
  5. #1132 (form controls), #1134 (toast / InfoTip), and #1137 (shared tables) are independent of fix(webui): apply redesign styling to remaining pages and settings dialogs #1123 and can proceed in parallel. Form control heights should use the same scale tokens as fix(webui): increase the overall UI scale slightly #1126.

Children

  • #1130 — chore(webui): delete already-dead CSS and JS
  • #1131 — refactor(webui): switch daisy-era buttons to Mantine Button
  • #1132 — refactor(webui): switch form controls to Mantine inputs
  • #1133 — refactor(webui): replace daisy card stacks with Sentinel Paper cards
  • #1134 — refactor(webui): replace custom toast and InfoTip with Mantine Notifications and Tooltip
  • #1135 — refactor(webui): rebuild modal-box dialog interiors on Mantine Modal
  • #1136 — refactor(webui): consolidate theme tokens and CSS resets onto Mantine
  • #1137 — refactor(webui): switch DataTable zebra styles to Mantine Table

Not filed as separate issues (smaller or entangled; pick up here or in a child if convenient): leftover daisy .badge classes (24 uses; 33 call sites already use Mantine Badge), ServerPicker / .menu vs Mantine Select (coordinate with #1122), .sf-tri vs SegmentedControl, LetterAvatar vs Avatar, and the no-op color-scheme manager (covered in #1136 if touched at all). Do not replace the first-party charts or the #588 icon set.

Final step (this issue)

After the children above are merged (and #1123 has landed, so leftover page CSS from the restyle is also eligible):

  • Prune unused first-party CSS/JS, unused Mantine CSS layers and tools/webui/mantine.js exports, and anything the restyle or switch-over PRs added and then abandoned.
  • Prune tools/webui/package-lock.json after any package.json change; keep exact version pins. Do not remove @mantine/hooks (required peer). Lockfile-only transitives that never appear in the bundle (react-number-format, some @floating-ui/* packages) stay unless Mantine no longer depends on them.
  • Update scripts/package-webui-test.mjs so it no longer requires retired daisy widgets in the built CSS, and update docs/WEBUI.md if the dependency table changes.
  • Report published JS and CSS bundle sizes before and after, from the built assets and dist/webui-metafile.json.

Acceptance criteria (umbrella)

  • Every child is done or explicitly dropped with a reason.
  • The final prune step is complete: no unused deps or dead CSS/JS left from this cleanup, build and tests pass, no visual regressions in Light / Dark / System.
  • Bundle size is reported before and after.
  • Removals follow the latest-upstream rule: official published packages only, no forks or patches.

Activity

  1. jatmn commented on Dec 3, 2026

    @jatmn
    OwnerAuthor

    🤖 Kit (jatmn's assistant agent)

    Follow-up from Dustin (2026-12-02, 11:40–11:42 PM PT): dig for libraries, CSS, and elements we still carry even though a newer library already provides them, and switch over so we can drop the old copies. Run several independent audit passes — the Web UI has been restyled many times and is likely still carrying bloat.

    Investigated read-only on main at de66727, including a local npm ci --ignore-scripts --prefix tools/webui + npm run build only to read dist/webui-metafile.json and published asset sizes. No knip/depcheck package was added; the same checks were done with lockfile + import + metafile scans, unused-export grep, unused-CSS grep, and git history (-S and the redesign merge commits). No code changes and no assignee.

    The large switch-over still belongs after #1121–#1126 (especially #1123). A small set of already-dead leftovers can be deleted in the same cleanup without waiting for behavior changes.

    Pass-by-pass summary

    1. Package / dependency pass

    Current direct pins in tools/webui/package.json are all used: React 19.3.1, @mantine/core + @mantine/hooks 9.8.3 (hooks is a required peer; it also ships ~7.3KB in webui-runtime.js even though app code does not import it), and devDependencies esbuild, es-module-lexer, and jsdom (build and tests). tools/eslint/ is host-only and is not in the Web UI bundle.

    There is no second UI, chart, or icon npm package to delete today. scripts/package-webui-test.mjs already asserts that daisyUI, Headless UI, and TanStack are gone (retired in #1096).

    Published JS (esbuild bytesInOutput): react-dom 209,844, @mantine/core 108,476, react 8,913, @mantine/hooks 7,353, scroll-lock helpers (react-remove-scroll and related) ~11KB, first-party 394,641. Disk: webui-runtime.js 387,657 bytes, app.js 380,930, administration.js 30,625.

    Published CSS: 147,159 bytes total — @mantine/core layers 67,750, frontend/style.css 60,286, frontend/controls.css 5,522.

    Lockfile-only transitives that do not appear in the bundle at all: react-number-format (Mantine NumberInput), @floating-ui/core, @floating-ui/dom, @floating-ui/react-dom. They stay while @mantine/core depends on them; they are not a manual uninstall. @floating-ui/react is emitted (small ScrollArea ref helper), which matches the existing package test.

    The bloat is not a pile of leftover npm libraries. It is first-party CSS/JS that still reimplements Mantine and leftover layers from earlier redesigns.

    2. CSS pass

    frontend/style.css (1,045 lines) + frontend/controls.css (147 lines) + selected Mantine layers in tools/webui/style.css. 501 unique class selectors. Usage grep against JS/HTML/tests found 22 not mentioned literally; 14 of those are live dynamic names (an-heat-${n}, icon-${intent}, sf-tri-${mode}, sf-infra-fill-${dbTone}). .mantine-Badge-label is a Mantine internal hook and should stay until Badge is fully themed.

    Already unreferenced (17 CSS lines, plus 2 more for the dead trend picker):

    Selector Where Why it is dead
    .platform-stats (8 lines) frontend/style.css JS last used this in #626; the fleet view now uses an-kpis / KpiTile
    .trend-card, .trend-picker, .trend-pick-active (3 lines) same Only referenced by dead TrendMetricPicker left behind after #612 / #626
    .nav-label (3 lines) same JS usage removed in #1118; CSS was not
    .action-row, .empty-state, .step-actions (4 lines) same daisy-era leftovers; JS references last appear in very old commits (#85 / #88 / #175)
    .sf-dot-bad (1 line) same Added in #1118; the ribbon only toggles sf-dot-warn / sf-dot-good

    Duplicate / stacked layers (still live, but overlapping):

    • Two token systems: first-party :root / :root[data-theme] (--bg, --panel, --text, --accent, …) and Mantine CSS variables. Only 8 Mantine vars are mapped in frontend/appearance.js (webuiColors). Almost all app CSS still talks to --panel / --text directly. Extra local palettes: --ui-* and --radius-* in controls.css (feat(webui): tighten global density to a desktop admin-console scale #599 / feat(webui): global density pass, desktop-sized UI scale across all pages #590), --an-*, --icon-*, --du-tone, --br-tone, --status-tone. --focus is mostly bypassed; the shared ring uses --accent, and --focus remains only on .an-figure svg and .pa-sort.
    • Two resets: frontend/style.css (* { box-sizing }, html, body margin) and frontend/controls.css typography/form margin reset, plus already-imported @mantine/core baseline.layer.css and global.layer.css.
    • Control skins defined in controls.css and extended again in style.css: .btn, .input, .select, .textarea, .card / .card-body, .badge, .alert, .table, .toggle, .menu, .stat. .modal-action is defined twice in style.css (lines 257 and 330). #1118 restyled .dashboard-section .stats on top of the older .dashboard-section block instead of replacing it (lines 244–248 vs 908–914).
    • Leftover daisy @layer utilities { .rounded-box } and utilities .bg-base-100, .bg-base-200, .text-warning (the last has no JS hits).
    • 5 !important rules (.hidden, a narrow-screen .field flex, .getting-started border, .case-note margin, .rule-list-card.sf-wb-selected border). Not a pile, but they exist to win fights with earlier layers.

    3. JS / component pass

    No unused frontend files. All of appearance.js, state.js, list-controls.js, no-autofill.js, icons.js, and charts.js are imported. No dead workspace tabs: every WORKSPACE_HUBS tab has a page function. No feature flag that still mounts an old shell.

    Already-dead JS in frontend/charts.js: TREND_METRICS, useTrendMetric, and TrendMetricPicker (~35 lines). Nothing in frontend/ or scripts/ imports them; they only exist for a picker the #612 / #626 redesign stopped rendering. ListPageSize is used, but does not need to be exported.

    Custom UI that duplicates Mantine (still in use, high switch-over value): see the table below. Standout counts: 136 className: "btn…" vs 3 Mantine Button call sites; 80 toast() calls on a home-grown #toast + .alert stack; 49 custom Input / 5 Select / 7 Textarea wrappers (they are Box + daisy classes, while Input.layer.css and Combobox.layer.css are already in the CSS bundle); 7 custom InfoTip implementations (~50 lines + .info-tip* CSS); editors already sit in Modal.Root / Modal.Content / FocusTrap but still paint .modal-box interiors; DataTable already wraps Mantine Table but still forces table table-zebra.

    Domain logic to keep: draft/save (useDraftControl, ActionButton busy path), noAutofill, createState / useStore, cursor/windowed list pagination (Mantine Pagination is numeric pages and is a poor fit), first-party charts, and the #588 icon set (intentional; do not replace with Tabler just because Mantine often uses it). Platform analytics has a runtime “legacy” API fallback, and command delete-days has a “legacy” option — those are product behavior, not UI-library bloat.

    4. Git-history pass

    Walked the redesign merges and git log -S for leftover selectors:

    Earlier page stacks that #1123 must replace, not just delete, also date from #587 (Analytics), #613 (Database Usage), #618 (Platform), #624–#625 (Cases/Bans), #649 (Audit log), and #652 (Bot Resources).

    5. Assets pass

    No image, SVG file, font file, or favicon lives under frontend/ or tools/webui/. Icons are hand-authored path data in frontend/icons.js; every ICON_PATHS entry is referenced from NAV_ICONS / ACTION_ICONS / DASHBOARD_ICONS. Inter is named in frontend/style.css and in the Mantine theme, but is not bundled or loaded from a CDN. vendor/ is the Rust tokio-tungstenite crate only. The API embed-ui feature embeds the built frontend; it is not a leftover package. No unused static asset to delete today.

    Estimated removable size

    Bucket Estimate When
    Already-dead CSS + JS ~20 CSS lines + ~35 JS lines (negligible bytes) Safe in this cleanup; does not need the restyle
    First-party daisy control sheet controls.css 5,522 bytes in the published CSS, 147 lines, plus overlapping .btn / .card / .modal-* / utility rules in style.css After switching controls to Mantine and finishing #1123
    Legacy page CSS blocks ~256 lines in style.css (Analytics, Platform, Usage, Resources, Cases, Bans, Audit) Rewritten by #1123, then pruned here; not a pure delete
    Realistic published-CSS shrink on the order of 8–20KB of the current 147KB style.css if the daisy sheet, dead rules, and unified page chrome go, before adding any new Mantine layers (Tooltip, Alert, Notifications, Switch, …) After switch-over
    JS bundle Little change in React (209KB) or Mantine core (108KB). First-party JS shrinks only by the dead helpers and any replaced tooltip/toast code, not tens of KB, unless #1123 also deletes large unused page branches (it should not). After switch-over

    Adding official Mantine packages or extra CSS layers can claw back some of the CSS win. Measure before/after with dist/webui-metafile.json and the published style.css / webui-runtime.js sizes.

    Overlap and switch-over

    Switch to the official latest Mantine (or existing Sentinel tokens/components) and then delete the old copy. No forks or patches. Prefer theming Mantine to Sentinel tokens over keeping a parallel daisy-era skin. Do not rip out Sentinel hub pills / workbench chrome just to use unstyled Mantine Tabs — theme Mantine to Sentinel where it helps, or keep that chrome first-party.

    What we carry File refs (counts on main) Newer replacement Effort Drop after switch
    Daisy-era buttons (.btn, .btn-primary, .btn-sm, …) frontend/controls.css; 136 class uses; Mantine Button used only 3 times (Admin Refresh + two workbench actions). Theme already customizes Button in frontend/appearance.js. @mantine/core Button (already in the bundle) M .btn* rules, including .btn-icon / .btn-square once icon buttons move
    Icon row buttons IconButton in frontend/app.js; .btn-icon in frontend/style.css; 24 uses ActionIcon S/M IconButton default daisy classes; keep #588 Icon SVGs
    Inputs, selects, textareas Custom Input / Select / Textarea (Box + daisy classes, 49 / 5 / 7 uses). Input.layer.css and Combobox.layer.css already ship. Appearance picker is also a native <select>. Date filters are already native type="date" — do not add @mantine/dates just for that. TextInput, Textarea, NativeSelect or Select; wrap to keep noAutofill + draft hooks M .input, .select, .textarea CSS; re-check whether Combobox.layer.css is still needed
    Cards 88 className: "card…" / bg-base-100; Paper already used; Sentinel .sf-card used 6 times, often stacked on card bg-base-100 Paper + .sf-card only M (with #1123) .card, .card-body, .card-border, .card-title, .card-actions, .bg-base-100 / .bg-base-200
    Badges 33 Mantine Badge + 24 daisy .badge classes; .badge CSS also patches .mantine-Badge-label Badge variants only, themed in webuiTheme S/M First-party .badge* (keep a theme styles hook if needed)
    Alerts Custom .alert / .alert-soft; Alert CSS layer is not imported Alert (add the official CSS layer) S .alert*
    Tables DataTable / PagedTable wrap Table but still use table table-zebra (19 table class uses) Table striped / stickyHeader / highlightOnHover S/M .table-zebra and redundant .table skins; keep the scroll region if still needed
    Modal interiors Already Modal.Root / Overlay / Content + FocusTrap (6 dialogs); interiors still .modal-box / .modal-action / .rule-editor Modal.Header / Title / Body / CloseButton + Sentinel inspector chrome M (with #1123) .modal-box, .modal-overlay, .modal-action
    Toasts Custom toast() (80 calls) + Notification + .toast / .alert Official @mantine/notifications (new latest-upstream package + CSS) S/M toast, Notification, .toast
    Tooltips Custom InfoTip (7 uses, ~50 lines) + .info-tip* CSS, including a “ⓘ” glyph trigger Tooltip S InfoTip and .info-tip*
    Toggle / checkbox 9 .toggle uses + .checkbox CSS Switch, Checkbox (add official CSS layers) S .toggle, .checkbox skins
    Server picker listbox / .menu Custom ServerPicker (aria listbox, outside-click, keyboard) + .menu CSS (3 uses) Select / Combobox or Menu, preserving icons and the documented keyboard behavior M .menu / picker chrome CSS; keep enrollment status behavior
    Segmented Off/Dry/Live .sf-tri (Sentinel, #1118) SegmentedControl themed to Sentinel tokens, keeping ≥24px targets M .sf-tri* if the themed control covers it
    Letter avatars LetterAvatar + .case-avatar Avatar S .case-avatar* if Avatar is themed
    Color scheme plumbing Custom useAppearance + matchMedia + localStorage + a no-op colorSchemeManager stub, plus documentElement.dataset.theme @mantine/hooks useHotkeys is optional; useComputedColorScheme / Mantine’s localStorage manager can own the scheme if dataset.theme and the theme-color meta still update M The no-op manager; do not drop token sync
    Debounced list search SEARCH_DELAY_MS + setTimeout in frontend/list-controls.js useDebouncedValue / useDebouncedCallback S The hand-rolled timer, if the flush-on-navigate behavior is preserved
    Clipboard copy 5 navigator.clipboard.writeText call sites useClipboard or CopyButton S Repeated copy click handlers (keep IconButton “copy” where it is the visible control)
    Visually hidden / layout utilities .sr-only (14 uses, including FocusTrap.InitialFocus), .w-full, .hidden, .row, .muted VisuallyHidden; Mantine style props / Group for simple layout S Utilities that become unused; .muted may stay as a token helper
    Parallel tokens + resets :root tokens vs --mantine-color-*; two first-party resets vs Mantine baseline/global One source of truth: extend cssVariablesResolver and/or migrate app CSS onto the same vars; rely on Mantine baseline where it already covers box-sizing and type resets L Duplicate reset rules; unused --focus if rings all use --accent; leftover daisy @layer utilities
    Dashboard .stats stack .dashboard-section / .stats still used on Command Center, restyled again in #1118 .sf-card bento / KPI tiles already used beside it S/M Older .dashboard-section .stats rules once the overview tiles are on bento
    Custom charts / icons frontend/charts.js (first-party SVG, 19.7KB in the bundle); frontend/icons.js Keep. @mantine/charts or Tabler would add a dependency and fight #588 / #1123. Optional later, not this cleanup. — Nothing now

    Checklist

    • Delete the already-dead CSS and JS listed in passes 2–4 (trend picker helpers, .platform-stats, .nav-label, .action-row, .empty-state, .step-actions, .sf-dot-bad, .trend-card / .trend-picker).
    • Switch buttons, inputs, badges, alerts, tables, modal interiors, toasts, tooltips, switches, and avatars to Mantine (themed to Sentinel tokens).
    • Stop stacking card bg-base-100 under .sf-card; one card language.
    • Collapse token/reset duplication; map or migrate so app CSS and Mantine share one palette.
    • Update scripts/package-webui-test.mjs (it currently requires leftover .btn, .card, .bg-base-100, .rounded-box, and similar to remain in the built CSS) and docs/WEBUI.md.
    • Report published JS/CSS sizes before and after, from the assets and dist/webui-metafile.json.
    • Removals follow the latest-upstream rule: official published packages only, no forks or patches.

    Extra acceptance criterion

    Every item we replace with a newer library or with Sentinel tokens/components is actually switched over, and the old dependency, CSS, or first-party stand-in is removed — not left behind “for compatibility” the way #1096 had to leave the daisy class language.

  2. changed the title [-]chore(webui): audit and remove unused libraries, dependencies and legacy CSS after the redesign[/-] [+]chore(webui): track leftover CSS and dependency cleanup after the redesign[/+] on Dec 3, 2026
  3. jatmn commented on Dec 3, 2026

    @jatmn
    OwnerAuthor

    🤖 Kit (jatmn's assistant agent)

    Merge order for this umbrella is in the master plan: #1151.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions