feat(ui): visualize trace composition by color - #3610
Conversation
Remove the operational database path from the trace panel and its now-unused workbar service contract. Add a proportional categorical color strip and matching legend swatches for the latest request composition, with a rendering contract test. Generated-by: Maka
Use the repository-standard ASF header form so the source-header policy recognizes the new test. Generated-by: Maka
Record the inspector's current Astryx component usage after removing the record-file row. Generated-by: Maka
Expose the inspector composition section through the existing testing entry so its render regression test does not deep-import the feature. Generated-by: Maka
There was a problem hiding this comment.
English review
Reviewed and approved at exact head 196412991e00e1e65bf2e1efb5e10c01527b3ec1. No P0-P2 findings.
[P3] Finish deleting the retired record-file bridge field (non-blocking)
The Inspector's only consumer and the Workbar service method are gone, but AppInfo.operationalStateDatabasePath remains in apps/desktop/src/preload/bridge-contract.d.ts:486-487, and main still imports/resolves it in apps/desktop/src/main/app-ipc-main.ts:23,117-122. An exact-symbol search finds no remaining consumer. Unless another supported consumer is intended, please remove this dead bridge field and producer as part of the same capability retirement so the deletion actually collapses the contract.
The behavior and accessibility checks otherwise hold:
- Removing the Inspector's exact record-file display/copy action is explicit. The supported fallback remains Settings → Data → Data location, which shows/copies the workspace root and opens it; the operational database has the fixed filename
runtime.sqlite. - The composition is not color-only: the proportional track is
aria-hidden, while the adjacent definition list exposes every category label and estimated-token value.light-dark()follows the product's explicit light/darkcolor-scheme; forced-color degradation can flatten the decorative chart without hiding the textual data. - The new SSR test is a useful markup contract: it pins all four category keys, their proportional
flex-grow, and the shared chart/legend identity. It is not a palette, theme, or CSS visual-regression test, so I also verified the production renderer build includes the rules. - The clean merge tree against current
mainretains the intervening provider-capacity copy; no main-side behavior is swallowed.
Validation: Desktop workspace dependencies, renderer production build and notice check, four-way Desktop typecheck, main build, 13/13 focused tests, clean merge tree, and the exact-head hosted test check all passed.
中文审查结论
已在 exact head 196412991e00e1e65bf2e1efb5e10c01527b3ec1 完成审查并批准;没有 P0-P2。
[P3] 把已退役的 record-file bridge 字段删完整(不阻塞)
Inspector 的唯一消费者和 Workbar service 方法已经删除,但 apps/desktop/src/preload/bridge-contract.d.ts:486-487 仍保留 AppInfo.operationalStateDatabasePath,apps/desktop/src/main/app-ipc-main.ts:23,117-122 也仍在导入并计算它。精确符号搜索没有发现其他消费者。除非另有受支持的调用方,请在这次能力退役中一并删除这个死 bridge 字段和 producer,让契约真正消失。
其余行为与可访问性检查成立:
- 删除 Inspector 中精确 record-file 路径的显示/复制动作是显式行为变更。受支持的替代路径仍在「设置 → 数据 → 数据位置」:可显示/复制 workspace 根目录并直接打开;数据库固定名为
runtime.sqlite。 - 组成信息不只靠颜色:比例条被标记为
aria-hidden,旁边的定义列表完整给出每个类别名称和估算 token 数。light-dark()会跟随产品明确设置的明暗color-scheme;高对比/forced-colors 即使压平装饰性颜色,也不会丢失文本数据。 - 新增 SSR 测试确实固定了四个类别键、比例
flex-grow和图表/图例共享身份;它不是调色板、主题或 CSS 视觉回归测试,因此我另外验证了生产 renderer 构建实际包含这些规则。 - 与当前
main的 merge tree 干净,期间合入的 provider-capacity 文案完整保留,没有机械吞掉 main 行为。
验证通过:Desktop workspace 依赖构建、renderer 生产构建与 notice 检查、Desktop 四套 typecheck、main 构建、13/13 focused tests、干净 merge tree,以及绑定 exact head 的 hosted test。
Delete the zero-consumer operational state database path from app:info and the preload bridge after the inspector stopped requesting it. Generated-by: Maka
4bf3888 to
9df4afe
Compare
Summary
Verification
npm --workspace @maka/desktop run build:workspace-depsnpm --workspace @maka/desktop run build:renderernpm --workspace @maka/desktop run typechecknpm --workspace @maka/desktop run build:maingit diff --checkproduct-session-workbar--trace, dark mode, Chinese localeThe repository's Biome formatter configuration excludes
apps/desktop, so no formatter target applies to these files.AI use
Select exactly one:
Tool(s) and scope: Maka implemented the UI and tests, ran focused validation, and captured the Storybook screenshot. A human contributor must review the final diff and owns the submission and merge decision.
Checklist
Does this PR entail a change in behavior?