Skip to content

refactor(ui): share chat rendering across GUI and WebUI - #419

Merged
yyg-max merged 2 commits into
mainfrom
refactor/share-chat-rendering
Aug 10, 2026
Merged

refactor(ui): share chat rendering across GUI and WebUI#419
yyg-max merged 2 commits into
mainfrom
refactor/share-chat-rendering

Conversation

@su-fen

@su-fen su-fen commented Aug 10, 2026

Copy link
Copy Markdown
Member

Linked issue

Closes #418

Summary

  • 将 GUI/WebUI 重复的 AssistantBubble、RoundContent、工具轨迹、工具结果、文件拖放 Overlay、Workspace Overlay、Skill Hook 与排队内容判断迁移到 crates/agent-ui
  • 保留 GUI 的细粒度虚拟化渲染壳;WebUI 直接使用共享完整 AssistantBubble。
  • 通过宿主 adapter 保留两端既有平台策略:工具审批、AskUserQuestion、图片延迟加载、运行中折叠内容以及 Workspace Overlay 标题栏与堆叠层级。
  • 扩展 UI boundary 检查,阻止宿主重新创建或导入已迁移的本地副本。
  • 本次为结构性抽离,不引入用户可见的功能或交互改版。

Change scope

  • Modules: agent-ui / agent-gui / agent-gateway/web
  • Shared chat rendering: crates/agent-ui/src/components/chat/AssistantBubble.tsx, crates/agent-ui/src/components/chat/assistant-bubble/
  • Shared overlays/hooks/helpers: crates/agent-ui/src/components/workspace-editor/WorkspaceOverlayHost.tsx, crates/agent-ui/src/components/chat/FileDropOverlay.tsx, crates/agent-ui/src/lib/
  • Host adapters: crates/agent-gui/src/agent-ui-adapters/assistantBubble.ts, crates/agent-gateway/web/src/agent-ui-adapters/assistantBubble.ts
  • Boundary enforcement: scripts/check-ui-boundaries.mjs

Screenshots / preview

下图由本分支临时 Vite 预览入口直接渲染共享 AssistantBubble,使用合成数据,不包含本地会话或凭据。抽离前后预期视觉一致。

Shared chat rendering preview

Verification

  • pnpm --dir crates/agent-gui test:frontend — 1501 passed
  • pnpm --dir crates/agent-gateway/web test — 540 passed
  • pnpm --dir crates/agent-gui build — passed
  • pnpm --dir crates/agent-gateway/web build — passed
  • pnpm --dir crates/agent-gui exec biome check src/ --diagnostic-level=error --max-diagnostics=50 — passed
  • pnpm --dir crates/agent-gateway/web exec biome check src/ --diagnostic-level=error --max-diagnostics=50 — passed
  • Changed agent-ui source files checked with Biome — passed
  • pnpm check:ui-boundaries — passed
  • node --check scripts/check-ui-boundaries.mjs — passed
  • git diff --check — passed

Pre-submit checklist

  • A requirement issue is linked.
  • Synced with the target branch; no merge conflicts.
  • The change is focused, with no unrelated modifications.
  • No secrets, tokens, or personal data included.
  • No user behavior, deployment, or configuration documentation change is required.

@yyg-max
yyg-max merged commit 7523a2d into main Aug 10, 2026
8 checks passed
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.

[Feature] Share chat rendering across GUI and WebUI

2 participants