Skip to content

refactor: dialogs, menus, popovers and selects on bits-ui - #336

Merged
HardMax71 merged 1 commit into
mainfrom
refactor/frontend-bits-ui-overlays
Oct 11, 2026
Merged

HardMax71 merged 1 commit into
mainfrom
refactor/frontend-bits-ui-overlays

Conversation

@HardMax71

@HardMax71 HardMax71 commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

First part of #327: the overlays. Tables, cards and buttons come next, then forms, mode-watcher, runed and splitting the big routes.

Dialogs, menus, popovers and selects now come from bits-ui, imported from npm and styled with our own Tailwind classes. shadcn-svelte was the other option, but it copies component source into the repo, and that's code we'd then own. Modal wraps the bits-ui Dialog and keeps its props, so its callers didn't change. The language picker, the user menu, the event export menu, the notification popover and the theme select drop their click-outside handlers, open flags and arrow-key code. The settings history dialog uses Modal instead of its own markup. Two classes in components.css, .floating-panel and .floating-item, style every menu surface and item, and the old modal and dropdown CSS is gone.

The behaviour gains are focus trapping, scroll lock, focus returning to the opener, typeahead and submenus that work from the keyboard. Notification rows are real buttons now, and the Admin and Settings entries in the user menu are links.

runed, which bits-ui depends on, lists SvelteKit 2 as an optional peer. npm then nested a second SvelteKit with the CommonJS cookie 0.6, and the build failed on parseCookie. An override in package.json points runed at our SvelteKit 3, so npm ls shows one copy.

Content in a bits-ui portal renders at the end of document.body, so the tests query through screen. happy-dom lays nothing out, and bits-ui checks a click outside against the content's box, so those tests moved to the browser. The observer stubs in vitest.setup.ts became classes, since floating-ui constructs them with new.

Vitest passes 1040 tests with coverage at 95.35 / 78.6 / 95.05 / 95.9. Check, lint, stylelint, prettier and the build are clean. Against a local backend the Playwright suite passes 147 tests, and the 3 failures are the k3s-only execution tests. In Chrome, with no CSP violations or console errors:

  • The language menu works from the keyboard alone.
  • The user menu closes on an outside click.
  • The notification popover closes on Escape and gives focus back to the bell.
  • The Create User dialog locks scroll, keeps focus inside for 12 tabs, and closes on Escape or an outside click with focus back on its button.
  • The export menu items work.
  • The theme select switches to dark.

Summary by cubic

Replaces the hand-rolled dialogs, menus, popovers and selects with bits-ui components styled with our own Tailwind classes. The gains are focus trapping, scroll lock, focus returning to the opener, typeahead and keyboard-driven submenus. Modal wraps the bits-ui Dialog and keeps its props, so its callers didn't change.

  • The language picker, user menu, event export menu, notification popover and theme select drop their click-outside handlers, open flags and arrow-key code. The .floating-panel and .floating-item classes in components.css replace the old modal and dropdown CSS, the settings history dialog uses Modal, notification rows become real buttons, and the Admin and Settings menu entries become links.
  • runed, which bits-ui depends on, lists SvelteKit 2 as an optional peer, so npm nested a second SvelteKit with the CommonJS cookie 0.6 and the build failed on parseCookie; an override in package.json points runed at our SvelteKit 3.
  • Bits-ui content renders in a portal at the end of document.body, so tests query through screen and the click-outside tests moved to the browser; the observer stubs in vitest.setup.ts became classes because floating-ui constructs them with new.

Written for commit cada3fb. Summary will update on new commits.

View guided diff Turn on auto-fix

Modal wraps the bits-ui Dialog and keeps its props. The language picker, the user menu, the event export menu, the notification popover and the theme select move from hand-rolled dropdowns with click-outside handlers and arrow-key code to bits-ui DropdownMenu, Popover and Select. The settings history dialog uses Modal instead of its own markup.

runed, which bits-ui depends on, declares SvelteKit 2 as an optional peer, so npm nested a second SvelteKit with an old CommonJS cookie package that broke the build. An override points runed at our SvelteKit 3.

Part of #327.
@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2e506064-32e4-4407-94d0-b6d8a79be1fe

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added documentation Improvements or additions to documentation area: frontend Svelte UI and the generated API client labels Oct 11, 2026
@sonarqubecloud

Copy link
Copy Markdown

@codecov-commenter

codecov-commenter commented Oct 11, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 92.00000% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
frontend/src/routes/(auth)/settings/+page.svelte 93.33% 0 Missing and 3 partials ⚠️
frontend/src/components/Header.svelte 92.85% 0 Missing and 2 partials ⚠️
frontend/src/components/Modal.svelte 81.81% 0 Missing and 2 partials ⚠️
...ontend/src/components/editor/LanguageSelect.svelte 90.47% 0 Missing and 2 partials ⚠️
frontend/src/components/NotificationCenter.svelte 91.66% 0 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Flag Coverage Δ
backend-e2e 82.97% <ø> (+0.02%) ⬆️
backend-unit 72.33% <ø> (ø)
frontend-unit 88.21% <92.00%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
frontend/src/routes/admin/events/+page.svelte 91.13% <100.00%> (+1.36%) ⬆️
frontend/src/components/NotificationCenter.svelte 88.37% <91.66%> (-0.64%) ⬇️
frontend/src/components/Header.svelte 89.32% <92.85%> (-0.95%) ⬇️
frontend/src/components/Modal.svelte 85.71% <81.81%> (+1.09%) ⬆️
...ontend/src/components/editor/LanguageSelect.svelte 93.33% <90.47%> (+0.78%) ⬆️
frontend/src/routes/(auth)/settings/+page.svelte 90.90% <93.33%> (+0.24%) ⬆️

... and 1 file with indirect coverage changes

Components Coverage Δ
Backend 91.45% <ø> (+0.01%) ⬆️
Frontend 88.21% <92.00%> (-0.11%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@HardMax71
HardMax71 merged commit fb1d3f7 into main Oct 11, 2026
22 checks passed
@HardMax71
HardMax71 deleted the refactor/frontend-bits-ui-overlays branch October 11, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: frontend Svelte UI and the generated API client documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants