Skip to content

refactor(webui): switch form controls to Mantine inputs - #1172

Merged
jatmn merged 2 commits into
mainfrom
refactor/mantine-inputs-1132
Dec 4, 2026
Merged

jatmn merged 2 commits into
mainfrom
refactor/mantine-inputs-1132

Conversation

@jatmn

@jatmn jatmn commented Dec 4, 2026 •

Copy link
Copy Markdown
Owner

Closes #1132
Part of #1127, #1151 (Phase 2).

Summary

  • Export Checkbox, Switch, TextInput, and Textarea alongside NativeSelect from tools/webui/mantine.js and import InlineInput.layer.css, Checkbox.layer.css, and Switch.layer.css in tools/webui/style.css (retaining Combobox.layer.css because NativeSelect renders ComboboxChevron).
  • Theme Mantine Input, TextInput, Textarea, NativeSelect, Checkbox, and Switch onto the shared Sentinel tokens (--control-height, --compact-height, --target-min, --radius-field, --input, --input-border, --accent, --accent-text, --panel2, --muted, --bad) with zero hardcoded hex literals in frontend/appearance.js.
  • Migrate all text inputs (including native type="date" list filters without adding @mantine/dates), selects (including Appearance), textareas, switches, and checkboxes across frontend/app.js, frontend/appearance.js, frontend/administration.js, and frontend/list-controls.js to Mantine components while preserving useDraftControl, noAutofill, FieldId, BusyContext, ref forwarding, and ServerPicker's custom listbox (feat(webui): larger server icons and an expandable sidebar showing server names #1122).
  • Remove all daisy .input, .select, .textarea, .toggle, and .checkbox classes and first-party skins from frontend/controls.css and frontend/style.css.
  • Update scripts/package-webui-test.mjs, scripts/frontend-contrast-test.mjs, scripts/frontend-state-test.mjs, and scripts/administration-state-test.mjs with regression coverage for Mantine form controls and removal of retired daisy form classes.

Validation

  • bash scripts/ci-preflight.sh --only frontend — passed (webui build + audit, ESLint + selftest + flake checks, frontend-state-test.mjs 631/631 including real headless Firefox densityProbe in Light & Dark at 1280×800 / 1920×1080 / 700×800, frontend-contrast-test.mjs 39/39, frontend-warmup-test.mjs 13/13, frontend-sr-only-test.mjs 1/1, package-webui-test.mjs 4/4, administration-state-test.mjs 42/42).
  • Post-rebase verification on 5c6a07d: npm run build --prefix tools/webui + frontend-contrast-test.mjs + package-webui-test.mjs + administration-state-test.mjs + eslint-web-selftest.sh + git diff --check — all passed.
  • Reviewed SHA: b8c682bc86773c557c3f7b6929da3f326916c5e8

Summary by Sourcery

Standardize frontend form controls on Mantine while preserving existing form behavior and the custom server picker.

Enhancements:

  • Migrate workspace, administration, appearance, and list-filter text fields, selects, textareas, checkboxes, and switches to Mantine controls, while retaining native date inputs and the custom server picker.
  • Apply shared Sentinel theme tokens and sizing to Mantine form controls, including visible focus and contrast styling.
  • Remove retired daisy form-control classes and styles from the frontend.

Build:

  • Include the Mantine input, checkbox, and switch styles and components in the WebUI bundle.

Tests:

  • Add regression coverage for Mantine form-control rendering, accessibility and sizing, and removal of retired daisy classes.

@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

Disabled switches can show a second checkbox over their label. Fix the shared switch styling before merging.

Approach — Using Mantine behind the shared field wrappers keeps draft tracking, native refs, and busy-state handling in the application.

Reviewed changes

  • Workspace forms. Migrated settings, moderation, and list controls, including the native date filters.
  • Administration and appearance. Migrated release policy, alert-channel, and theme fields.
  • Shared styling and coverage. Mapped Mantine inputs to the existing theme tokens, preserved the custom server picker, and checked the production CSS bundle and Firefox control sizing.

