diff --git a/apps/ai-game-creator-shell/src/view/project-development/index.tsx b/apps/ai-game-creator-shell/src/view/project-development/index.tsx index 3726dd0d8..8c40d571b 100644 --- a/apps/ai-game-creator-shell/src/view/project-development/index.tsx +++ b/apps/ai-game-creator-shell/src/view/project-development/index.tsx @@ -2985,944 +2985,957 @@ export default function ProjectDevelopmentView({ className="launcher-page launcher-project-development game-project-workbench" aria-label="项目开发工作台" > -
-
-
-
- - -
-
- {mode === 'resources' && - !focusedResource && - !assetCanvasRoute && - !resourceEditorRoute && - !uiEditorRoute ? ( - <> - {pendingResourceEdits.length > 0 || - pendingResourceEditsLoadState === 'failed' ? ( + setUiEditorRoute(null)} + /> +
+ ) : ( +
+
+
+
+ + +
+
+ {mode === 'resources' && + !focusedResource && + !assetCanvasRoute && + !resourceEditorRoute && + !uiEditorRoute ? ( + <> + {pendingResourceEdits.length > 0 || + pendingResourceEditsLoadState === 'failed' ? ( + + ) : null} - ) : null} - - {/*// TODO this is only for debug usage, should integrate to the new asset above later*/} - - - - {resourceLayoutSaving ? '保存中' : resourceLayoutNotice} - - - - ) : null} -
-
- - {!runAvailable && - !focusedResource && - !assetCanvasRoute && - !resourceEditorRoute && - !uiEditorRoute ? ( -

- 首个可运行原型尚未完成,运行视图暂不可用 -

- ) : null} - - {/* TODO(ui-design-surface): decide whether the workbench toolbar is - hidden for the UI editor surface as part of a dedicated layout pass. */} - {mode === 'resources' && uiEditorRoute ? ( - setUiEditorRoute(null)} - /> - ) : mode === 'resources' && assetCanvasRoute ? ( - - ) : mode === 'resources' && resourceEditorRoute ? ( - - ) : mode === 'resources' && focusedResource ? ( -
-
- - - - - {categoryLabels[focusedResource.category]} - - {focusedResource.label} - - - - - - - -
-
-
-
-
资源路径
-
{focusedResource.path}
-
-
-
资源类型
-
{focusedPreviewMediaType}
-
-
-
资源来源
-
{focusedResource.sourceLabel}
-
- {focusedResource.taskTitle ? ( -
-
来源任务
-
{focusedResource.taskTitle}
-
- ) : null} -
-
依赖层级
-
{focusedResource.dependencyDepth}
-
-
-
依赖状态
-
- {focusedResourceDependencyDetails.cyclic - ? '同类型依赖环' - : '正常'} -
-
-
-
引用上游
-
- {focusedResourceDependencyDetails.upstreamLabels.length > - 0 - ? focusedResourceDependencyDetails.upstreamLabels.join( - '、', - ) - : '暂无同类型引用'} -
-
-
-
引用下游
-
- {focusedResourceDependencyDetails.downstreamLabels - .length > 0 - ? focusedResourceDependencyDetails.downstreamLabels.join( - '、', - ) - : '暂无同类型引用'} -
-
-
-
任务流
-
- {focusedResourceDependencyDetails.taskFlowLabels.length > - 0 - ? focusedResourceDependencyDetails.taskFlowLabels.join( - ';', - ) - : '暂无同类型任务流'} -
-
- {focusedResourceIsAudio ? ( -
-
音频时长
-
{formatMediaDuration(mediaDuration)}
-
- ) : null} - {focusedResource.version ? ( - <> -
-
版本 ID
-
{focusedResource.version.versionId}
-
-
-
项目修订
-
{focusedResource.version.projectRevision}
-
-
-
父版本
-
- {focusedResource.version.parentVersionId ?? - '首个版本'} -
-
-
-
直接子版本
-
- {focusedResource.version.childVersionIds.length > 0 - ? focusedResource.version.childVersionIds.join('、') - : '暂无'} -
-
-
-
创建原因
-
- { - { - initial: '初始版本', - 'resource-replacement': '资源替换', - 'agent-revision': 'Agent 修订', - }[focusedResource.version.createdReason] - } -
-
-
-
创建时间
-
- {formatVersionCreatedAt( - focusedResource.version.createdAt, - )} -
-
-
-
资源绑定
-
- {focusedResource.version.resourceBindings.length > 0 - ? focusedResource.version.resourceBindings - .map( - (binding) => - `${binding.slotId} → ${binding.resourceId}`, - ) - .join(';') - : '暂无'} -
-
- - ) : null} -
- {focusedResourceIsAudio ? ( -
- {focusedResourceCardPreview.status === 'loaded' && - focusedResourceCardPreview.preview.sourceUrl ? ( -
- ) : null} - {focusedResource.category === 'document' ? ( -
- {focusedResourceCardPreview.status === 'loaded' && - focusedResourceCardPreview.preview.content !== undefined ? ( - focusedResourceCardPreview.preview.content.trim() ? ( - - ) : ( -

文档为空

- ) - ) : focusedResourceCardPreview.status === 'failed' ? ( -

{focusedResourceCardPreview.error}

- ) : ( -

正在载入文档…

- )} -
- ) : null} -
-
- ) : mode === 'resources' ? ( -
- - {assetCanvasNotice ? ( -
- {assetCanvasNotice} - {hiddenCommittedResourceId ? ( + {/*// TODO this is only for debug usage, should integrate to the new asset above later*/} + + + {resourceLayoutSaving ? '保存中' : resourceLayoutNotice} + + + + ) : null} +
+
+ + {!runAvailable && + !focusedResource && + !assetCanvasRoute && + !resourceEditorRoute && + !uiEditorRoute ? ( +

+ 首个可运行原型尚未完成,运行视图暂不可用 +

+ ) : null} + + {mode === 'resources' && assetCanvasRoute ? ( + + ) : mode === 'resources' && resourceEditorRoute ? ( + + ) : mode === 'resources' && focusedResource ? ( +
+
+ + + + + {categoryLabels[focusedResource.category]} + + {focusedResource.label} + + + + + + + +
+
+
+
+
资源路径
+
{focusedResource.path}
+
+
+
资源类型
+
{focusedPreviewMediaType}
+
+
+
资源来源
+
{focusedResource.sourceLabel}
+
+ {focusedResource.taskTitle ? ( +
+
来源任务
+
{focusedResource.taskTitle}
+
+ ) : null} +
+
依赖层级
+
{focusedResource.dependencyDepth}
+
+
+
依赖状态
+
+ {focusedResourceDependencyDetails.cyclic + ? '同类型依赖环' + : '正常'} +
+
+
+
引用上游
+
+ {focusedResourceDependencyDetails.upstreamLabels + .length > 0 + ? focusedResourceDependencyDetails.upstreamLabels.join( + '、', + ) + : '暂无同类型引用'} +
+
+
+
引用下游
+
+ {focusedResourceDependencyDetails.downstreamLabels + .length > 0 + ? focusedResourceDependencyDetails.downstreamLabels.join( + '、', + ) + : '暂无同类型引用'} +
+
+
+
任务流
+
+ {focusedResourceDependencyDetails.taskFlowLabels + .length > 0 + ? focusedResourceDependencyDetails.taskFlowLabels.join( + ';', + ) + : '暂无同类型任务流'} +
+
+ {focusedResourceIsAudio ? ( +
+
音频时长
+
{formatMediaDuration(mediaDuration)}
+
+ ) : null} + {focusedResource.version ? ( + <> +
+
版本 ID
+
{focusedResource.version.versionId}
+
+
+
项目修订
+
{focusedResource.version.projectRevision}
+
+
+
父版本
+
+ {focusedResource.version.parentVersionId ?? + '首个版本'} +
+
+
+
直接子版本
+
+ {focusedResource.version.childVersionIds.length > 0 + ? focusedResource.version.childVersionIds.join( + '、', + ) + : '暂无'} +
+
+
+
创建原因
+
+ { + { + initial: '初始版本', + 'resource-replacement': '资源替换', + 'agent-revision': 'Agent 修订', + }[focusedResource.version.createdReason] + } +
+
+
+
创建时间
+
+ {formatVersionCreatedAt( + focusedResource.version.createdAt, + )} +
+
+
+
资源绑定
+
+ {focusedResource.version.resourceBindings.length > 0 + ? focusedResource.version.resourceBindings + .map( + (binding) => + `${binding.slotId} → ${binding.resourceId}`, + ) + .join(';') + : '暂无'} +
+
+ + ) : null} +
+ {focusedResourceIsAudio ? ( +
+ {focusedResourceCardPreview.status === 'loaded' && + focusedResourceCardPreview.preview.sourceUrl ? ( +
+ ) : null} + {focusedResource.category === 'document' ? ( +
+ {focusedResourceCardPreview.status === 'loaded' && + focusedResourceCardPreview.preview.content !== + undefined ? ( + focusedResourceCardPreview.preview.content.trim() ? ( + + ) : ( +

文档为空

+ ) + ) : focusedResourceCardPreview.status === 'failed' ? ( +

{focusedResourceCardPreview.error}

+ ) : ( +

正在载入文档…

+ )} +
) : null}
- ) : null} - {attachments.some( - (attachment) => attachment.status === 'failed', - ) ? ( -
- {attachments - .filter((attachment) => attachment.status === 'failed') - .map((attachment) => ( -

- {attachment.fileName} - {attachment.error || '附件导入失败'} -

- ))} -
- ) : null} -
0 - ? dependencyDescriptionId - : undefined - } - aria-busy={resourceLayoutSaving} - onScroll={(event) => { - resourceListScrollPositionsRef.current.set( - resourceListScrollKey, - { - left: event.currentTarget.scrollLeft, - top: event.currentTarget.scrollTop, - }, - ); - }} - > - {sortMode === 'dependency' && - dependencyRelationshipDescriptions.length > 0 ? ( -
-

当前资源关系:

-
    - {dependencyRelationshipDescriptions.map((description) => ( -
  • {description}
  • - ))} -
+
+ ) : mode === 'resources' ? ( +
+ + {assetCanvasNotice ? ( +
+ {assetCanvasNotice} + {hiddenCommittedResourceId ? ( + + ) : null}
) : null} -
-
attachment.status === 'failed', + ) ? ( +
- {categoryOrder.map((category) => { - const categoryResources = - visibleResourcesByCategory.get(category) ?? []; - const baseExtent = resourceBaseExtentByCategory.get( - category, - ) ?? { width: 0, height: 0 }; - const extent = { - width: - baseExtent.width + - (sortMode === 'dependency' - ? RESOURCE_DEPENDENCY_VISUAL_GUTTER - : 0), - height: baseExtent.height, - }; - const Icon = categoryIcons[category]; - const sectionHeight = - resourceSectionHeights.sectionStates.get(category); - if (!sectionHeight) { - return null; + {attachments + .filter((attachment) => attachment.status === 'failed') + .map((attachment) => ( +

+ {attachment.fileName} + {attachment.error || '附件导入失败'} +

+ ))} +
+ ) : null} +
0 + ? dependencyDescriptionId + : undefined + } + aria-busy={resourceLayoutSaving} + onScroll={(event) => { + resourceListScrollPositionsRef.current.set( + resourceListScrollKey, + { + left: event.currentTarget.scrollLeft, + top: event.currentTarget.scrollTop, + }, + ); + }} + > + {sortMode === 'dependency' && + dependencyRelationshipDescriptions.length > 0 ? ( +
+

当前资源关系:

+
    + {dependencyRelationshipDescriptions.map( + (description) => ( +
  • {description}
  • + ), + )} +
+
+ ) : null} +
+
-
- - -
- - {categoryResources.length} 项 - -
- - - -
-
- - - -
-
-
-
{ - resourceSectionScrollPositionsRef.current.set( - resourceSectionScrollKey(category), - { - left: event.currentTarget.scrollLeft, - top: event.currentTarget.scrollTop, - }, - ); - }} + > + {categoryOrder.map((category) => { + const categoryResources = + visibleResourcesByCategory.get(category) ?? []; + const baseExtent = resourceBaseExtentByCategory.get( + category, + ) ?? { width: 0, height: 0 }; + const extent = { + width: + baseExtent.width + + (sortMode === 'dependency' + ? RESOURCE_DEPENDENCY_VISUAL_GUTTER + : 0), + height: baseExtent.height, + }; + const Icon = categoryIcons[category]; + const sectionHeight = + resourceSectionHeights.sectionStates.get(category); + if (!sectionHeight) { + return null; + } + return ( +
- {categoryResources.length > 0 ? ( -
-
+ + +
+ - {sortMode === 'dependency' ? ( - - ) : null} - {categoryResources.map((resource) => { - const position = resourcePositionById.get( - resource.id, - ); - if (!position) { - return null; - } - const relationState = - selectedVersionBindingResourceIds.has( - resource.id, + {categoryResources.length} 项 + +
+ + + +
+
+ + +
- ) : ( -

暂无已登记资源

- )} -
-
- ); - })} + +
{ + resourceSectionScrollPositionsRef.current.set( + resourceSectionScrollKey(category), + { + left: event.currentTarget.scrollLeft, + top: event.currentTarget.scrollTop, + }, + ); + }} + > + {categoryResources.length > 0 ? ( +
+
+ {sortMode === 'dependency' ? ( + + ) : null} + {categoryResources.map((resource) => { + const position = resourcePositionById.get( + resource.id, + ); + if (!position) { + return null; + } + const relationState = + selectedVersionBindingResourceIds.has( + resource.id, + ) + ? 'version-binding' + : null; + const previewIdentity = + resourceCardPreviews.identityByResourceId.get( + resource.id, + ); + if (!previewIdentity) { + return null; + } + return ( + + ); + })} +
+
+ ) : ( +

暂无已登记资源

+ )} +
+
+ ); + })} +
- - ) : ( -
-
- {embeddedPreviewUrl ? ( - - ) : ( -
-
- )} + ) : ( +
+
+ {embeddedPreviewUrl ? ( + + ) : ( +
+
+ )} +
+
+ + + {`测试切片 ${activeSlice + 1}`} + +
+
+
+
+
+ {selectedResource ? ( +
+
+
名称
+
{selectedResource.label}
+
+
+
路径
+
{selectedResource.path}
+
+
+
类型
+
{selectedResource.mediaType}
+
+
+ ) : ( +

暂停后选择资源可查看已登记信息

+ )} +
+
+
+
+ + + +
+
+
+ )} +
+ + + + )} - - - - + { + design: '策', + art: '美', + code: '程', + balance: '数', + audio: '音', + publishing: '发', + }[agent.group] + } + + + {agent.label} + {agent.failureSummary ?? agent.statusLabel} + + + {agent.currentTask} + {agent.currentAction ? ( + {agent.currentAction} + ) : null} + {agent.waitingOn ? ( + {`等待:${agent.waitingOn}`} + ) : null} + {`任务完成 ${agent.completedCount}/${agent.totalCount}`} + + + ))} + + + ) : null} {resourceRecoveryPanelOpen ? (
+