Skip to content

feat(ui): visualize trace composition by color - #3610

Merged
Astro-Han merged 5 commits into
apache:mainfrom
Astro-Han:feat/trace-composition-colors
Aug 23, 2026
Merged

feat(ui): visualize trace composition by color#3610
Astro-Han merged 5 commits into
apache:mainfrom
Astro-Han:feat/trace-composition-colors

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove the trace record file path from the session inspector
  • visualize estimated request composition with a proportional color bar and matching legend
  • keep the tool-definition breakdown aligned with the new composition model
image

Verification

  • npm --workspace @maka/desktop run build:workspace-deps
  • npm --workspace @maka/desktop run build:renderer
  • npm --workspace @maka/desktop run typecheck
  • npm --workspace @maka/desktop run build:main
  • focused desktop tests: 19 passed
  • Biome lint: 9 changed TypeScript/TSX files passed
  • git diff --check
  • Storybook: product-session-workbar--trace, dark mode, Chinese locale

The repository's Biome formatter configuration excludes apps/desktop, so no formatter target applies to these files.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

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

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

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
@Astro-Han
Astro-Han marked this pull request as ready for review August 23, 2026 13:31
@Astro-Han Astro-Han changed the title feat(ui): visualize trace composition by color feat(ui): 追踪构成可视化 Aug 23, 2026
@Astro-Han Astro-Han changed the title feat(ui): 追踪构成可视化 feat(ui): visualize trace composition by color Aug 23, 2026

@M4n5ter M4n5ter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/dark color-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 main retains 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.operationalStateDatabasePathapps/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
@Astro-Han
Astro-Han force-pushed the feat/trace-composition-colors branch from 4bf3888 to 9df4afe Compare August 23, 2026 14:00
@Astro-Han
Astro-Han merged commit eb25992 into apache:main Aug 23, 2026
1 check passed
@Astro-Han
Astro-Han deleted the feat/trace-composition-colors branch August 23, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants