Skip to content

fix(desktop): readable warning banner + refresh history after Clear all#33

Merged
GuilhermeVozniak merged 1 commit into
mainfrom
fix/banner-contrast-and-dismiss
May 21, 2026
Merged

fix(desktop): readable warning banner + refresh history after Clear all#33
GuilhermeVozniak merged 1 commit into
mainfrom
fix/banner-contrast-and-dismiss

Conversation

@GuilhermeVozniak
Copy link
Copy Markdown
Collaborator

Summary

Two bugs surfaced when QA'ing the Settings → History → Clear all flow:

  1. Unreadable confirmation banner. The inline yellow confirmation rendered as bg-yellow-100 with no explicit text color. In dark mode the inherited near-white text-fg was invisible on the pale yellow background. Same broken pattern was used in SettingsRecording (Fn-setup confirm) and DeleteApiKeyDialog (active-key warning). All three also used border-3, which isn't a Tailwind default (only 0/2/4/8) — it silently rendered as no border at all.
  2. History list didn't refresh after Clear all. SettingsHistory.handleConfirmClear called clearAllTranscriptions() but never told MainWindowInner, which owns the historyEntries state and the Dashboard refreshKey. The user had to quit + relaunch the app to see the list empty out.

Changes

  • New components/ui/warning-banner.tsx — amber-on-amber in light mode, brand-yellow tint in dark mode (mirrors the existing OnboardingScreen accent treatment that already works).
  • Replaced the three ad-hoc bg-yellow-* divs with <WarningBanner>.
  • Wired onHistoryChanged prop through MainWindowSettingsHistory; the parent's handler calls loadHistory() and bumps refreshKey so the Dashboard stats refetch too.
  • Regression tests in SettingsHistory.test.tsx:
    • fires onHistoryChanged after Clear all
    • fires onHistoryChanged when a retention purge actually deleted rows
    • does not fire when a retention purge deleted nothing (no spurious refetch)

Test plan

  • bun --cwd packages/desktop test — 399/399 pass (3 new tests in SettingsHistory.test.tsx)
  • bun --cwd packages/desktop typecheck clean
  • bun run lint clean
  • Manual: dark mode — yellow banner text is readable on Clear all, Fn setup, and Delete API key flows
  • Manual: Clear all → confirm → list empties without restarting the app

🧙 Built with WOZCODE

Three places in Settings rendered an inline confirmation as
`<div className="border-3 border-border bg-yellow-100 ...">` with no
explicit text color. Two consequences:

1. `border-3` is not a Tailwind default utility (only 0/2/4/8), so it
   silently rendered as no border.
2. With no explicit `text-*` class the foreground inherits the parent's
   `text-fg`, which on dark mode is near-white. White text on
   `bg-yellow-100` is unreadable.

Extracted a shared `WarningBanner` UI component with proper amber-on-
amber contrast in light mode and a brand-yellow tint that matches the
existing OnboardingScreen accent in dark mode. Swapped the three
ad-hoc divs (SettingsHistory clear-all confirm, SettingsRecording Fn
setup confirm, DeleteApiKeyDialog active-key warning) to use it.

Separately, `SettingsHistory.handleConfirmClear` was calling
`clearAllTranscriptions` but never notifying MainWindowInner, which
owns the `historyEntries` state and the Dashboard's `refreshKey`.
Result: after clicking Confirm, the list of transcriptions stayed on
screen until the user quit and relaunched the app. Wired an
`onHistoryChanged` prop through MainWindow → SettingsHistory that
triggers both `loadHistory()` and a stats refresh, and added
regression tests for Clear all + the retention purge path.

Co-Authored-By: WOZCODE <contact@withwoz.com>
@GuilhermeVozniak GuilhermeVozniak force-pushed the fix/banner-contrast-and-dismiss branch from e4fcb8c to f33cce2 Compare May 21, 2026 19:57
@GuilhermeVozniak GuilhermeVozniak merged commit e6adc63 into main May 21, 2026
8 checks passed
@GuilhermeVozniak GuilhermeVozniak deleted the fix/banner-contrast-and-dismiss branch May 21, 2026 21:15
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.

1 participant