Commit 0a5d7409 by 胡悦

build(backend): 新增后端标准启动脚本并更新预学习流程

- 为后端package.json新增标准启动脚本`npm start`,保留原有的开发热更新脚本`npm run dev`
- 添加后端启动标准化相关的OpenSpec、设计文档和任务清单
- 移除预学习完成动作返回的冗余成功提示toast和notice字段
- 更新预学习前端代码,改用postMessage桥接方式通知APP完成事件,新增uni webview sdk加载和桥接就绪等待逻辑
- 更新前后端测试用例以适配新的接口和前端行为
- 更新项目工作流状态文件以反映当前变更
1 parent 0e207d4e
Showing 20 changed files with 421 additions and 36 deletions
{ {
"stage": "READY_TO_ARCHIVE", "stage": "VALIDATING",
"project": "workspace/single-pages", "project": "workspace/single-pages",
"change": "update-h5-tracking-and-product-package-info", "change": "add-backend-start-command",
"current_agent": "qa-validation-agent", "current_agent": "qa-validation-agent",
"last_handoff": "2026-06-25 已完成预学习无更多案例文案收口:后端与前端的 `view_other` 无更多分支统一改为“您已经看完所有实战案例了,快去实战中大显身手吧!”,并移除了按钮下方重复辅助文案;前端/后端相关测试、前端 typecheck/build 和 OpenSpec strict 已重新通过,可进入归档前检查。", "last_handoff": "2026-06-25 已完成 single-pages backend `npm start` 脚本改动,并通过 backend typecheck 与 OpenSpec strict 校验。受本机现有 3002 端口占用和沙箱限制影响,`npm start` 启动健康检查改由用户手动执行,当前处于待手动验证状态。",
"gates": { "gates": {
"requirements_boundary_confirmed": true, "requirements_boundary_confirmed": true,
"architecture_confirmed": true, "architecture_confirmed": true,
"openspec_locked": true, "openspec_locked": true,
"user_confirmed_openspec": true, "user_confirmed_openspec": true,
"implementation_started": true, "implementation_started": true,
"validation_completed": true "validation_completed": false
}, },
"last_validation": { "last_validation": {
"commands": [ "commands": [
"rtk npm run test -- src/apps/prelearning/app.test.tsx",
"rtk npm run test -- src/routes/prelearning.test.ts",
"rtk npm run typecheck", "rtk npm run typecheck",
"rtk npm run build", "rtk openspec validate add-backend-start-command --strict"
"rtk npm run typecheck",
"rtk openspec validate update-h5-tracking-and-product-package-info --strict",
"rtk git diff --check -- workspace/single-pages/front/src/apps/prelearning/app.test.tsx workspace/single-pages/openspec/changes/update-h5-tracking-and-product-package-info/specs/prelearning-learning-actions/spec.md workspace/single-pages/openspec/changes/update-h5-tracking-and-product-package-info/tasks.md workspace/single-pages/.workflow-state.json"
], ],
"result": "PASS", "result": "PARTIAL",
"notes": "2026-06-25 已重新验证前端预学习回归测试、后端预学习路由测试、前端 typecheck/build、后端 typecheck 和 OpenSpec strict;`view_other` 无更多案例文案、按钮禁用态与按钮下方不再渲染辅助文案均已对齐。" "notes": "2026-06-25 backend typecheck 与 OpenSpec strict 校验通过。`npm start` 的真实启动验证先后受沙箱内 tsx IPC pipe 权限限制、提权启动时 3002 端口占用影响;随后按用户要求改为由用户自行验证启动与 /health 检查。OpenSpec strict 输出包含 PostHog telemetry DNS 提示,但命令 Exit Code 为 0 且报告 change valid。"
}, },
"updated_at": "2026-06-25T11:27:30+08:00" "updated_at": "2026-06-25T18:02:00+08:00"
} }
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
"version": "0.0.1", "version": "0.0.1",
"type": "module", "type": "module",
"scripts": { "scripts": {
"start": "tsx src/server.ts",
"dev": "tsx watch src/server.ts", "dev": "tsx watch src/server.ts",
"build": "tsc -p tsconfig.build.json", "build": "tsc -p tsconfig.build.json",
"test": "vitest run", "test": "vitest run",
......
...@@ -1118,10 +1118,7 @@ export async function performPrelearningAction( ...@@ -1118,10 +1118,7 @@ export async function performPrelearningAction(
return { return {
...currentResponse, ...currentResponse,
actionState: buildActionState('view_other', { actionState: buildActionState('view_other'),
toastMessage: '学习已保存,可继续查看其他案例',
}),
notice: '学习已保存',
}; };
} }
......
...@@ -2324,9 +2324,7 @@ describe('prelearning route', () => { ...@@ -2324,9 +2324,7 @@ describe('prelearning route', () => {
actionType: 'view_other', actionType: 'view_other',
buttonLabel: '查看其他案例', buttonLabel: '查看其他案例',
disabled: false, disabled: false,
toastMessage: '学习已保存,可继续查看其他案例',
}, },
notice: '学习已保存',
}); });
expect(saveProductStatus).toHaveBeenCalledWith({ expect(saveProductStatus).toHaveBeenCalledWith({
activityId: 20, activityId: 20,
......
## 背景
`workspace/single-pages/backend` 目前只提供 `npm run dev`、`npm run build`、`npm run test` 和 `npm run typecheck`。用户希望把后端启动方式统一为 `npm start`,以便用标准 npm 入口直接启动服务。
## 方案对比
### 方案 A:新增 `start=tsx src/server.ts`,保留 `dev=tsx watch src/server.ts`
- 优点:改动最小;不要求先执行 build;与现有 TypeScript 运行链路保持一致;`npm start` 启动的是非 watch 进程,语义清晰。
- 缺点:`start` 仍依赖 `tsx` 运行源码,不是编译产物启动。
### 方案 B:新增 `start=node dist/src/server.js`,并要求先 build
- 优点:更接近生产环境启动方式。
- 缺点:当前仓库没有把 build 作为启动前置约束,直接切换会让本地启动多一步,增加失败点,也不符合“把启动方式改为 npm start”的最小变更预期。
## 推荐
采用方案 A:
- 新增 `npm start` 作为标准后端启动入口,命令为 `tsx src/server.ts`。
- 保留 `npm run dev` 作为本地热更新开发入口。
- 同步项目级 OpenSpec,明确 backend 需要同时提供 `start` 与 `dev` 两类启动命令。
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).uni=n()}(this,(function(){"use strict";try{var e={};Object.defineProperty(e,"passive",{get:function(){!0}}),window.addEventListener("test-passive",null,e)}catch(e){}var n=Object.prototype.hasOwnProperty;function i(e,i){return n.call(e,i)}var t=[];function o(){return window.__dcloud_weex_postMessage||window.__dcloud_weex_}function a(){return window.__uniapp_x_postMessage||window.__uniapp_x_}var r=function(e,n){var i={options:{timestamp:+new Date},name:e,arg:n};if(a()){if("postMessage"===e){var r={data:n};return window.__uniapp_x_postMessage?window.__uniapp_x_postMessage(r):window.__uniapp_x_.postMessage(JSON.stringify(r))}var d={type:"WEB_INVOKE_APPSERVICE",args:{data:i,webviewIds:t}};window.__uniapp_x_postMessage?window.__uniapp_x_postMessageToService(d):window.__uniapp_x_.postMessageToService(JSON.stringify(d))}else if(o()){if("postMessage"===e){var s={data:[n]};return window.__dcloud_weex_postMessage?window.__dcloud_weex_postMessage(s):window.__dcloud_weex_.postMessage(JSON.stringify(s))}var w={type:"WEB_INVOKE_APPSERVICE",args:{data:i,webviewIds:t}};window.__dcloud_weex_postMessage?window.__dcloud_weex_postMessageToService(w):window.__dcloud_weex_.postMessageToService(JSON.stringify(w))}else{if(!window.plus)return window.parent.postMessage({type:"WEB_INVOKE_APPSERVICE",data:i,pageId:""},"*");if(0===t.length){var u=plus.webview.currentWebview();if(!u)throw new Error("plus.webview.currentWebview() is undefined");var g=u.parent(),v="";v=g?g.id:u.id,t.push(v)}if(plus.webview.getWebviewById("__uniapp__service"))plus.webview.postMessageToUniNView({type:"WEB_INVOKE_APPSERVICE",args:{data:i,webviewIds:t}},"__uniapp__service");else{var c=JSON.stringify(i);plus.webview.getLaunchWebview().evalJS('UniPlusBridge.subscribeHandler("'.concat("WEB_INVOKE_APPSERVICE",'",').concat(c,",").concat(JSON.stringify(t),");"))}}},d={navigateTo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("navigateTo",{url:encodeURI(n)})},navigateBack:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.delta;r("navigateBack",{delta:parseInt(n)||1})},switchTab:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("switchTab",{url:encodeURI(n)})},reLaunch:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("reLaunch",{url:encodeURI(n)})},redirectTo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;r("redirectTo",{url:encodeURI(n)})},getEnv:function(e){a()?e({uvue:!0}):o()?e({nvue:!0}):window.plus?e({plus:!0}):e({h5:!0})},postMessage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r("postMessage",e.data||{})}},s=/uni-app/i.test(navigator.userAgent),w=/Html5Plus/i.test(navigator.userAgent),u=/complete|loaded|interactive/;var g=window.my&&navigator.userAgent.indexOf(["t","n","e","i","l","C","y","a","p","i","l","A"].reverse().join(""))>-1;var v=window.swan&&window.swan.webView&&/swan/i.test(navigator.userAgent);var c=window.qq&&window.qq.miniProgram&&/QQ/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var p=window.tt&&window.tt.miniProgram&&/toutiaomicroapp/i.test(navigator.userAgent);var _=window.wx&&window.wx.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var m=window.qa&&/quickapp/i.test(navigator.userAgent);var f=window.ks&&window.ks.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var l=window.tt&&window.tt.miniProgram&&/Lark|Feishu/i.test(navigator.userAgent);var E=window.jd&&window.jd.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var x=window.xhs&&window.xhs.miniProgram&&/xhsminiapp/i.test(navigator.userAgent);for(var S,h=function(){window.UniAppJSBridge=!0,document.dispatchEvent(new CustomEvent("UniAppJSBridgeReady",{bubbles:!0,cancelable:!0}))},y=[function(e){if(s||w)return window.__uniapp_x_postMessage||window.__uniapp_x_||window.__dcloud_weex_postMessage||window.__dcloud_weex_?document.addEventListener("DOMContentLoaded",e):window.plus&&u.test(document.readyState)?setTimeout(e,0):document.addEventListener("plusready",e),d},function(e){if(_)return window.WeixinJSBridge&&window.WeixinJSBridge.invoke?setTimeout(e,0):document.addEventListener("WeixinJSBridgeReady",e),window.wx.miniProgram},function(e){if(c)return window.QQJSBridge&&window.QQJSBridge.invoke?setTimeout(e,0):document.addEventListener("QQJSBridgeReady",e),window.qq.miniProgram},function(e){if(g){document.addEventListener("DOMContentLoaded",e);var n=window.my;return{navigateTo:n.navigateTo,navigateBack:n.navigateBack,switchTab:n.switchTab,reLaunch:n.reLaunch,redirectTo:n.redirectTo,postMessage:n.postMessage,getEnv:n.getEnv}}},function(e){if(v)return document.addEventListener("DOMContentLoaded",e),window.swan.webView},function(e){if(p)return document.addEventListener("DOMContentLoaded",e),window.tt.miniProgram},function(e){if(m){window.QaJSBridge&&window.QaJSBridge.invoke?setTimeout(e,0):document.addEventListener("QaJSBridgeReady",e);var n=window.qa;return{navigateTo:n.navigateTo,navigateBack:n.navigateBack,switchTab:n.switchTab,reLaunch:n.reLaunch,redirectTo:n.redirectTo,postMessage:n.postMessage,getEnv:n.getEnv}}},function(e){if(f)return window.WeixinJSBridge&&window.WeixinJSBridge.invoke?setTimeout(e,0):document.addEventListener("WeixinJSBridgeReady",e),window.ks.miniProgram},function(e){if(l)return document.addEventListener("DOMContentLoaded",e),window.tt.miniProgram},function(e){if(E)return window.JDJSBridgeReady&&window.JDJSBridgeReady.invoke?setTimeout(e,0):document.addEventListener("JDJSBridgeReady",e),window.jd.miniProgram},function(e){if(x)return window.xhs.miniProgram},function(e){return document.addEventListener("DOMContentLoaded",e),d}],M=0;M<y.length&&!(S=y[M](h));M++);S||(S={});var P="undefined"!=typeof uni?uni:{};if(!P.navigateTo)for(var b in S)i(S,b)&&(P[b]=S[b]);return P.webView=S,P}));
...@@ -105,8 +105,10 @@ function mockFetchWithReadGateConfig(configBody: unknown, responseBody: unknown) ...@@ -105,8 +105,10 @@ function mockFetchWithReadGateConfig(configBody: unknown, responseBody: unknown)
describe('PrelearningApp', () => { describe('PrelearningApp', () => {
beforeEach(() => { beforeEach(() => {
history.replaceState({}, '', '/prelearning.html'); history.replaceState({}, '', '/prelearning.html');
delete window.uni;
delete window.__PRELEARNING_DEBUG_SESSION__; delete window.__PRELEARNING_DEBUG_SESSION__;
delete window.initPrelearningSession; delete window.initPrelearningSession;
document.querySelectorAll('script[data-uni-webview-sdk]').forEach((script) => script.remove());
}); });
afterEach(() => { afterEach(() => {
...@@ -900,7 +902,7 @@ describe('PrelearningApp', () => { ...@@ -900,7 +902,7 @@ describe('PrelearningApp', () => {
expect(within(learnNextButton).getByTestId('prelearning-action-icon')).toBeInTheDocument(); expect(within(learnNextButton).getByTestId('prelearning-action-icon')).toBeInTheDocument();
}); });
it('complete action notice shows a centered toast without refreshing current content', async () => { it('complete action success updates to view other without showing a toast', async () => {
const payload: PrelearningInitPayload = { const payload: PrelearningInitPayload = {
...VALID_PAYLOAD, ...VALID_PAYLOAD,
entrySource: 'package_detail', entrySource: 'package_detail',
...@@ -916,6 +918,9 @@ describe('PrelearningApp', () => { ...@@ -916,6 +918,9 @@ describe('PrelearningApp', () => {
}, },
notice: '学习已保存', notice: '学习已保存',
}; };
window.uni = {
postMessage: vi.fn(),
};
mockInitAndActionFetch(initResponse, completeResponse); mockInitAndActionFetch(initResponse, completeResponse);
render(<PrelearningApp />); render(<PrelearningApp />);
...@@ -947,14 +952,143 @@ describe('PrelearningApp', () => { ...@@ -947,14 +952,143 @@ describe('PrelearningApp', () => {
await vi.advanceTimersByTimeAsync(0); await vi.advanceTimersByTimeAsync(0);
}); });
const toast = screen.getByRole('status'); expect(screen.queryByRole('status')).not.toBeInTheDocument();
expect(toast).toHaveTextContent('学习已保存');
expect(toast).toHaveClass('left-1/2', 'top-1/2', 'bg-black/80', 'text-white');
expect(screen.queryByRole('button', { name: '完成学习' })).not.toBeInTheDocument(); expect(screen.queryByRole('button', { name: '完成学习' })).not.toBeInTheDocument();
expect(screen.getByRole('button', { name: '查看其他案例' })).toBeInTheDocument(); expect(screen.getByRole('button', { name: '查看其他案例' })).toBeInTheDocument();
expect(screen.queryByText('当前范围内没有其他案例可查看')).not.toBeInTheDocument(); expect(screen.queryByText('当前范围内没有其他案例可查看')).not.toBeInTheDocument();
}); });
it('notifies the app through postMessage when complete action succeeds', async () => {
const payload: PrelearningInitPayload = {
...VALID_PAYLOAD,
entrySource: 'package_detail',
};
const initResponse = createMockPrelearningResponse(payload);
const completeResponse = {
...initResponse,
actionState: {
actionType: 'view_other',
buttonLabel: '查看其他案例',
disabled: false,
},
};
const postMessage = vi.fn();
window.uni = {
postMessage,
};
mockInitAndActionFetch(initResponse, completeResponse);
render(<PrelearningApp />);
await waitFor(() => {
expect(window.initPrelearningSession).toBeTypeOf('function');
});
vi.useFakeTimers();
await act(async () => {
window.initPrelearningSession?.(payload);
await vi.advanceTimersByTimeAsync(0);
});
await act(async () => {
await vi.advanceTimersByTimeAsync(61000);
});
await act(async () => {
screen.getByRole('button', { name: '完成学习' }).click();
await vi.advanceTimersByTimeAsync(0);
});
expect(postMessage).toHaveBeenCalledWith({
data: {
source: 'prelearn-h5',
type: 'completeActivity',
payload: {
entrySource: 'package_detail',
staffUuid: 'staff-001',
merchantId: 'merchant-001',
activityId: String(completeResponse.activityProduct.activityId),
activityProductId: String(completeResponse.activityProduct.activityProductId),
caseId: completeResponse.script.caseId,
sessionId: completeResponse.sessionId,
},
},
});
expect('completeActivity' in window).toBe(false);
expect(screen.queryByRole('status')).not.toBeInTheDocument();
});
it('loads the uni webview sdk and waits for the app bridge before completing notification', async () => {
const payload: PrelearningInitPayload = {
...VALID_PAYLOAD,
entrySource: 'package_detail',
};
const initResponse = createMockPrelearningResponse(payload);
const completeResponse = {
...initResponse,
actionState: {
actionType: 'view_other' as const,
buttonLabel: '查看其他案例',
disabled: false,
},
};
const postMessage = vi.fn();
mockInitAndActionFetch(initResponse, completeResponse);
render(<PrelearningApp />);
await waitFor(() => {
expect(window.initPrelearningSession).toBeTypeOf('function');
});
vi.useFakeTimers();
await act(async () => {
window.initPrelearningSession?.(payload);
await vi.advanceTimersByTimeAsync(0);
});
await act(async () => {
await vi.advanceTimersByTimeAsync(61000);
});
await act(async () => {
screen.getByRole('button', { name: '完成学习' }).click();
await vi.advanceTimersByTimeAsync(0);
});
const sdkScript = document.querySelector<HTMLScriptElement>('script[data-uni-webview-sdk]');
expect(sdkScript?.getAttribute('src')).toBe('/uni.webview.1.5.5.js');
window.uni = {
postMessage,
};
await act(async () => {
sdkScript?.dispatchEvent(new Event('load'));
document.dispatchEvent(new Event('UniAppJSBridgeReady'));
await vi.advanceTimersByTimeAsync(0);
});
expect(postMessage).toHaveBeenCalledWith({
data: {
source: 'prelearn-h5',
type: 'completeActivity',
payload: {
entrySource: 'package_detail',
staffUuid: 'staff-001',
merchantId: 'merchant-001',
activityId: String(completeResponse.activityProduct.activityId),
activityProductId: String(completeResponse.activityProduct.activityProductId),
caseId: completeResponse.script.caseId,
sessionId: completeResponse.sessionId,
},
},
});
expect(screen.queryByRole('status')).not.toBeInTheDocument();
});
it('uses the explicit browser mock mode without calling init fetch', async () => { it('uses the explicit browser mock mode without calling init fetch', async () => {
history.replaceState( history.replaceState(
{}, {},
......
...@@ -86,12 +86,20 @@ const DEFAULT_READ_GATE_SECONDS = 60; ...@@ -86,12 +86,20 @@ const DEFAULT_READ_GATE_SECONDS = 60;
const READ_GATE_TICK_MS = 1000; const READ_GATE_TICK_MS = 1000;
const READ_GATE_CONFIG_URL = 'https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=single-pages-config'; const READ_GATE_CONFIG_URL = 'https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=single-pages-config';
const INIT_MESSAGE_TYPE = 'PRELEARNING_INIT'; const INIT_MESSAGE_TYPE = 'PRELEARNING_INIT';
const COMPLETE_ACTIVITY_MESSAGE_TYPE = 'completeActivity';
const VITE_BASE_URL = ((import.meta as ImportMeta & { env?: { BASE_URL?: string } }).env?.BASE_URL ?? '/');
interface ReadGateConfig { interface ReadGateConfig {
seconds: number; seconds: number;
unit: string; unit: string;
} }
interface PrelearningAppBridgeMessage {
source: 'prelearn-h5';
type: typeof COMPLETE_ACTIVITY_MESSAGE_TYPE;
payload: PrelearningCompleteActivityPayload;
}
function buildReadGateState(seconds: number, unit = '秒'): ReadGateState { function buildReadGateState(seconds: number, unit = '秒'): ReadGateState {
const normalizedSeconds = Math.max(0, Math.floor(seconds)); const normalizedSeconds = Math.max(0, Math.floor(seconds));
...@@ -368,6 +376,88 @@ async function safeSendBuriedPoint( ...@@ -368,6 +376,88 @@ async function safeSendBuriedPoint(
} }
} }
function postMessageToApp(message: PrelearningAppBridgeMessage): boolean {
if (window.parent && window.parent !== window) {
window.parent.postMessage(message, '*');
return true;
}
if (window.uni?.webView?.postMessage) {
window.uni.webView.postMessage({ data: message });
return true;
}
if (window.uni?.postMessage) {
window.uni.postMessage({ data: message });
return true;
}
return false;
}
function hasUniPostMessageBridge(): boolean {
return Boolean(window.uni?.webView?.postMessage || window.uni?.postMessage);
}
function loadUniWebviewSdk(): Promise<void> {
if (hasUniPostMessageBridge()) {
return Promise.resolve();
}
return new Promise<void>((resolve) => {
const existingScript = document.querySelector<HTMLScriptElement>('script[data-uni-webview-sdk]');
if (existingScript) {
document.addEventListener('UniAppJSBridgeReady', () => resolve(), { once: true });
return;
}
const script = document.createElement('script');
script.src = `${VITE_BASE_URL}uni.webview.1.5.5.js`;
script.async = true;
script.dataset.uniWebviewSdk = 'true';
const timer = window.setTimeout(() => resolve(), 300);
script.onload = () => {
window.clearTimeout(timer);
resolve();
};
script.onerror = () => {
window.clearTimeout(timer);
resolve();
};
document.head.appendChild(script);
});
}
function waitForBridgeReady(timeout = 1800): Promise<boolean> {
return new Promise<boolean>((resolve) => {
if (hasUniPostMessageBridge() || window.parent !== window) {
resolve(true);
return;
}
let settled = false;
const done = (ready: boolean) => {
if (settled) {
return;
}
settled = true;
resolve(ready);
};
document.addEventListener(
'UniAppJSBridgeReady',
() => {
done(hasUniPostMessageBridge());
},
{ once: true },
);
window.setTimeout(
() => done(hasUniPostMessageBridge() || window.parent !== window),
timeout,
);
});
}
function ReadGateFooter({ function ReadGateFooter({
state, state,
actionState, actionState,
...@@ -1295,23 +1385,28 @@ export function PrelearningApp() { ...@@ -1295,23 +1385,28 @@ export function PrelearningApp() {
const notifyCompleteActivity = useCallback(async (payload: PrelearningCompleteActivityPayload) => { const notifyCompleteActivity = useCallback(async (payload: PrelearningCompleteActivityPayload) => {
completionBridgePayloadRef.current = payload; completionBridgePayloadRef.current = payload;
if (typeof window.completeActivity !== 'function') { await loadUniWebviewSdk();
await waitForBridgeReady();
const message: PrelearningAppBridgeMessage = {
source: 'prelearn-h5',
type: COMPLETE_ACTIVITY_MESSAGE_TYPE,
payload,
};
console.log('[prelearning h5] post completeActivity to app:', message);
const sent = postMessageToApp(message);
if (sent) {
completionBridgePayloadRef.current = null; completionBridgePayloadRef.current = null;
return true; return true;
} }
try {
await Promise.resolve(window.completeActivity(payload));
completionBridgePayloadRef.current = null;
return true;
} catch {
setFeedback({ setFeedback({
tone: 'error', tone: 'error',
message: '学习已保存,但通知 APP 失败,请重试。', message: '学习已保存,但通知 APP 失败,请重试。',
actionLabel: '重试通知 APP', actionLabel: '重试通知 APP',
}); });
return false; return false;
}
}, []); }, []);
const retryCompleteActivity = useCallback(() => { const retryCompleteActivity = useCallback(() => {
...@@ -1509,7 +1604,9 @@ export function PrelearningApp() { ...@@ -1509,7 +1604,9 @@ export function PrelearningApp() {
} }
} }
const toastMessage = response.notice ?? response.actionState.toastMessage; const toastMessage = actionType === 'complete'
? undefined
: response.notice ?? response.actionState.toastMessage;
if (toastMessage) { if (toastMessage) {
setFeedback({ setFeedback({
tone: response.actionState.actionType === 'view_other' ? 'info' : 'success', tone: response.actionState.actionType === 'view_other' ? 'info' : 'success',
......
...@@ -159,8 +159,6 @@ export function createMockPrelearningActionResponse( ...@@ -159,8 +159,6 @@ export function createMockPrelearningActionResponse(
actionType: 'view_other', actionType: 'view_other',
buttonLabel: '查看其他案例', buttonLabel: '查看其他案例',
disabled: false, disabled: false,
toastMessage: '学习已保存,可继续查看其他案例',
}, },
notice: '学习已保存',
}; };
} }
import type { import type {
PrelearningBuriedPointPayload, PrelearningBuriedPointPayload,
PrelearningCompleteActivityPayload,
PrelearningInitPayload, PrelearningInitPayload,
} from '@single-pages/contracts'; } from '@single-pages/contracts';
declare global { declare global {
interface Window { interface Window {
uni?: {
postMessage?: (options: { data: unknown }) => void;
webView?: {
postMessage?: (options: { data: unknown }) => void;
};
};
initPrelearningSession?: (payload: PrelearningInitPayload) => void; initPrelearningSession?: (payload: PrelearningInitPayload) => void;
onPrelearnBackIntercepted?: (payload?: unknown) => void; onPrelearnBackIntercepted?: (payload?: unknown) => void;
completeActivity?: (payload: PrelearningCompleteActivityPayload) => void | Promise<void>;
__PRELEARNING_DEBUG_SESSION__?: PrelearningInitPayload; __PRELEARNING_DEBUG_SESSION__?: PrelearningInitPayload;
__PRELEARNING_DEBUG_BURIED_POINT__?: (payload: PrelearningBuriedPointPayload) => void; __PRELEARNING_DEBUG_BURIED_POINT__?: (payload: PrelearningBuriedPointPayload) => void;
} }
......
## Context
`single-pages` 后端当前使用 `tsx watch src/server.ts` 作为开发启动入口,但缺少标准 `npm start`。用户需求只涉及启动命令约定,不涉及运行时框架、配置加载、路由装配或构建产物结构调整。
## Goals / Non-Goals
**Goals:**
- 为后端提供统一的 `npm start` 启动入口。
- 保留 `npm run dev` 的 watch 开发体验。
- 让项目级规范明确两类命令的职责边界。
**Non-Goals:**
- 不替换 Fastify、TypeScript、Prisma 或现有启动入口文件。
- 不把启动链路切换为必须先构建 `dist` 后再运行。
- 不修改后端接口、数据库模型或页面行为。
## Decisions
1. `npm start` 使用 `tsx src/server.ts` 直接启动源码入口。
- 原因:这是最小改动,能够立刻满足标准启动命令诉求,同时不引入“必须先 build”的额外依赖。
- 备选:`node dist/src/server.js`。未采用,因为当前项目没有把编译产物作为本地启动前提,直接切换会增加命令链复杂度。
2. 保留 `npm run dev=tsx watch src/server.ts`。
- 原因:`dev` 继续承担热更新职责,`start` 只负责直接启动,职责分离更清晰。
## Risks / Trade-offs
- [Risk] `npm start` 仍依赖 `tsx` 而不是编译产物。 -> Mitigation: 本 change 只解决启动命令标准化;如后续需要生产化启动,再单独通过新的 OpenSpec change 切换到 build 产物。
- [Risk] 外部脚本如果硬编码 `npm run dev`,本 change 不会自动迁移。 -> Mitigation: 保留 `dev`,确保兼容现有使用方式。
## Migration Plan
1. 在 backend `package.json` 增加 `start` 脚本。
2. 运行 `npm start` 并验证健康检查可用。
3. 保持 `npm run dev` 不变,避免影响现有本地开发流程。
## Open Questions
- 当前无阻塞性开放问题。
## Why
`workspace/single-pages/backend` 目前没有标准的 `npm start` 入口,启动后端只能使用 `npm run dev`。这会让日常启动命令和常见 Node 服务约定不一致,也不利于把“开发热更新”和“直接启动服务”区分开。
## What Changes
- 为 `workspace/single-pages/backend` 增加标准的 `npm start` 启动命令。
- 保留现有 `npm run dev` 作为带 watch 的开发命令,不把热更新语义混入 `npm start`。
- 补充项目级 OpenSpec,明确后端工程基座需要同时提供标准启动命令和开发启动命令。
## Capabilities
### New Capabilities
- 无。
### Modified Capabilities
- `single-pages-foundation`: 扩展后端工程基座命令约束,要求提供标准 `npm start` 启动入口,并保留 `npm run dev` 作为开发 watch 入口。
## Impact
- 后端脚本:`workspace/single-pages/backend/package.json`
- 项目级规范:`workspace/single-pages/openspec/specs/single-pages-foundation/spec.md`
- 验证方式:补充对 `npm start` 启动健康检查的验证
## ADDED Requirements
### Requirement: Back-end startup commands are standardized
The system SHALL provide separate npm commands for standard back-end startup and watch-mode development startup in `workspace/single-pages/backend`.
#### Scenario: Standard startup command is available
- **WHEN** a developer needs to start the single-pages back-end without watch mode
- **THEN** the back-end project MUST provide `npm start`
- **AND** `npm start` MUST start the existing service entrypoint successfully without requiring code changes
#### Scenario: Development watch command remains available
- **WHEN** a developer needs local hot-reload development for the single-pages back-end
- **THEN** the back-end project MUST continue to provide `npm run dev`
- **AND** `npm run dev` MUST remain the watch-mode development command
## 1. 规范与状态同步
- [x] 1.1 补齐 `add-backend-start-command` 的 proposal、design、spec 和项目状态文件。
- [x] 1.2 在用户确认后再进入代码修改阶段。
## 2. 后端脚本调整
- [x] 2.1 在 `workspace/single-pages/backend/package.json` 中新增 `start` 脚本,并保留现有 `dev` 脚本。
## 3. 验证
- [ ] 3.1 运行后端相关检查,至少覆盖 `npm start` 启动与健康检查验证。
- [x] 3.2 运行 `openspec validate add-backend-start-command --strict` 并同步结果。
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
当前端点击 `查看其他案例` 并成功切换到新的案例内容后,页面应更新为新案例的数据,但底部动作仍保持 `view_other` 语义和 `查看其他案例` 文案,避免因为新案例本身来自 `home_popup` 或 `package_detail` 场景而把按钮重新渲染成 `继续学习下个套餐` 或 `完成学习`。 当前端点击 `查看其他案例` 并成功切换到新的案例内容后,页面应更新为新案例的数据,但底部动作仍保持 `view_other` 语义和 `查看其他案例` 文案,避免因为新案例本身来自 `home_popup` 或 `package_detail` 场景而把按钮重新渲染成 `继续学习下个套餐` 或 `完成学习`。
当接口响应包含 `notice` 时,前端只展示提示,不刷新、重载、清空或替换当前学习内容。若响应同时带回新的 `actionState`,前端仍必须应用新的按钮动作类型、文案和禁用态;`notice` 只影响 toast 展示,不能提前返回并跳过按钮状态更新。toast 必须固定显示在页面正中间,背景使用 `rgba(0, 0, 0, 0.8)`,文字颜色为 `#fff`。 当接口响应包含 `notice` 时,前端只展示提示,不刷新、重载、清空或替换当前学习内容。若响应同时带回新的 `actionState`,前端仍必须应用新的按钮动作类型、文案和禁用态;`notice` 只影响 toast 展示,不能提前返回并跳过按钮状态更新。toast 必须固定显示在页面正中间,背景使用 `rgba(0, 0, 0, 0.8)`,文字颜色为 `#fff`。完成学习成功是例外:后端不返回成功 `notice/toastMessage`,前端切换为 `查看其他案例` 状态但不展示“学习已保存”toast;如果兼容旧响应收到该类成功提示,前端也必须忽略。
### 7. 学习动作按钮补齐图标 ### 7. 学习动作按钮补齐图标
...@@ -190,6 +190,17 @@ ...@@ -190,6 +190,17 @@
`page_view` 写入失败仍不得阻断页面展示、阅读门禁倒计时或底部动作按钮;但实现阶段必须补充回归测试证明成功路径会真实调用埋点接口并写入或提交正确 payload。 `page_view` 写入失败仍不得阻断页面展示、阅读门禁倒计时或底部动作按钮;但实现阶段必须补充回归测试证明成功路径会真实调用埋点接口并写入或提交正确 payload。
### 11. 预学习完成学习通过 postMessage 通知 APP
预学习 H5 完成学习动作接口保存成功后,通知 APP 的桥接方式统一为 postMessage,不再调用 APP 注入到 H5 的 `window.completeActivity(payload)`。
完成通知沿用返回事件 `PRELEARN_BACK_TO_APP` 的 bridge 形态:
- 浏览器 iframe 调试场景:向 `window.parent.postMessage` 发送 `{ source: 'prelearn-h5', type: 'completeActivity', payload }`。
- APP WebView 场景:优先调用 `window.uni.webView.postMessage({ data })`,不可用时调用 `window.uni.postMessage({ data })`,其中 `data` 与浏览器调试场景保持一致。
- `payload` 继续使用既有 `PrelearningCompleteActivityPayload` 字段:`entrySource`、`staffUuid`、`merchantId`、`activityId`、`activityProductId`、`caseId`、`sessionId`。
- 若当前环境没有可用 bridge,页面展示“学习已保存,但通知 APP 失败,请重试。”并保留重试按钮;重试仍发送同一 postMessage data 结构。
## Risks / Trade-offs ## Risks / Trade-offs
- [Risk] 现有前端曾使用 `currentPrice/originalPrice`、`customerName/profileType/carSeries/occupation/demand` 和 `packageInfo.rights` 等兼容字段。→ Mitigation: 本次契约收敛为 `packageInfo.oldPrice/newPrice/includes` 与 `profile.name/type/car/job/needs/includes`,并明确 `profile.name/car` 由脚本表列填充,前后端 contracts、mock、页面读取和测试同步调整,避免继续出现字段对不上。 - [Risk] 现有前端曾使用 `currentPrice/originalPrice`、`customerName/profileType/carSeries/occupation/demand` 和 `packageInfo.rights` 等兼容字段。→ Mitigation: 本次契约收敛为 `packageInfo.oldPrice/newPrice/includes` 与 `profile.name/type/car/job/needs/includes`,并明确 `profile.name/car` 由脚本表列填充,前后端 contracts、mock、页面读取和测试同步调整,避免继续出现字段对不上。
...@@ -203,6 +214,7 @@ ...@@ -203,6 +214,7 @@
- [Risk] 接口返回 `notice` 时如果沿用新内容处理逻辑,可能造成页面刷新或当前内容丢失。→ Mitigation: 前端将 `notice` 作为覆盖提示层处理,保留当前内容和按钮上下文。 - [Risk] 接口返回 `notice` 时如果沿用新内容处理逻辑,可能造成页面刷新或当前内容丢失。→ Mitigation: 前端将 `notice` 作为覆盖提示层处理,保留当前内容和按钮上下文。
- [Risk] `page_view` 埋点失败不影响页面,容易在验收中被主流程成功掩盖。→ Mitigation: 增加首屏成功渲染后触发埋点的前后端回归测试,校验 payload 字段和失败不阻塞行为。 - [Risk] `page_view` 埋点失败不影响页面,容易在验收中被主流程成功掩盖。→ Mitigation: 增加首屏成功渲染后触发埋点的前后端回归测试,校验 payload 字段和失败不阻塞行为。
- [Risk] 埋点代码继续按旧规格写入 `staff_name` 会导致 MySQL 1054 `Unknown column`,但接口仍返回 200 让前端误判。→ Mitigation: 本 change 明确 `staff_name` 不再是落库字段,移除 Prisma/schema/raw SQL 中该列,并增加后端回归测试覆盖写入字段。 - [Risk] 埋点代码继续按旧规格写入 `staff_name` 会导致 MySQL 1054 `Unknown column`,但接口仍返回 200 让前端误判。→ Mitigation: 本 change 明确 `staff_name` 不再是落库字段,移除 Prisma/schema/raw SQL 中该列,并增加后端回归测试覆盖写入字段。
- [Risk] APP 侧仍监听旧的 `window.completeActivity(payload)` 注入方式时会收不到完成通知。→ Mitigation: 本 change 明确完成通知改为与 `PRELEARN_BACK_TO_APP` 一致的 postMessage bridge,消息 `type=completeActivity`,并通过前端回归测试固定 data 结构,便于 APP 侧按 type 分发。
## Open Questions ## Open Questions
......
...@@ -31,6 +31,7 @@ SOP 素材 H5 需要将 URL 查询入口从 `id` 调整为 `actionId`,并在 ...@@ -31,6 +31,7 @@ SOP 素材 H5 需要将 URL 查询入口从 `id` 调整为 `actionId`,并在
- 修正预学习埋点表字段口径:`dj_prelearn_buried_point_log` 已不包含 `staff_name`,后端不得再向该列写入;`staffName` 仅作为前端可选上下文,不参与当前落库字段。 - 修正预学习埋点表字段口径:`dj_prelearn_buried_point_log` 已不包含 `staff_name`,后端不得再向该列写入;`staffName` 仅作为前端可选上下文,不参与当前落库字段。
- 修复预学习接口返回 `notice` 时的前端处理:页面不得刷新或清空当前内容,只在页面正中间展示黑色 0.8 透明度、白色文字的 toast。 - 修复预学习接口返回 `notice` 时的前端处理:页面不得刷新或清空当前内容,只在页面正中间展示黑色 0.8 透明度、白色文字的 toast。
- 补齐 `查看其他案例` 后端候选规则:按入口范围从 `dj_prelearn_product_script` 随机选择未读案例,必须使用 `dj_prelearn_staff_read_case` 中 `staff_uuid + activity_id + activity_product_id` 的已读 `caseId` 过滤,且不得在没有未读案例时 fallback 到已读案例。 - 补齐 `查看其他案例` 后端候选规则:按入口范围从 `dj_prelearn_product_script` 随机选择未读案例,必须使用 `dj_prelearn_staff_read_case` 中 `staff_uuid + activity_id + activity_product_id` 的已读 `caseId` 过滤,且不得在没有未读案例时 fallback 到已读案例。
- 调整预学习完成学习通知:动作保存成功后 H5 通过 APP bridge postMessage 发送 `type=completeActivity` 和完成 payload,不再依赖 APP 注入 `window.completeActivity(payload)`。
## Capabilities ## Capabilities
...@@ -41,6 +42,7 @@ SOP 素材 H5 需要将 URL 查询入口从 `id` 调整为 `actionId`,并在 ...@@ -41,6 +42,7 @@ SOP 素材 H5 需要将 URL 查询入口从 `id` 调整为 `actionId`,并在
- `prelearning-read-gate`: 将阅读门禁倒计时从固定 60 秒调整为配置中心优先、60 秒兜底。 - `prelearning-read-gate`: 将阅读门禁倒计时从固定 60 秒调整为配置中心优先、60 秒兜底。
- `prelearning-learning-actions`: 补齐 `view_other` 按入口范围随机未读案例、已读过滤、无更多 notice 和 toast 不刷新规则。 - `prelearning-learning-actions`: 补齐 `view_other` 按入口范围随机未读案例、已读过滤、无更多 notice 和 toast 不刷新规则。
- `prelearning-app-bridge-tracking`: 修复预学习首屏 `page_view` 埋点写入失败的契约和回归覆盖。 - `prelearning-app-bridge-tracking`: 修复预学习首屏 `page_view` 埋点写入失败的契约和回归覆盖。
- `prelearning-app-bridge-tracking`: 将预学习完成学习通知统一到 postMessage bridge,APP 按 `type=completeActivity` 接收完成 payload。
## Impact ## Impact
......
...@@ -29,3 +29,17 @@ ...@@ -29,3 +29,17 @@
- **AND** 前端 MUST 仅同步重置当前案例的真实停留时长计时起点 - **AND** 前端 MUST 仅同步重置当前案例的真实停留时长计时起点
- **AND** 前端 MUST NOT 因 `learn_next` 切换到下一个案例而触发 `reroll_case` - **AND** 前端 MUST NOT 因 `learn_next` 切换到下一个案例而触发 `reroll_case`
- **AND** 新内容的 `activityProductId` 与 `caseId` MUST 继续用于后续 `task_completed`、`view_other` 触发的 `reroll_case` 与返回拦截上下文 - **AND** 新内容的 `activityProductId` 与 `caseId` MUST 继续用于后续 `task_completed`、`view_other` 触发的 `reroll_case` 与返回拦截上下文
### Requirement: 预学习完成通知必须通过 postMessage 发给 APP
系统 MUST 在预学习 H5 完成学习动作保存成功后,通过与返回事件一致的 postMessage bridge 通知 APP,不得再依赖 APP 注入 `window.completeActivity(payload)`。
#### Scenario: 完成学习保存成功后通知 APP
- **WHEN** 用户点击 `完成学习` 且预学习动作接口返回成功
- **THEN** 前端 MUST 向 APP bridge 发送消息
- **AND** 消息 MUST include `type=completeActivity`
- **AND** 消息 payload MUST 包含 `entrySource`、`staffUuid`、`merchantId`、`activityId`、`activityProductId`、`caseId` 和 `sessionId`
- **AND** 浏览器 iframe 调试场景 MUST 使用 `window.parent.postMessage` 发送 `{ source: 'prelearn-h5', type: 'completeActivity', payload }`
- **AND** APP WebView 场景 MUST 优先通过 `window.uni.webView.postMessage({ data })` 或 `window.uni.postMessage({ data })` 发送同一 data 结构
- **AND** APP WebView 场景中若 `window.uni` bridge 尚未就绪,前端 MUST 按 demo 同步加载本地 `uni.webview.1.5.5.js`
- **AND** 前端 MUST 等待 `UniAppJSBridgeReady` 或超时兜底后再尝试发送 `completeActivity`
- **AND** 前端 MUST NOT call `window.completeActivity(payload)` as the completion bridge
...@@ -73,3 +73,11 @@ ...@@ -73,3 +73,11 @@
- **AND** 如果响应包含 `notice` 且未返回新内容,前端 MUST 保留当前学习内容和当前滚动位置 - **AND** 如果响应包含 `notice` 且未返回新内容,前端 MUST 保留当前学习内容和当前滚动位置
- **AND** 如果响应包含 `notice` 且同时返回新的 `actionState`,前端 MUST 应用响应中的动作类型、文案和禁用态作为新的按钮事实源 - **AND** 如果响应包含 `notice` 且同时返回新的 `actionState`,前端 MUST 应用响应中的动作类型、文案和禁用态作为新的按钮事实源
- **AND** 前端 MUST 只展示 notice toast,且 MUST NOT 因 toast 分支跳过上述按钮状态更新 - **AND** 前端 MUST 只展示 notice toast,且 MUST NOT 因 toast 分支跳过上述按钮状态更新
#### Scenario: 完成学习成功不展示保存 toast
- **WHEN** 用户点击 `完成学习` 且后端保存成功
- **THEN** 后端 MUST 返回 `view_other` 动作状态
- **AND** 后端 MUST NOT 返回用于成功提示的 `notice` 或 `toastMessage`
- **AND** 前端 MUST 切换为 `查看其他案例` 动作状态
- **AND** 前端 MUST NOT 展示 `学习已保存` 或其他完成学习成功 toast
- **AND** 如果前端兼容旧响应收到完成学习成功 `notice` 或 `toastMessage`,也 MUST 忽略该成功 toast
...@@ -59,6 +59,9 @@ ...@@ -59,6 +59,9 @@
- [x] 4.19 增加前端回归测试,覆盖 `notice` 不刷新当前内容且居中 toast、`page_view` 首屏触发与失败不阻断、`view_other` 无更多时按钮置灰且按钮下方不再渲染重复辅助文案。 - [x] 4.19 增加前端回归测试,覆盖 `notice` 不刷新当前内容且居中 toast、`page_view` 首屏触发与失败不阻断、`view_other` 无更多时按钮置灰且按钮下方不再渲染重复辅助文案。
- [x] 4.20 修复 `learn_next` 并发兜底返回 `view_other + notice` 时的前端状态落地,确保页面保留当前案例内容但底部主按钮立即切换为接口返回的“查看其他案例”。 - [x] 4.20 修复 `learn_next` 并发兜底返回 `view_other + notice` 时的前端状态落地,确保页面保留当前案例内容但底部主按钮立即切换为接口返回的“查看其他案例”。
- [x] 4.21 补充前端动作同步防重复门闩与回归测试,确保学习动作按钮在进入提交态前的连续点击不会发出第二个请求。 - [x] 4.21 补充前端动作同步防重复门闩与回归测试,确保学习动作按钮在进入提交态前的连续点击不会发出第二个请求。
- [x] 4.22 将预学习完成通知从 `window.completeActivity(payload)` 改为 APP bridge postMessage,消息 `type=completeActivity`,并增加前端回归测试覆盖 APP 接收数据结构。
- [x] 4.23 按 demo 补齐预学习 H5 的 `uni.webview.1.5.5.js` 动态加载与 `UniAppJSBridgeReady` 等待逻辑,确保 `window.uni` 初始不存在时仍可在 bridge ready 后发送 `completeActivity`。
- [x] 4.24 回流修复点击 `完成学习` 成功后不展示“学习已保存”toast,后端不再返回成功 `notice/toastMessage`,前端兼容旧响应时也忽略该成功 toast。
## 5. 验证 ## 5. 验证
...@@ -74,3 +77,6 @@ ...@@ -74,3 +77,6 @@
- [x] 5.10 重新运行 `rtk npm run test -- src/routes/prelearning.test.ts`。 - [x] 5.10 重新运行 `rtk npm run test -- src/routes/prelearning.test.ts`。
- [x] 5.11 重新运行后端 Prisma/类型检查相关验证,确认移除 `staff_name` 后埋点写入字段与当前数据库表结构一致。 - [x] 5.11 重新运行后端 Prisma/类型检查相关验证,确认移除 `staff_name` 后埋点写入字段与当前数据库表结构一致。
- [x] 5.12 重新运行 `rtk npm run test -- src/routes/prelearning.test.ts`、`rtk npm run test -- src/apps/prelearning/app.test.tsx`、前后端 `rtk npm run typecheck`、前端 `rtk npm run build`、`rtk openspec validate update-h5-tracking-and-product-package-info --strict` 和相关文件 `rtk git diff --check`,覆盖 `view_other` 已读过滤与 notice 按钮状态回归。 - [x] 5.12 重新运行 `rtk npm run test -- src/routes/prelearning.test.ts`、`rtk npm run test -- src/apps/prelearning/app.test.tsx`、前后端 `rtk npm run typecheck`、前端 `rtk npm run build`、`rtk openspec validate update-h5-tracking-and-product-package-info --strict` 和相关文件 `rtk git diff --check`,覆盖 `view_other` 已读过滤与 notice 按钮状态回归。
- [x] 5.13 重新运行 `rtk npm run test -- src/apps/prelearning/app.test.tsx`、前端 `rtk npm run typecheck`、`rtk openspec validate update-h5-tracking-and-product-package-info --strict` 和相关文件 `rtk git diff --check`,覆盖完成学习 postMessage 通知回归。
- [x] 5.14 重新运行 `rtk npm run test -- src/apps/prelearning/app.test.tsx`、前端 `rtk npm run typecheck`、`rtk openspec validate update-h5-tracking-and-product-package-info --strict` 和相关文件 `rtk git diff --check`,覆盖按 demo 加载 uni sdk 并等待 bridge ready 的完成通知回归。
- [x] 5.15 重新运行前端预学习测试、后端预学习测试、前后端 typecheck、OpenSpec strict 校验和相关文件 `git diff --check`,覆盖完成学习成功不弹 toast。
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!