Skip to content

Commit b91bd17

Browse files
committed
feat(dashboard): 学习启动仪式体验重塑 v0.26.0
呼吸容器架构、主题化生命体、引导音、光尘转场、火种、自适应编排+A/B、记忆回响、语音目标、AI回顾小问;修复 reduced-motion 冻结入场动画致内容不可见
1 parent aca2166 commit b91bd17

106 files changed

Lines changed: 3974 additions & 237 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/release.yml‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,23 @@ name: Release Electron App
44
on:
55
push:
66
tags: ['v*']
7+
# 兜底触发:semantic-release 若以内置 GITHUB_TOKEN 推 tag,
8+
# GitHub 防递归机制不会派发 push 事件,导致本工作流从不运行、
9+
# Release 资产为空(latest.yml 404)。Release 发布事件可正常触发补跑。
10+
release:
11+
types: [published]
12+
# 手动兜底:在 UI 选择对应 tag 运行,用于补发历史版本资产
13+
workflow_dispatch:
714

815
# 上传构建产物到 GitHub Release 需要写权限
916
permissions:
1017
contents: write
1118

19+
# 同一 tag 的多个触发源(push/release)串行执行,避免重复上传竞争
20+
concurrency:
21+
group: release-electron-${{ github.ref_name }}
22+
cancel-in-progress: false
23+
1224
jobs:
1325
lint-test:
1426
runs-on: ubuntu-latest
@@ -41,7 +53,14 @@ jobs:
4153
- uses: actions/upload-artifact@v4
4254
with:
4355
name: release-${{ matrix.os }}
44-
path: client/release/*.{exe,dmg,AppImage}
56+
# 注意:@actions/glob 不支持 {a,b} 花括号展开,必须逐行列出;
57+
# latest*.yml 与 *.blockmap 是 electron-updater 自动更新的必需文件
58+
path: |
59+
client/release/*.exe
60+
client/release/*.dmg
61+
client/release/*.AppImage
62+
client/release/*.blockmap
63+
client/release/latest*.yml
4564
4665
release:
4766
needs: build

‎client/electron/updater.ts‎

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,23 @@ function checkForUpdatesWithTimeout(): Promise<unknown> {
9898
});
9999
}
100100

101+
/**
102+
* 将 electron-updater 的原始错误映射为用户可读的提示。
103+
* 原始 message 可能包含整段 HTTP headers / 堆栈(如 latest.yml 404),
104+
* 不应直接透传到 UI;完整信息仍会经 logger 落盘供排查。
105+
*/
106+
function toFriendlyUpdateError(err: unknown): string {
107+
const raw = err instanceof Error ? err.message : String(err);
108+
if (/latest.*\.yml/i.test(raw) || /404/.test(raw)) {
109+
return '更新服务暂时不可用(新版本文件尚未发布完成),请稍后再试';
110+
}
111+
if (/ENOTFOUND|ECONNREFUSED|ECONNRESET|ETIMEDOUT|net::ERR/i.test(raw)) {
112+
return '网络连接异常,请检查网络后重试';
113+
}
114+
// 兜底:截断超长原始信息,避免刷屏
115+
return raw.length > 100 ? `${raw.slice(0, 100)}…` : raw;
116+
}
117+
101118
export function initAutoUpdater(mainWindow: BrowserWindow | null): void {
102119
// 开发模式下禁用自动更新
103120
if (!app.isPackaged) {
@@ -183,7 +200,7 @@ export function initAutoUpdater(mainWindow: BrowserWindow | null): void {
183200

184201
sendToRenderer(mainWindow, 'update-status', {
185202
status: 'error',
186-
message: error.message,
203+
message: toFriendlyUpdateError(error),
187204
});
188205
});
189206

@@ -210,11 +227,14 @@ export function initAutoUpdater(mainWindow: BrowserWindow | null): void {
210227
.then(() => { saveLastCheckTimestamp(); })
211228
.catch((err: unknown) => {
212229
logger.error('[AutoUpdater] Initial check failed', err);
230+
// 失败同样写入节流时间戳:错误已提示过一次,
231+
// 避免服务端问题未修复期间每次启动都重复弹出同一错误
232+
saveLastCheckTimestamp();
213233
// 断网导致的失败不通知前端
214234
if (!net.isOnline()) return;
215235
sendToRenderer(mainWindow, 'update-status', {
216236
status: 'error',
217-
message: err instanceof Error ? err.message : String(err),
237+
message: toFriendlyUpdateError(err),
218238
});
219239
});
220240
}, 10_000);
@@ -233,7 +253,7 @@ export function checkForUpdate(): void {
233253
sendToRenderer(
234254
BrowserWindow.getAllWindows().find((w) => !w.isDestroyed()) ?? null,
235255
'update-status',
236-
{ status: 'error', message: err instanceof Error ? err.message : String(err) },
256+
{ status: 'error', message: toFriendlyUpdateError(err) },
237257
);
238258
});
239259
}
197 KB
Binary file not shown.
31.1 KB
Binary file not shown.
24.2 KB
Binary file not shown.
24.2 KB
Binary file not shown.
9.52 KB
Binary file not shown.
28.5 KB
Binary file not shown.
27.6 KB
Binary file not shown.
28.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)