diff --git a/web/storyforge-web-v4/assets/app.js b/web/storyforge-web-v4/assets/app.js index c6f475f..f92c6c0 100644 --- a/web/storyforge-web-v4/assets/app.js +++ b/web/storyforge-web-v4/assets/app.js @@ -4471,6 +4471,57 @@ function captureMainAgentLandingContext(action, targetScreen) { }; } +function renderMainAgentLandingQuickActions(screenKey) { + const actionMap = { + intake: [ + { action: "create-project", label: "新建项目" }, + { action: "open-import-video-link", label: "导入作品" }, + { action: "open-upload-video", label: "上传视频" } + ], + discovery: [ + { action: "open-import-homepage", label: "导入主页" }, + { action: "analyze-top-videos", label: "高分分析" }, + { action: "goto-tracking", label: "去跟踪账号" } + ], + tracking: [ + { action: "refresh-tracking", label: "同步全部" }, + { action: "mark-tracking-read", label: "标记已读" }, + { action: "goto-discovery", label: "跳到找对标" } + ], + automation: [ + { action: "refresh-data", label: "刷新状态" }, + { action: "goto-production", label: "去生产中心" } + ], + playbook: [ + { action: "open-oneliner-profile", label: "配置 OneLiner" }, + { action: "open-create-assistant", label: "新建 Agent" }, + { action: "goto-production", label: "去生产中心" } + ], + production: [ + { action: "goto-review", label: "去复盘" }, + { action: "batch-recover-jobs", label: "批量恢复" }, + { action: "refresh-data", label: "刷新队列" } + ], + review: [ + { action: "open-create-review", label: "写复盘" }, + { action: "goto-production", label: "去生产中心" }, + { action: "refresh-data", label: "刷新结果" } + ], + strategy: [ + { action: "open-user-global-policy", label: "编辑全局策略" }, + { action: "open-user-platform-policy", label: "编辑当前平台策略" }, + { action: "open-oneliner-profile", label: "调整 OneLiner" } + ] + }; + const actions = safeArray(actionMap[screenKey]).slice(0, 3); + if (!actions.length) return ""; + return ` +
+ ${actions.map((item) => `${escapeHtml(item.label)}`).join("")} +
+ `; +} + function renderMainAgentLandingNotice(screenKey) { const landing = appState.mainAgentLanding; if (!landing || landing.screen !== screenKey) return ""; @@ -4494,6 +4545,7 @@ function renderMainAgentLandingNotice(screenKey) { `).join("")} ` : ""} + ${renderMainAgentLandingQuickActions(screenKey)}
${landing.title ? `${escapeHtml(landing.title)}` : ""} ${resultSections.workstream_label ? `${escapeHtml(resultSections.workstream_label)}` : ""} diff --git a/web/storyforge-web-v4/tests/workbench-pages.test.mjs b/web/storyforge-web-v4/tests/workbench-pages.test.mjs index 7eb2aa3..40b320c 100644 --- a/web/storyforge-web-v4/tests/workbench-pages.test.mjs +++ b/web/storyforge-web-v4/tests/workbench-pages.test.mjs @@ -260,6 +260,7 @@ test("main agent result rendering offers a direct route back into the recommende test("main agent route actions keep landing context and destination screens render a notice", () => { const execution = extractBetween(APP, "function renderOneLinerExecutionPayloadHtml(payload)", "function parseOneLinerActionPayloadValue(value)"); const actions = extractBetween(APP, "document.addEventListener(\"click\", async (event) => {", "document.addEventListener(\"submit\", async (event) => {"); + const landingActions = extractBetween(APP, "function renderMainAgentLandingQuickActions(screenKey)", "function renderMainAgentLandingNotice(screenKey)"); const strategy = extractBetween(APP, "function renderStrategyScreen()", "function renderCreditsScreen()"); const landing = extractBetween(APP, "function renderMainAgentLandingNotice(screenKey)", "function renderEmptyState(title, description)"); const production = extractBetween(APP, "function renderProductionScreen()", "function renderReviewScreen()"); @@ -267,7 +268,10 @@ test("main agent route actions keep landing context and destination screens rend assert.match(actions, /captureMainAgentLandingContext\(action,\s*"goto-production"/); assert.match(actions, /captureMainAgentLandingContext\(action,\s*"goto-strategy"/); assert.match(actions, /name === "dismiss-main-agent-landing"/); + assert.match(landingActions, /open-user-global-policy/); + assert.match(landingActions, /refresh-tracking/); assert.match(landing, /result_sections/); + assert.match(landing, /renderMainAgentLandingQuickActions\(screenKey\)/); assert.match(landing, /detail-grid/); assert.match(strategy, /renderMainAgentLandingNotice\("strategy"\)/); assert.match(production, /renderMainAgentLandingNotice\("production"\)/);