fix(settings): use Alert primitive for daily-review load-error - #238
Merged
Conversation
The 「读取每日回顾设置失败」 error branch was rendering through a bare `<div className="settingsAlert">` — there is no `.settingsAlert` CSS rule in styles.css, so the error was effectively unstyled when it fired (rare path: only when `dailyReviewIpc.getConfig()` rejects). Replace with the shadcn-style `Alert` primitive (variant="error"). The primitive ships the proper destructive-tinted border + background + icon slot the bare div never had.
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
Tiny but honest 'use the library more' win: the
读取每日回顾设置失败error branch in Settings → 每日回顾 was rendering through a bare<div className=\"settingsAlert\">— and there is no.settingsAlertCSS rule instyles.css, so when the rare error path fired (dailyReviewIpc.getConfig()rejected) the user got an unstyled paragraph.Replace with the shadcn-style
Alertprimitive (variant="error"), which already ships the proper destructive-tinted border + background + icon slot.Scope is intentionally small. The bigger
.settingsFeatureStatusHero/.settingsFeatureStatusBannermigrations to shadcnCardcomposition look identical visually because the bespoke CSS already does Card's job — invisible refactor, no end-result win, so skipped per WAWQAQ's '只看最后的结果' directive (msgd13074c7).Test plan
tsc --noEmit -p apps/desktop/tsconfig.renderer.json— clean on touched lines.dailyReviewIpc.getConfig()to throw and confirm the Alert renders with the proper destructive border/background.