fix(web): PWA manifest 主题色跟随新主色
CI / backend (push) Canceled after 0s

安装到主屏后的启动背景与状态栏色此前仍是旧的墨绿/暖白;e2e 断言与文档同步更新。
This commit is contained in:
2026-11-01 19:17:35 +08:00
parent 4796b695a3
commit 684b9b2604
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -520,7 +520,7 @@
### 8.3 实现 ### 8.3 实现
| 位置 | 内容 | | 位置 | 内容 |
|---|---| |---|---|
| `web/vite.config.ts` | manifest(standalone、主题色 `#2f6054`、三个图标)+ workbox(`navigateFallback` 回退 `index.html`,`/vditor/` 走 CacheFirst,`/api/` NetworkOnly) | | `web/vite.config.ts` | manifest(standalone、主题色 `#274b73`、三个图标)+ workbox(`navigateFallback` 回退 `index.html`,`/vditor/` 走 CacheFirst,`/api/` NetworkOnly) |
| `web/index.html` | favicon 改成同款 Logo(内联 SVG)、`theme-color`、`apple-touch-icon`、`viewport-fit=cover` | | `web/index.html` | favicon 改成同款 Logo(内联 SVG)、`theme-color`、`apple-touch-icon`、`viewport-fit=cover` |
| `web/src/lib/pwa.ts` | 生产环境注册 SW、`dadao:pwa-update-ready` 事件、`applyServiceWorkerUpdate()`、`isStandalone()` | | `web/src/lib/pwa.ts` | 生产环境注册 SW、`dadao:pwa-update-ready` 事件、`applyServiceWorkerUpdate()`、`isStandalone()` |
| `web/src/components/UpdatePrompt.tsx` | 底部卡片「有新版了」+ 稍后 / 刷新(**居中用 flex 包一层**:`animate-slide-up` 的 keyframes 自带 transform,会和 `-translate-x-1/2` 抢属性,手机窄屏上卡片会被推出屏幕右侧) | | `web/src/components/UpdatePrompt.tsx` | 底部卡片「有新版了」+ 稍后 / 刷新(**居中用 flex 包一层**:`animate-slide-up` 的 keyframes 自带 transform,会和 `-translate-x-1/2` 抢属性,手机窄屏上卡片会被推出屏幕右侧) |
+1 -1
View File
@@ -118,7 +118,7 @@ async function main() {
check("页面骨架已预缓存", shellCached); check("页面骨架已预缓存", shellCached);
const themeColor = await page.getAttribute('meta[name="theme-color"]', "content"); const themeColor = await page.getAttribute('meta[name="theme-color"]', "content");
check("主题色是墨绿", themeColor === "#2f6054", String(themeColor)); check("主题色是景泰蓝", themeColor === "#274b73", String(themeColor));
check("桌面尺寸没有控制台报错", errors.length === 0, errors.join(" | ")); check("桌面尺寸没有控制台报错", errors.length === 0, errors.join(" | "));
await desktop.close(); await desktop.close();
+2 -2
View File
@@ -22,8 +22,8 @@ export default defineConfig({
scope: "/", scope: "/",
display: "standalone", display: "standalone",
orientation: "any", orientation: "any",
background_color: "#f7f5f0", background_color: "#f3f5f9",
theme_color: "#2f6054", theme_color: "#274b73",
categories: ["productivity", "business"], categories: ["productivity", "business"],
icons: [ icons: [
{ src: "/icons/icon-192.png", sizes: "192x192", type: "image/png", purpose: "any" }, { src: "/icons/icon-192.png", sizes: "192x192", type: "image/png", purpose: "any" },