6981648796
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m56s
Project CI / Backend tests (pull_request) Failing after 12s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 3m48s
Project CI / Native shell tests (pull_request) Failing after 45s
Project CI / Repository checks (pull_request) Failing after 13s
Project CI / Frontend tests (pull_request) Failing after 1m52s
Project CI / AI game creator shell web tests (pull_request) Failing after 1m42s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 6m57s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 8m1s
- 解决 refactor/split-direct-project 与 origin/master 在 App.tsx、立项策划聊天视图、Direct composer/引用输入区、styles.css、Rust direct user item 与 appSurface 用例上的冲突,按「Supervisor 永久退役」口径保留 DirectProject 独立聊天容器与 Design Agent 两条产品路径 - 采纳 master 的策划 Agent V1/V2 退役:删除 GDD 审批卡、策划输入卡、planningLane、planningSessionV2、planningSessionContract、规划展示适配与 Rust planning_*_v2 命令、模块、契约及对应用例,不保留兼容别名或双跑路径 - 把 master「折叠思考显示单行预览」的目的落到当前结构:新增共享表现 chat/components/AgentReasoning/AgentReasoning.tsx(折叠态单行纯文本预览 + 箭头、展开态安全 Markdown),DirectProject 回合与策划回合共用,删掉两处写死的 pre 折叠实现 - 把 master「策划入口可选模型 / 推理档」的目的接到当前策划输入盒:复用 ConversationModelSelect 与 ComposerReasoningEffortSelect,配置写回仍走客户端配置通道 - App.tsx 删除只服务退役 Supervisor / 策划 V2 的 state、ref、effect、回调与死参数,并删除两条读路径都退役后的 workspaceProjectKind;openWorkspace 的工程类型入参保留为未使用契约 - Rust 侧保留本分支 canonical→wire 投影、无审计 Direct 回合与 direct user item 严格校验,并入 master 的 prepare_new_web_project_at 前置复核 - 更新 ADR 与 shared-memory 决策记录:策划当前只有 Design Agent、两条路径的共享表现清单,以及本次合并的口径、代价与验证证据 - 验证:AGC 与仓库 typecheck、check:encoding、check:doc-index、git diff --check、改动文件 eslint 0 error;AGC vitest 168 个文件中除 5 个 jsdom localStorage 环境失败文件与本分支既有 resourceTagStatsRefresh 失败外全绿,appSurface 198 passed / 13 skipped;Rust 定向用例 direct_codex_user_item、skill_pack、sessions 全过(整套分片在本容器受 /sbin -> usr/bin 触发沙箱预检失败,与本合并无关)
104 lines
3.6 KiB
TypeScript
104 lines
3.6 KiB
TypeScript
// @vitest-environment jsdom
|
|
import { readFileSync } from 'node:fs';
|
|
|
|
import { render } from '@testing-library/react';
|
|
import { describe, expect, it } from 'vitest';
|
|
|
|
import { AgentMessageContent } from '../../../packages/shared/src/components/AgentMessageContent';
|
|
import { ChatMarkdownMessage } from '../src/components/ChatMarkdownMessage';
|
|
import { repoPath } from './repoPath';
|
|
import {
|
|
declaration,
|
|
parseStyleSheet,
|
|
resolveDeclarations,
|
|
} from './styleCascade';
|
|
|
|
const sharedCss = readFileSync(
|
|
repoPath('packages/shared/src/components/AgentMessageContent.css'),
|
|
'utf8',
|
|
);
|
|
const appCss = readFileSync(
|
|
repoPath('apps/ai-game-creator-shell/src/styles.css'),
|
|
'utf8',
|
|
);
|
|
const base = '.agent-message-content[data-agent-content]';
|
|
const processTone = ".agent-message-content[data-agent-content='process']";
|
|
|
|
describe('AgentMessageContent', () => {
|
|
it('正文与过程复用表现组件,保留折叠语义和宿主属性', () => {
|
|
const { container } = render(
|
|
<>
|
|
<AgentMessageContent>最终回复</AgentMessageContent>
|
|
<AgentMessageContent as="details" tone="process" aria-label="思考过程">
|
|
<summary>思考过程</summary>
|
|
<pre>先分析需求</pre>
|
|
</AgentMessageContent>
|
|
</>,
|
|
);
|
|
expect(
|
|
container.querySelector('[data-agent-content="body"]')?.textContent,
|
|
).toBe('最终回复');
|
|
const details = container.querySelector('details')!;
|
|
expect(details.getAttribute('data-agent-content')).toBe('process');
|
|
expect(details.getAttribute('aria-label')).toBe('思考过程');
|
|
expect(details.open).toBe(false);
|
|
});
|
|
|
|
it('过程的标题和表格继承层级变量,不用强制字号压回正文大小', () => {
|
|
const { container } = render(
|
|
<AgentMessageContent tone="process">
|
|
<ChatMarkdownMessage
|
|
role="assistant"
|
|
text={
|
|
'# 分析\n\n| 项目 |\n| --- |\n| 内容 |\n\n```js\nconst value = 1;\n```'
|
|
}
|
|
/>
|
|
</AgentMessageContent>,
|
|
);
|
|
expect(container.querySelector('h1')).not.toBeNull();
|
|
expect(container.querySelector('table')).not.toBeNull();
|
|
expect(container.querySelector('pre code .hljs-keyword')).not.toBeNull();
|
|
});
|
|
|
|
it.each([sharedCss + appCss, appCss + sharedCss])(
|
|
'共享层级不受宿主 CSS 加载顺序影响',
|
|
(css) => {
|
|
const rules = parseStyleSheet(css);
|
|
const body = resolveDeclarations(rules, [base], 1024);
|
|
expect(declaration(body, 'font-size')).toBe('14px');
|
|
expect(declaration(body, 'color')).toContain('--platform-text-strong');
|
|
for (const host of [
|
|
['.design-agent-reasoning'],
|
|
['.agent-tool-call-group'],
|
|
[
|
|
'.project-chat-process-card',
|
|
'.game-workbench-chat .project-chat-process-card',
|
|
'.game-workbench-chat .project-chat-surface.is-direct-codex .project-chat-conversation > .project-chat-process-card',
|
|
],
|
|
]) {
|
|
const process = resolveDeclarations(
|
|
rules,
|
|
[base, processTone, ...host],
|
|
1024,
|
|
);
|
|
expect(declaration(process, 'font-size')).toBe('12px');
|
|
expect(declaration(process, 'color')).toContain('--platform-text-soft');
|
|
expect(declaration(process, '--agent-message-heading-size')).toBe(
|
|
'1em',
|
|
);
|
|
}
|
|
const failure = resolveDeclarations(
|
|
rules,
|
|
[
|
|
'.agent-tool-call-row-status',
|
|
".agent-tool-call-group-row[data-status='failed'] .agent-tool-call-row-status",
|
|
],
|
|
1024,
|
|
);
|
|
expect(declaration(failure, 'color')).toBe(
|
|
'var(--platform-button-danger-text)',
|
|
);
|
|
},
|
|
);
|
|
});
|