fix(ratewise): RW-3b 離線頁主題感知(保留 SW 自我修復)(#514 拆分 3b/7)#521
Conversation
- 合併 PR 433 主題感知離線模板(per-theme CSS 變數 + theme-color + safe-area + viewport-fit) - 植回 main 的 PR 508 CHECK_SHELL_PRECACHE 自我修復腳本與 id=retry-btn(不取整檔避免回退死亡迴圈) - generate-offline-html 移除 prettier 並將 generated offline.html 加入 prettierignore(prebuild 禁 prettier) 測試:typecheck、lint、test 2516 passed、build、nitro 離線頁深色 020617 且 508 導回 app 驗證 Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 01fc89de9c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| --offline-warning-tint: ${rgbTripletToRgba(colors.warning, 0.16)}; | ||
| --offline-warning: ${rgbTripletToHex(colors.warning)}; | ||
| --offline-success-tint: ${rgbTripletToRgba(colors.success, 0.12)}; | ||
| --offline-success: ${rgbTripletToHex(colors.success)}; |
There was a problem hiding this comment.
Use readable foregrounds for offline badges
When the offline page is shown with light themes, buildOfflineStyleBlock now uses the bright semantic warning/success colors as foreground text while the badge backgrounds are only low-alpha versions of the same colors. The generated default Zen status badge is #F59E0B over a blended #FDEFD8 (~1.9:1 contrast), and Kawaii is even lower (~1.3:1), so the offline status/cached-data text becomes hard to read for default and several non-Nitro users. Please derive darker foreground tokens for these badges instead of reusing the bright status colors.
Useful? React with 👍 / 👎.
|
內容已 squash 合併至 #523(08e27f43),關閉重複 PR。 |
摘要
#514 拆分 RW-3b(最高風險,已完整驗證)。離線頁背景/容器/圖示硬編紫色 → nitro/深色主題使用者斷網時閃錯誤的淺紫。本 PR 讓離線頁主題感知。
變更
scripts/templates/offline.template.html:合併 chore(ratewise): 生產治理 rebased on main(取代 #411) #433 主題感知結構(per-theme CSS 變數 +theme-color+viewport-fit=cover+ safe-area + 讀 localStorage 主題的 head script),但植回 main 的 fix(ratewise): offline.html 自我修復打破 SW 死亡迴圈 #508CHECK_SHELL_PRECACHE自我修復腳本與id=retry-btn(chore(ratewise): 生產治理 rebased on main(取代 #411) #433 模板 base 早於 fix(ratewise): offline.html 自我修復打破 SW 死亡迴圈 #508、整檔取會回退死亡迴圈修復)。scripts/generate-offline-html.mjs:從STYLE_DEFINITIONS產生主題色表/style blocks;移除 prettier(紅線:prebuild 禁 prettier)。public/offline.html重新生成;加入.prettierignore(generated 非 prettier 格式)。紅線驗證(關鍵)
?shell-heal=...),證明死亡迴圈修復未回退。--offline-background: #020617、theme-color#0096E6(用 RW-2 修正色),不再閃淺紫。id版(非 reload)。Test plan
EMERGENCY fallback 主題化列可選後續。Refs #514(3b/7)。
🤖 Generated with Claude Code
via Happy