Files
Genarrative/apps/ai-game-creator-shell/src/main.tsx
T
suzmii bd36587e0a 资源画布交互 1:1 复刻美术画布:点卡选中并浮出工具条,移除资源详情面板与全屏编辑路由
新增 features/resource-canvas:资源卡到美术画布 CanvasLayer 的适配、工具条动作可用性判定、C5 当前版本绑定判定、快速编辑草稿工厂与 AGC 宿主 chrome 样式

资源卡点击改为选中(Shift/Ctrl/Meta 多选),选中后在卡片旁复用 ImageCanvasSelectedLayerToolbarView 浮出工具条

快速编辑复用 ImageCanvasQuickEditPanelView 浮层面板,先调 normalize_local_project_raster_resource 正规化任务产物,再走 derive_local_project_resource(editKind=image-reference) 产出新素材,失败重试复用同一 operationId/idempotencyKey

删除 resourceEditorRoute 全链路(ResourceEditSurface 路由、openResourceEditor、handleResourceCardOpenEditor、cancelResourceEditor、submitResourceEdit)与资源详情面板(focusedResource 状态/引用/浮层 JSX/CSS 断言)

分类与标签入口搬到选中工具条;UI 资源保留「UI 编辑器」入口并从工具条打开

移除 apps/ai-game-creator-shell/scripts/check-config.mjs 中 normalize_local_project_raster_resource 的过渡 allowlist 条目

为共享工具条组件新增 opt-in 的 supportedActions/extraActions(默认 null/undefined,网页端行为不变)

AGC vite-env.d.ts 补 wx/ReactNativeWebView/WeixinJSBridge 跨端全局声明;hostBridge fail 回调补显式 unknown 类型

测试:资源卡查询 helper 由资源详情按钮改为选中按钮,清理详情面板断言,画布空白左键改为框选后平移用例改用中键
2026-09-10 15:19:17 +08:00

48 lines
1.4 KiB
TypeScript

import '@genarrative/image-canvas-react/styles.css';
import './styles.css';
import './features/resource-canvas/resourceCanvasChrome.css';
import React from 'react';
import { createRoot } from 'react-dom/client';
import { App, AuthenticatedClient, WorkspaceLauncher } from './App';
import { WindowChrome } from './components/WindowChrome';
const initialSearchParams = new URLSearchParams(window.location.search);
const supervisorChatMode =
import.meta.env.DEV && initialSearchParams.has('supervisor-chat');
const supervisorChatProjectPath =
initialSearchParams.get('projectPath')?.trim() ?? '';
function resolveInitialLauncherView() {
return import.meta.env.DEV && initialSearchParams.has('agent-chat')
? 'agent-chat'
: 'home';
}
const initialLauncherView = resolveInitialLauncherView();
createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<WindowChrome>
<AuthenticatedClient>
{({ user, logout }) =>
supervisorChatMode ? (
<App
initialProjectPath={supervisorChatProjectPath}
projectSupervisorOnly
supervisorChatOnly
/>
) : (
<WorkspaceLauncher
currentUser={user}
initialView={initialLauncherView}
onLogout={logout}
/>
)
}
</AuthenticatedClient>
</WindowChrome>
</React.StrictMode>,
);