Skip to content

(CODUX-123) Refactor InvocationMessageBubble onto shared resolver - #2741

Merged
numnx merged 1 commit into
feature/CODUX-195-rich-widgets-chat-threadsfrom
task/feature-codux-195-rich-widgets-chat-threads-t02-codex-mrcvftjb
Jul 9, 2026
Merged

(CODUX-123) Refactor InvocationMessageBubble onto shared resolver#2741
numnx merged 1 commit into
feature/CODUX-195-rich-widgets-chat-threadsfrom
task/feature-codux-195-rich-widgets-chat-threads-t02-codex-mrcvftjb

Conversation

@numnx

@numnx numnx commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Refactor InvocationMessageBubble onto shared resolver

Automated task PR opened by Code UX for T02.

📋 Summary

Sprint: Sprint 195 · Rich Widgets Chat Threads · Task: T02

Let normal Chat Threads render the same rich runtime widgets (reasoning, tool-call, and planning cards) that the invocation/"3D chat" transcript already renders, by centralizing widget resolution in a shared view-model and consuming it from the threads surface.

🤖 Model & Provider

Provider Codex CLI
Model gpt-5.5

⏱️ Timing

Started 2026-07-09 02:12:11 UTC
Finished 2026-07-09 02:16:03 UTC
Duration 3m 52s

📊 Token Usage

Metric Value
Input tokens 70,424
Cached input tokens 752,640
Output tokens 7,185
Total tokens 830,249
Invocations 1
Tool calls 32
Active time 3m 20s

Included usage estimate (subscription/local login): $0.94

✅ QA Review

⏳ QA review runs after this PR is opened. Check the task card in the dashboard for the outcome once it lands.

📝 Full Task Prompt
## Objective
Refactor `dashboard/src/v2/components/chat/InvocationMessageBubble.tsx` to derive its reasoning/tool/planning widgets from the shared `resolveRichWidget` descriptor instead of duplicating the `metadata.kind` branching, keeping the invocation transcript's visual output identical.

## Scope
- dashboard/src/v2/components/chat/InvocationMessageBubble.tsx
- tests/dashboard/v2/chat-message-bubbles.test.tsx (invocation cases)
- Consumes: `resolveRichWidget` and `RichWidgetDescriptor` from dashboard/src/v2/lib/chat-widget-view-models.ts (T01).

## Implementation Requirements
1. Import `resolveRichWidget` and build the descriptor with `resolveRichWidget({ metadata: message.metadata, content: message.contentMarkdown, toolCallsJson: message.toolCallsJson })`.
2. Replace the current early returns for `kind === "reasoning"` and `kind === "tool_call" || "tool_result"` with switches on the descriptor: `reasoning` → the existing full-width `ReasoningWidget` layout; `tool` → the existing full-width `ToolCallWidget` layout, passing `toolName`/`status`/`args`/`output`/`tokens`/`callId` from the descriptor.
3. Replace the trailing planning `widgetData` slot to read from the shared descriptor's `planning` variant, keeping the same `PlanningRequestWidget` markup and container styles.
4. Preserve all remaining bubble behavior (avatar/role resolution, header chips, provider/model/status/error badges, `sanitizeInvocationOutputText` on the message body, the raw `toolCallsJson` fallback block when `!kind`).

## Constraints
- No visual or DOM-structure changes: the same wrapper classes, `pl-11` widths, and sr-only lines must remain.
- Do not alter `mergeInvocationToolMessages` usage in `ChatPage.tsx`.
- Keep the existing behavior for non-widget assistant/user/tool/system messages unchanged.

## Verification
- Run `pnpm test tests/dashboard/v2/chat-message-bubbles.test.tsx` — invocation reasoning, tool_call/tool_result, error-badge, and planning cases still pass.
- Run `pnpm run typecheck:dashboard` — clean.
- Success looks like: invocation transcript renders reasoning cards, merged tool cards, and planning widgets exactly as before, now sourced from `resolveRichWidget`.
🌿 Branch Info

Base: feature/CODUX-195-rich-widgets-chat-threads
Head: task/feature-codux-195-rich-widgets-chat-threads-t02-codex-mrcvftjb


🤖 Generated by Code UX

@numnx
numnx merged commit 72f6e13 into feature/CODUX-195-rich-widgets-chat-threads Jul 9, 2026
6 checks passed
@numnx
numnx deleted the task/feature-codux-195-rich-widgets-chat-threads-t02-codex-mrcvftjb branch July 9, 2026 02: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.

1 participant