Skip to content

fix(settings): use Alert primitive for daily-review load-error - #238

Merged
jackwener merged 1 commit into
mainfrom
yuejing/settings-alert-primitive
Jun 25, 2026
Merged

fix(settings): use Alert primitive for daily-review load-error#238
jackwener merged 1 commit into
mainfrom
yuejing/settings-alert-primitive

Conversation

@jackwener

Copy link
Copy Markdown
Member

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 .settingsAlert CSS rule in styles.css, so when the rare error path fired (dailyReviewIpc.getConfig() rejected) the user got an unstyled paragraph.

Replace with the shadcn-style Alert primitive (variant="error"), which already ships the proper destructive-tinted border + background + icon slot.

Scope is intentionally small. The bigger .settingsFeatureStatusHero / .settingsFeatureStatusBanner migrations to shadcn Card composition look identical visually because the bespoke CSS already does Card's job — invisible refactor, no end-result win, so skipped per WAWQAQ's '只看最后的结果' directive (msg d13074c7).

Test plan

  • tsc --noEmit -p apps/desktop/tsconfig.renderer.json — clean on touched lines.
  • Force dailyReviewIpc.getConfig() to throw and confirm the Alert renders with the proper destructive border/background.

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.
@jackwener
jackwener merged commit 7d8e23c into main Jun 25, 2026
@jackwener
jackwener deleted the yuejing/settings-alert-primitive branch June 25, 2026 07:16
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