diff --git a/web/storyforge-web-v4/assets/app.js b/web/storyforge-web-v4/assets/app.js index 779c1b9..e4653ac 100644 --- a/web/storyforge-web-v4/assets/app.js +++ b/web/storyforge-web-v4/assets/app.js @@ -618,6 +618,10 @@ function hasSessionBackendMismatch(expectedBackendUrl = DEFAULT_BACKEND_URL) { return Boolean(expected && current && expected !== current); } +function isMobileViewport() { + return typeof window !== "undefined" && Boolean(window.matchMedia?.("(max-width: 760px)")?.matches); +} + function formatBackendDisplayLabel(value = DEFAULT_BACKEND_URL) { const normalized = normalizeBackendUrlValue(value || DEFAULT_BACKEND_URL); if (!normalized) return "未配置后端"; @@ -5527,6 +5531,7 @@ function renderDiscoveryScreen() { const selectedProject = getSelectedProject(); const importedSources = getCurrentProjectSourcesForAccount(selected, selectedProject?.id || ""); const tracked = selected?.id ? isTrackedAccount(selected.id) : false; + const isMobileUi = isMobileViewport(); const discoveryHandoffAttrs = buildMainAgentHandoffAttrs({ sourceScreen: "discovery", sourceActionKey: "discovery-handoff", @@ -5587,12 +5592,15 @@ function renderDiscoveryScreen() { } else { detailBodyHtml = renderDiscoveryRelationsSection(linkedAccounts, similarCandidates); } + const discoveryActionsHtml = isMobileUi + ? `${button("导入主页", "open-import-homepage")} ${button("交给主 Agent", "handoff-to-main-agent", "secondary", { attrs: discoveryHandoffAttrs })} ${button("存对标", "open-benchmark-link", "primary", { disabledReason: workbenchReason || "" })}` + : `${button("导入主页", "open-import-homepage")} ${button("导入当前对标", "open-import-selected-account", "secondary", { disabledReason: workbenchReason || "" })} ${button(tracked ? "已在跟踪" : "加入跟踪", "open-track-selected-account", "secondary", { disabledReason: workbenchReason || "" })} ${button("账号分析", "analyze-selected-account", "secondary", { disabledReason: workbenchReason || "" })} ${button("高分分析", "analyze-top-videos", "secondary", { disabledReason: workbenchReason || "" })} ${button("查相似", "open-similar-search", "secondary", { disabledReason: workbenchReason || "" })} ${button("交给主 Agent", "handoff-to-main-agent", "secondary", { attrs: discoveryHandoffAttrs })} ${button("存对标", "open-benchmark-link", "primary", { disabledReason: workbenchReason || "" })}`; return screenShell( "找对标", isWorkbenchPlatform(currentPlatform) ? `这里已经接入真实${currentPlatformLabel}账号列表和单账号详情。` : `${workbenchReason}。当前仍可导入内容源、绑定 Agent 和沉淀复盘。`, - `${button("导入主页", "open-import-homepage")} ${button("导入当前对标", "open-import-selected-account", "secondary", { disabledReason: workbenchReason || "" })} ${button(tracked ? "已在跟踪" : "加入跟踪", "open-track-selected-account", "secondary", { disabledReason: workbenchReason || "" })} ${button("账号分析", "analyze-selected-account", "secondary", { disabledReason: workbenchReason || "" })} ${button("高分分析", "analyze-top-videos", "secondary", { disabledReason: workbenchReason || "" })} ${button("查相似", "open-similar-search", "secondary", { disabledReason: workbenchReason || "" })} ${button("交给主 Agent", "handoff-to-main-agent", "secondary", { attrs: discoveryHandoffAttrs })} ${button("存对标", "open-benchmark-link", "primary", { disabledReason: workbenchReason || "" })}`, + discoveryActionsHtml, ` ${renderMainAgentLandingNotice("discovery")}
${escapeHtml(selected ? `先围绕 ${getAccountName(selected)} 做导入、分析和相似扩展。` : "先从账号池里选一个对象,再继续导入和分析。")}
+${escapeHtml(selected ? `先围绕 ${getAccountName(selected)} 做导入、分析和相似扩展。` : "先从账号池里选一个对象,再继续导入和分析。")}
- -