新增 AGC 首页策划补全入口
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 5m27s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 5m28s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 5m28s
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 5m44s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m46s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m11s
Project CI / Repository checks (pull_request) Successful in 3m43s
Project CI / Frontend tests (pull_request) Successful in 4m35s
Project CI / Native shell tests (pull_request) Successful in 6m8s
Project CI / Backend tests (pull_request) Successful in 7m8s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m11s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 5m27s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 5m28s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 5m28s
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 5m44s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m46s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m11s
Project CI / Repository checks (pull_request) Successful in 3m43s
Project CI / Frontend tests (pull_request) Successful in 4m35s
Project CI / Native shell tests (pull_request) Successful in 6m8s
Project CI / Backend tests (pull_request) Successful in 7m8s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m11s
首页做游戏入口增加策划补全勾选项 勾选后复用 planning Agent Runtime 启动模式 补充首页启动模式回归测试与实施计划
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import type { ProjectStartMode } from '../../app/types';
|
||||
import type { HomeCreationType } from './useHomeDraftStore';
|
||||
|
||||
export function resolveHomeStartMode(
|
||||
creationType: HomeCreationType,
|
||||
planningCompletionEnabled: boolean,
|
||||
): ProjectStartMode {
|
||||
return creationType === 'doc' ||
|
||||
(creationType === 'game' && planningCompletionEnabled)
|
||||
? 'planning'
|
||||
: 'direct-build';
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
richTextToAttachments,
|
||||
richTextToPrompt,
|
||||
} from './components/RichInputArea/richTextToPrompt';
|
||||
import { resolveHomeStartMode } from './homeStartMode';
|
||||
import InspirationGallery from './InspirationGallery';
|
||||
import {
|
||||
type HomeCreationType,
|
||||
@@ -145,14 +146,18 @@ export default function HomeView({
|
||||
(state) => state.setRichText,
|
||||
);
|
||||
const [homeCreationBusy, setHomeCreationBusy] = useState(false);
|
||||
const [planningCompletionEnabled, setPlanningCompletionEnabled] =
|
||||
useState(false);
|
||||
const homeCreationBusyRef = useRef(false);
|
||||
const activeCreationType =
|
||||
HOME_CREATION_TYPE_ITEMS.find(
|
||||
(item) => item.creationType === homeCreationType,
|
||||
) ?? HOME_CREATION_TYPE_ITEMS[0]!;
|
||||
// 做方案走立项策划链路,做游戏 / 做素材维持既有的直接开建路由。
|
||||
const startMode: ProjectStartMode =
|
||||
homeCreationType === 'doc' ? 'planning' : 'direct-build';
|
||||
const startMode = resolveHomeStartMode(
|
||||
homeCreationType,
|
||||
planningCompletionEnabled,
|
||||
);
|
||||
|
||||
async function createFromHome() {
|
||||
if (homeCreationBusyRef.current || creationBusy) {
|
||||
@@ -241,7 +246,12 @@ export default function HomeView({
|
||||
type="button"
|
||||
key={item.creationType}
|
||||
aria-pressed={isActive}
|
||||
onClick={() => setHomeCreationType(item.creationType)}
|
||||
onClick={() => {
|
||||
setHomeCreationType(item.creationType);
|
||||
if (item.creationType !== 'game') {
|
||||
setPlanningCompletionEnabled(false);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<CreationTypeIcon size={14} aria-hidden="true" />
|
||||
{item.label}
|
||||
@@ -262,8 +272,21 @@ export default function HomeView({
|
||||
}}
|
||||
>
|
||||
<div className="grid grid-cols-[1fr_auto] items-center gap-2.5 text-[12px] text-(--platform-text-soft)">
|
||||
<div className="flex min-w-0 items-center gap-1.5">
|
||||
<div className="flex min-w-0 items-center gap-3">
|
||||
<UploadButton />
|
||||
{homeCreationType === 'game' ? (
|
||||
<label className="inline-flex cursor-pointer items-center gap-1.5 whitespace-nowrap">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={planningCompletionEnabled}
|
||||
onChange={(event) =>
|
||||
setPlanningCompletionEnabled(event.target.checked)
|
||||
}
|
||||
disabled={homeCreationBusy || creationBusy}
|
||||
/>
|
||||
<span>策划补全</span>
|
||||
</label>
|
||||
) : null}
|
||||
</div>
|
||||
<div className="flex shrink-0 items-center gap-1.5">
|
||||
<ConversationModelSelect
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { resolveHomeStartMode } from '../src/view/home/homeStartMode';
|
||||
|
||||
describe('AGC 首页启动模式', () => {
|
||||
it('做游戏勾选策划补全时进入策划 runtime', () => {
|
||||
expect(resolveHomeStartMode('game', true)).toBe('planning');
|
||||
});
|
||||
|
||||
it('做游戏未勾选策划补全时保持直接创作', () => {
|
||||
expect(resolveHomeStartMode('game', false)).toBe('direct-build');
|
||||
});
|
||||
|
||||
it('做方案始终进入策划 runtime,其他入口不受影响', () => {
|
||||
expect(resolveHomeStartMode('doc', false)).toBe('planning');
|
||||
expect(resolveHomeStartMode('art', true)).toBe('direct-build');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,16 @@
|
||||
Version: 1
|
||||
Status: active
|
||||
Date: 2026-09-15
|
||||
Parent Spec: 【里程碑】AGC首页策划补全入口-2026-09-15.md
|
||||
|
||||
## 修改顺序
|
||||
|
||||
1. 在 `view/home/index.tsx` 增加本地复选框状态与入口切换清理。
|
||||
2. 将游戏勾选状态映射到既有 `ProjectStartMode`。
|
||||
3. 增加首页组件测试覆盖模式分流和显示边界。
|
||||
|
||||
## 验证
|
||||
|
||||
- AGC 首页相关定向测试。
|
||||
- AGC 前端 typecheck。
|
||||
- `npm run check:encoding` 与 `git diff --check`。
|
||||
@@ -0,0 +1,20 @@
|
||||
Version: 1
|
||||
Status: active
|
||||
Date: 2026-09-15
|
||||
Parent Spec: AGC 首页与 Agent Runtime 入口
|
||||
|
||||
## 范围
|
||||
|
||||
在首页“做游戏”输入框下增加“策划补全”复选框;勾选后复用现有 `planning` 启动模式进入策划 Agent Runtime。
|
||||
|
||||
## 验收标准
|
||||
|
||||
- 仅“做游戏”显示复选框。
|
||||
- 勾选时提交 `planning`,未勾选时提交 `direct-build`。
|
||||
- “做方案”原有 `planning` 行为保持不变。
|
||||
- 切换到其它创作类型时清除游戏专属勾选状态。
|
||||
|
||||
## 不做项
|
||||
|
||||
- 不新增 runtime 类型、后端接口或持久化字段。
|
||||
- 不改变现有策划 runtime 内部流程。
|
||||
Reference in New Issue
Block a user