fix(desktop): readable warning banner + refresh history after Clear all#33
Merged
Merged
Conversation
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>
e4fcb8c to
f33cce2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two bugs surfaced when QA'ing the Settings → History → Clear all flow:
bg-yellow-100with no explicit text color. In dark mode the inherited near-whitetext-fgwas invisible on the pale yellow background. Same broken pattern was used inSettingsRecording(Fn-setup confirm) andDeleteApiKeyDialog(active-key warning). All three also usedborder-3, which isn't a Tailwind default (only 0/2/4/8) — it silently rendered as no border at all.SettingsHistory.handleConfirmClearcalledclearAllTranscriptions()but never toldMainWindowInner, which owns thehistoryEntriesstate and the DashboardrefreshKey. The user had to quit + relaunch the app to see the list empty out.Changes
components/ui/warning-banner.tsx— amber-on-amber in light mode,brand-yellowtint in dark mode (mirrors the existingOnboardingScreenaccent treatment that already works).bg-yellow-*divs with<WarningBanner>.onHistoryChangedprop throughMainWindow→SettingsHistory; the parent's handler callsloadHistory()and bumpsrefreshKeyso the Dashboard stats refetch too.SettingsHistory.test.tsx:onHistoryChangedafter Clear allonHistoryChangedwhen a retention purge actually deleted rowsTest plan
bun --cwd packages/desktop test— 399/399 pass (3 new tests inSettingsHistory.test.tsx)bun --cwd packages/desktop typecheckcleanbun run lintclean🧙 Built with WOZCODE