The WebUI build and 117 focused tests passed across workspace behavior, administration, contrast, and packaging. A Chromium fixture with Mantine 9.8.3 and the compiled PR CSS confirmed the rendering and interaction regressions below and inline. The full workspace test run reached the shell’s 120-second limit.

Non-blocking

  • Long entries lose their resize handle. Mantine defaults Textarea to resize: none, so users pasting a long Known spam sample into the five-row field can no longer expand it to inspect the message. Set resize: "vertical" for the shared textarea. Known spam sample · Mantine textarea styles
  • Search and numeric fields lose native pointer shortcuts. In Chromium, the migrated rule search loses its clear button and the Onboarding Trap join window loses its increment and decrement arrows. Preserve those affordances in the shared input styling. Rule search · Join window · Mantine input styles

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

Comment thread frontend/controls.css Resolved
pullfrog[bot]
pullfrog Bot previously approved these changes Dec 4, 2026

@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 976d00d, the follow-up to the review of b8c682b.

  • Fixed disabled switch rendering. Kept the native input transparent and applied disabled opacity to the visible track.
  • Added contrast-suite coverage. Asserted the opacity rules for the native input and track.

Verified in Chromium with the built stylesheet and real Mantine switches. The native input stayed transparent for checked and unchecked disabled switches in both light and dark themes. The WebUI build and all 44 contrast and packaging tests passed.

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

@jatmn
jatmn marked this pull request as ready for review December 4, 2026 05:39
@sourcery-ai

sourcery-ai Bot commented Dec 4, 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 14 hours and 4 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Dec 4, 2026

Copy link
Copy Markdown

Linked issues

Checked at commit fb06467

#1132 refactor(webui): switch form controls to Mantine inputs · 6 of 6 met

# Requirement Status Notes
1 Export Checkbox, Switch, TextInput, and Textarea, and include their required Mantine CSS layers while retaining Combobox styles for NativeSelect. ✅ Met The components are re-exported from tools/webui/mantine.js; InlineInput, Checkbox, and Switch layers are added, and Combobox.layer.css remains.
2 Theme Mantine form controls with shared Sentinel tokens, without hardcoded hex literals in appearance.js. ✅ Met The theme sets defaults and token-backed variables for the input, checkbox, and switch components; the control skins use the shared sizing and color tokens.
3 Migrate text inputs, selects, textareas, switches, and checkboxes across the named frontend files while preserving draft/autofill behavior, FieldId, BusyContext, refs, and ServerPicker's custom listbox. ✅ Met The app wrappers retain draft handling, FieldId, BusyContext, and prop/ref propagation; the ServerPicker listbox remains custom.
4 Keep native type=date list filters and remove daisy form-control classes and first-party skins. ✅ Met List controls still use native date inputs, now rendered as Mantine TextInput; the retired control skins and usages are removed.
5 Keep draft, save, validation, and autofill-opt-out behavior unchanged. ✅ Met The draft and no-autofill wrappers remain in use, and the ban duration validation now uses Mantine's error prop.
6 Maintain the existing Light and Dark contrast bar and pass the build and frontend tests, updating regression coverage for Mantine controls and retired classes. ✅ Met The contrast, state, package, and administration tests are updated; the PR description reports the requested build and frontend checks passing.

@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 the rebase from 976d00d to fb06467 onto the UI-scale changes in #1171.

  • Scaled label spacing. Carried the .25rem label gap into the shared Mantine field rule so it follows the browser’s root text size.
  • Preserved density and picker coverage. Carried forward the updated typography and server-icon expectations alongside the Mantine switch and custom server-picker assertions.

The WebUI build and 99 focused test cases passed, including headless Firefox layout checks in both themes, enlarged-text layout, administration state, contrast, and packaging.

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

@jatmn
jatmn merged commit 4935390 into main Dec 4, 2026
18 checks passed
@jatmn
jatmn deleted the refactor/mantine-inputs-1132 branch December 4, 2026 06:01
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.

refactor(webui): switch form controls to Mantine inputs

1 participant