bfc7eaa794
Project CI / AI game creator shell Rust shard 1/4 (push) Successful in 5m14s
Project CI / AI game creator shell Rust shard 3/4 (push) Successful in 5m28s
Project CI / AI game creator shell Rust shard 4/4 (push) Successful in 5m44s
Project CI / AI game creator shell Rust shard 2/4 (push) Successful in 5m53s
Project CI / AI game creator shell Rust smoke (push) Successful in 1m35s
Project CI / AI game creator shell Rust crates (push) Successful in 1m38s
Project CI / Frontend tests (push) Failing after 3m53s
Project CI / Repository checks (push) Failing after 4m11s
Project CI / Native shell tests (push) Successful in 6m4s
Project CI / Backend tests (push) Successful in 6m38s
Project CI / AI game creator shell web tests (push) Failing after 2m50s
修复 AGC 的 Rust 编译、资源预览及工具调用时间戳问题,并包含当前分支已有的 Rust shard 4 修复。 变更: - 补齐 Direct 回合事件测试构造中的 reasoning_text、stream_items 字段。 - JSON/JSONC 不再按代码扩展名匹配,JSON 规格恢复文档预览。 - 工具条分隔线测试对齐当前动作组条件,去掉旧 CSS 与变量名断言。 - 实时事件与历史回读的工具调用时间戳在模型入口归一化为毫秒,界面仍显示秒/分钟。 - 防止失效的精灵切片绕过校验重新进入通用资源路径;同步混合历史记录的失败关闭测试契约。 验证: - 资源预览契约、真实 manifest、工具条测试:12 项通过。 - Direct 回合呈现测试:15 项通过。 - Rust direct_turn_update_payload_is_the_exact_camel_case_contract 通过,test target 编译成功。 - git diff --check 及提交钩子 ESLint、Prettier、Rustfmt 通过。 未运行完整 CI 或完整 appSurface 套件;其余对话区结构/文案断言未在此 PR 中批量调整。rehype-highlight 已在 master 的 package.json 与 lockfile 中声明,本 PR 未重复添加依赖。 Reviewed-on: #380 Co-authored-by: Linghong <ink29535@proton.me> Co-committed-by: Linghong <ink29535@proton.me>
38 lines
1.5 KiB
TypeScript
38 lines
1.5 KiB
TypeScript
import { readFileSync } from 'node:fs';
|
||
|
||
import { describe, expect, it } from 'vitest';
|
||
|
||
/**
|
||
* 选中资源工具条上的分隔线分组回归钉子。
|
||
*
|
||
* 成因:共享工具条 `ImageCanvasSelectedLayerToolbarView.tsx` 会在 `showQuickEdit` 时于
|
||
* 「快速编辑」之后输出一条分隔线,同时为 `extraActions` 自动生成一条前置分隔线
|
||
* (`const extraActionDivider = extraActions ? … : null`)。AGC 资源卡是"快速编辑可用 +
|
||
* 中间那些动作未接通不渲染"的组合,两条于是直接相邻,用户看到两条竖线。
|
||
*
|
||
* 当前实现直接按动作组是否存在输出分隔线,避免相邻分隔线产生。这条用例钉住当前
|
||
* 条件分组,避免后续重构时再次出现空动作组之间的重复分隔线。
|
||
*/
|
||
describe('选中资源工具条的分隔线去重', () => {
|
||
const sharedToolbarSource = () =>
|
||
readFileSync(
|
||
new URL(
|
||
'../../../src/components/image-editor/ImageCanvasSelectedLayerToolbarView.tsx',
|
||
import.meta.url,
|
||
),
|
||
'utf8',
|
||
);
|
||
|
||
it('分隔线由动作组条件控制,不依赖相邻分隔线的 CSS 去重', () => {
|
||
const source = sharedToolbarSource();
|
||
expect(source).toContain('const showQuickEdit = isActionSupported(');
|
||
expect(source).toContain('const hasEditingActions =');
|
||
expect(source).toContain(
|
||
'{showQuickEdit && hasEditingActions ? divider : null}',
|
||
);
|
||
expect(source).toContain(
|
||
'{(showQuickEdit || hasEditingActions || canRedraw || hasExtraActions) &&',
|
||
);
|
||
});
|
||
});
|