feat(ui): fold reasoning into the trow block and refine turn presentation#948
Conversation
|
Warning Review limit reached
More reviews will be available in 24 minutes and 45 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (40)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request refactors the rendering of reasoning parts to reuse the collapsible BasicTool shell, allowing them to fold into trow blocks as peer rows. It updates the typography of the reasoning body to use a sans-serif font family and quieter text color, updates several tool icons (e.g., changing glasses to read-file and code-lines to edit), and removes unused code such as the TextReveal component and interrupted state handling. Corresponding tests and snapshot tests have been updated to reflect these changes. I have no feedback to provide as there are no review comments.
Add three dedicated icons (thinking, skill, read-file) traced to the 20×20 viewBox at a fill consistent with the existing set, and point the tool families at them: read→read-file, edit/write/apply_patch→edit, skill→skill (previously glasses / code-lines / brain). Update the trow-block leading-icon map and its reducer assertions in lock-step.
574a3d1 to
e6bdd72
Compare
Perf delta summaryComparator: pass
|
Reasoning parts now collapse into the same trow-block summary row as tool calls instead of rendering their own standalone thinking collapsible. The trow reducer treats reasoning as a trow part (toolCount excludes it, leading icon falls back to `thinking`), and the reasoning renderer reuses `BasicTool` so a folded reasoning row no longer paints its own duplicate icon. Drop the now-dead thinking-heading derivation (`heading`/`clean`, `reasoningHeading`, the `TextReveal` summary) and its CSS rule.
An interrupted assistant turn drew a duplicate "interrupted" divider at the top of the turn and forced its footer toolbar to the right edge. Drop the turn-level `interrupted` divider branch and the `data-interrupted` footer flag (plus its right-aligning CSS rule) so the toolbar stays left-aligned like every other turn; the "interrupted" notice still shows in the footer meta line.
e6bdd72 to
a226328
Compare
Folding reasoning into the trow-block made the "show reasoning summaries" toggle a no-op: renderable() now always renders a reasoning part as a collapsible row regardless of the flag. Remove the whole dead chain — the General settings toggle and its i18n copy, the persisted showReasoningSummaries field plus accessor, and the prop threaded through message-timeline → SessionTurn → AssistantParts / AssistantMessageDisplay → renderable().
groupParts() folds reasoning into the trow group, but AssistantMessageDisplay's trow branch only kept tool parts and never passed renderReasoning — so a reasoning-only or reasoning+tool message silently dropped its reasoning. Align it with AssistantParts: accept reasoning in the trow filter and render it through renderReasoning. Pin the shared grouping behavior in grouping.test.ts: reasoning folds into a trow, groups with adjacent tools in one trow, and empty reasoning is filtered.
Tool icons were defined in three places — toolFamilyIcon (trow leading icon),
toolInfoForInput (expanded tool header), and hard-coded strings in each tool
component — and had already drifted: read/edit/write/apply_patch/skill showed a
different icon in the trow leading row than in the expanded tool-info header.
Add toolIcon() in tool-info.ts as the single source of truth. toolFamilyIcon
delegates to it, toolInfoForInput returns it, and all 16 tool components pass
toolIcon("…") to BasicTool instead of hard-coding an icon name. Icon values are
unchanged, so rendering is identical. A reducer test pins toolFamilyIcon and the
tool-info icon in lock-step so the collapsed and expanded views cannot diverge
again.
Bump PawWork desktop release version to 2026.5.28. Changes since v2026.5.27: - feat(ui): fold reasoning into trow block (#948) - feat: align outbound HTTP headers with canonical OpenCode desktop (#940) - feat(app): collapse notification settings to single tri-state control (#938) - fix(ui): track List header surface via --list-surface (#954) - fix(ui): render tooltip shortcut hints as plain sans glyphs (#955) - fix(watcher): isolate macOS workspace roots - fix(session): terminalize stale question blockers - fix(session): unify transport error classification for stream disconnect recovery (#941) - test: add route inventory guardrails - ci: repair electron desktop build + install
Summary
Reworks how an assistant turn is presented in the conversation flow, in six atomic commits (commits 5–6 added in response to code review):
thinking,skill, andread-fileicons and remaps the tool-family icon table so each trow-block leading icon matches its tool. Thethinkingglyph is resized to fill the same icon box as its neighbours.BasicTool) instead of rendering its own standalone thinking collapsible. A folded reasoning row no longer paints a duplicate icon, and the dead thinking-heading derivation (heading/clean/reasoningHeading/TextReveal) is removed.renderable()ignores the flag). The toggle, its i18n copy, the persistedshowReasoningSummariesfield plus accessor, and the whole prop chain (message-timeline → SessionTurn → AssistantParts / AssistantMessageDisplay →renderable()) are removed.AssistantMessageDisplay(review P2) —groupParts()folds reasoning into the trow group, but this second turn renderer's trow branch kept only tool parts and never passedrenderReasoning, so a reasoning-only or reasoning+tool message silently dropped its reasoning on that path. It now mirrorsAssistantParts: the trow filter accepts reasoning and renders it viarenderReasoning. Newgrouping.test.tscases pin the shared folding (reasoning folds into a trow, groups with adjacent tools, empty reasoning filtered).toolFamilyIcon,toolInfoForInput, and hard-coded strings in each tool component) and had already drifted for read/edit/write/apply_patch/skill. A newtoolIcon()intool-info.tsis the single source of truth;toolFamilyIcondelegates to it,toolInfoForInputreturns it, and all 16 tool components passtoolIcon("…")toBasicTool. Icon values are unchanged, so rendering is identical; a reducer test pins the collapsed (trow) and expanded (tool-info) icons in lock-step so they cannot diverge again.Why
Reasoning used to render as its own collapsible, which showed two stacked icons in the collapse bar when folded and duplicated the tool-call fold pattern with a parallel component. Folding reasoning into the existing trow-block removes the duplicate icon and the second code path. Separately, an interrupted turn drew a redundant top divider and right-shifted its footer toolbar, breaking alignment with normal turns. Finally, the fold made the "show reasoning summaries" setting meaningless — reasoning is always a collapsible row now — so the dead setting and its prop chain are cleaned up rather than left as confusing dead UI. Code review then surfaced two follow-ups, fixed in commits 5–6: a second turn renderer (
AssistantMessageDisplay) was never updated when reasoning began folding into the trow, dropping reasoning on that path; and the tool icon was defined in three drifting places, so it is consolidated into onetoolIcon()source.Related Issue
None — scope and rationale are stated in Summary. Confirmed distinct from #943, which concerns a reasoning-attached retry notice, not the fold/layout presentation.
Human Review Status
PendingReview Focus
reduceTrowBlock/toolFamilyIconinsession-turn-trow-block.tsx: reasoning is excluded fromtoolCount, and a reasoning-only block falls back to thethinkingleading icon.reasoning.tsxnow renders throughBasicTool— confirm a folded reasoning row shows exactly one icon.session-turn.tsxinterrupted-divider removal: confirm the footer meta still surfaces the "interrupted" notice after dropping the top divider anddata-interruptedflag.showReasoningSummarieschain: confirmrenderable()already ignored the flag (so reasoning renders unconditionally) and that nothing else read it before deletion.AssistantMessageDisplaytrow branch (commit 5): confirm it now accepts reasoning and passesrenderReasoning, matchingAssistantParts, so the second renderer no longer drops reasoning.toolIcon()intool-info.ts(commit 6): confirm it is the only place an icon name is chosen per tool, thattoolFamilyIcon/toolInfoForInput/ all tool components route through it, and that the lock-step reducer test would catch any future divergence.Risk Notes
Presentation-only changes; no data, persistence schema, or API surface touched. The removed setting (
showReasoningSummaries) was already a no-op after commit 2 — any value still in a user's persisted store is simply ignored on load (thewithFallbackaccessor is gone), so no migration is needed. Commit 6 is a pure refactor: every tool's icon value is unchanged (the 16 components andtoolFamilyIconnow resolve the same icon throughtoolIcon()), so rendering is identical and snapshots need no regeneration.Skipped conditional checklist item:
How To Verify
Screenshots or Recordings
Visual states are covered by the
session-trowsnapshot grid, regenerated in this change atdocs/design/preview/screenshots/session-trow.png(viabun run snap session-trow), including the reasoning-only and reasoning-with-tools rows in collapsed and expanded form. The snapshot is a repo artifact and is not inlined here because the body cannot embed local files. The removed General setting is a one-row deletion in Settings → General with no dedicated snapshot.Checklist
bug,enhancement,task,documentation. Type labels are author-added; the labeler bot does NOT assign them. Add the label in the GitHub UI, then tick this.app,ui,platform,harness,ci. The labeler bot assigns these on PR open based on changed paths. Confirm the bot's choice (or override if wrong), then tick this.P0,P1,P2,P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.Pending,Approved by @<reviewer>, orNot required: <reason>(default isPending; "not required" is restricted to bot-authored low-risk PRs).dev, and my PR title and commit messages use Conventional Commits in English.