添加全能创作功能

This commit is contained in:
Azmat@qq.com
2026-09-03 13:11:46 +08:00
parent 22ed2833ad
commit 6a628b0ca7
53 changed files with 9115 additions and 108 deletions
+32 -3
View File
@@ -31,6 +31,9 @@ import {
Dashboard,
FreeCreatePage,
QuickCreatePage,
OmniCreatePage,
OmniHistoryPage,
OmniSessionPage,
VideoRemixPage,
VideoReplacePage,
ImageWorkbenchPage,
@@ -544,7 +547,8 @@ export function App() {
if (options.projectId !== undefined) setActiveProjectId(options.projectId);
const hash = options.hash?.replace(/^#/, "");
const currentPath = `${window.location.pathname}${window.location.hash}`;
const path = `${pathForPage(next, { productId, projectId })}${hash ? `#${hash}` : ""}`;
const conversationId = options.conversationId ?? route.conversationId;
const path = `${pathForPage(next, { productId, projectId, conversationId })}${hash ? `#${hash}` : ""}`;
const prevState = readNavState(window.history.state);
const leaving: NavHistoryState = {
airshelf: 1,
@@ -555,7 +559,10 @@ export function App() {
if (!options.replace) {
window.history.replaceState(leaving, "", currentPath);
}
setRoute({ page: next, authMode, productId, projectId, hash, tab: options.tab });
setRoute({
page: next, authMode, productId, projectId, conversationId, hash,
tab: options.tab, firstMessage: options.firstMessage, firstRefs: options.firstRefs,
});
const arriving: NavHistoryState = {
airshelf: 1,
scrollY: 0,
@@ -1065,6 +1072,22 @@ export function App() {
navigate={navigate}
/>
);
case "omniCreate":
return <OmniCreatePage navigate={navigate} onNotify={(type, text) => setNotice({ type, text })} />;
case "omniHistory":
return <OmniHistoryPage navigate={navigate} onNotify={(type, text) => setNotice({ type, text })} />;
case "omniSession":
return route.conversationId ? (
<OmniSessionPage
conversationId={route.conversationId}
firstMessage={route.firstMessage}
firstRefs={route.firstRefs}
navigate={navigate}
onNotify={(type, text) => setNotice({ type, text })}
/>
) : (
<OmniHistoryPage navigate={navigate} onNotify={(type, text) => setNotice({ type, text })} />
);
case "assetFactory":
return <AssetFactoryPage navigate={navigate} />;
case "freeCreate":
@@ -1252,13 +1275,19 @@ export function App() {
<div className="app">
<Sidebar page={page} navigate={navigate} user={currentUser} team={currentTeam} canManageBilling={isOwner} products={products} projects={projects} productTotal={productTotal} projectTotal={projectTotal} aiUnread={aiUnread} onOpenAdmin={() => navigateAdmin("")} accountOpen={accountAnchor !== null} onOpenAccount={(rect) => setAccountAnchor((prev) => (prev ? null : rect))} />
<header className="topbar">
<ModeTabs active={topModule} navigate={navigate} />
{page === "omniSession" ? (
<div id="omni-session-topbar-slot" className="omni-session-topbar-slot" />
) : (
<ModeTabs active={topModule} navigate={navigate} />
)}
<div className="right">
{page !== "omniSession" && (
<button className="top-search" type="button" onClick={() => openCommandPalette()} aria-label="搜索">
<IconKitSvg name="search" />
<span></span>
<span className="kbd">{searchKbd}</span>
</button>
)}
<span className="balance-chip" onClick={() => navigate("account")}>
<IconKitSvg name="creditCard" />
<strong>{money(billing?.account.balance)}</strong>