Skip to content

fix(feedback-widget): dark-mode adaptation + clearer placeholder#7282

Merged
MarkusNeusinger merged 1 commit into
mainfrom
fix/feedback-widget-dark-mode
May 18, 2026
Merged

fix(feedback-widget): dark-mode adaptation + clearer placeholder#7282
MarkusNeusinger merged 1 commit into
mainfrom
fix/feedback-widget-dark-mode

Conversation

@MarkusNeusinger
Copy link
Copy Markdown
Owner

Summary

  • FeedbackWidget surfaces (main FAB, mini-FAB stack, "Thanks!" toast, popover Paper + TextFields + toggle buttons + secondary text) now use CSS theme tokens (--bg-surface, --bg-elevated, --ink, --ink-muted, --rule) instead of MUI palette tokens, so they track the active light/dark scheme.
  • Placeholder copy changed from "Typo, weird chart, feature idea…" to "Bug, idea, typo, anything…" — bugs are a reactable category (🪲 already in the toggles) and the new wording reads less dismissive.

Context

MUI's palette is hard-pinned to mode: 'light' in app/src/main.tsx; dark mode runs only through CSS custom properties on <html>. Components using MUI tokens like background.default, text.primary, background.paper, text.secondary, action.hover therefore stay cream-on-dark when the user enables dark mode. The FeedbackWidget was such a component.

The structural cure (migrating the theme to CssVarsProvider with both colorSchemes) is tracked separately in #7281. This PR is the local fix for the widget so users on dark mode aren't blocked by the refactor.

Verified

  • Typecheck (tsc --noEmit) green
  • Light mode: FAB + popover render unchanged from before
  • Dark mode (Playwright + computed-style probe):
    • .MuiPopover-paperrgb(36,36,32) text rgb(240,239,232)
    • FAB → rgb(26,26,23) icon primary.main
    • Placeholder + secondary text use --ink-muted
    • Toggle button border and selected state use --rule / --bg-surface

Test plan

  • Open / in light mode → click feedback FAB → expand → all four reactions visible, placeholder reads "Bug, idea, typo, anything…"
  • Switch to dark mode → FAB + quick stack appear as warm near-black on dark page (not cream)
  • Open detailed popover in dark → Paper, input border, placeholder, toggle buttons, "Page:" footer all read on dark surface
  • Submit a 👍 → "Thanks!" toast appears on the elevated surface (not white)

🤖 Generated with Claude Code

…bug reports

The FAB, mini-FAB stack, "Thanks!" toast, and the popover (Paper +
TextFields + secondary text) all relied on MUI palette tokens
(`background.default`, `text.primary`, `background.paper`, `text.secondary`)
that resolve to light-palette values regardless of the active theme — MUI's
palette is hard-pinned to `mode: 'light'` and dark mode runs only through
CSS custom properties on `<html>`. As a result the widget appeared as cream
surfaces on a dark page.

Switch the relevant surfaces and text colors to the CSS tokens
(`--bg-surface`, `--bg-elevated`, `--ink`, `--ink-muted`, `--rule`) so the
widget tracks the active scheme. The popover paper additionally overrides
the nested `.MuiOutlinedInput-*` and `.MuiToggleButton-root` selectors so
the input outline, placeholder, and selected reaction button read correctly
on both surfaces.

The structural cure (migrating the theme to `CssVarsProvider` with both
colorSchemes) is tracked in #7281.

Also update the message placeholder from "Typo, weird chart, feature idea…"
to "Bug, idea, typo, anything…" — bugs are a valid (and already reactable)
feedback category, and the previous wording read as dismissive.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 18, 2026 20:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates FeedbackWidget styling to use the app’s CSS design tokens (so it follows the site’s light/dark mode implemented via <html data-theme="...">) and tweaks the feedback placeholder text to be clearer and more inclusive of bug reports.

Changes:

  • Replaced MUI palette-based surface/text colors (background.*, text.*, action.hover) with CSS variables (--bg-surface, --bg-elevated, --ink, --ink-muted, --rule) for the widget’s FABs, toast, and popover content.
  • Added targeted Popover paper slot styling to ensure TextField outline/placeholder and ToggleButton surfaces/borders read correctly in dark mode.
  • Updated the message placeholder copy to “Bug, idea, typo, anything…”

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@MarkusNeusinger MarkusNeusinger merged commit e10219b into main May 18, 2026
10 checks passed
@MarkusNeusinger MarkusNeusinger deleted the fix/feedback-widget-dark-mode branch May 18, 2026 20:17
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.

2 participants