feat(coding): add project identity UX

This commit is contained in:
2026-08-26 18:48:22 +08:00
parent 5ac08d509f
commit ce8e2103d9
10 changed files with 683 additions and 0 deletions

View File

@@ -106,6 +106,31 @@ describe('coding workspace store', () => {
expect(createConversation).not.toHaveBeenCalled();
});
it('passes the explicit identity choice through project creation', async () => {
const createProject = vi.fn(async () => ({
project,
config: config([agent('agent-a')]),
knowledgeFiles: [],
}));
const store = createCodingWorkspaceStore({
listProjects: vi.fn(async () => ({ projects: [project], activeProjectId: project.id })),
getConfig: vi.fn(async () => ({ project, config: config([agent('agent-a')]) })),
listConversations: vi.fn(async () => []),
createProject,
});
await expect(store.getState().createProject({
projectPath: 'C:/projects/new',
projectType: 'custom',
identity: { kind: 'bind', projectId: 'aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa' },
})).resolves.toEqual(project);
expect(createProject).toHaveBeenCalledWith({
projectPath: 'C:/projects/new',
projectType: 'custom',
identity: { kind: 'bind', projectId: 'aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa' },
});
});
it('creates a missing first Conversation once for concurrent callers', async () => {
let resolveCreate!: (value: CodingConversationMetadata) => void;
const createFlight = new Promise<CodingConversationMetadata>((resolve) => {