Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): collapse thoughts within tool groups #12302

Mergedmaria-rcksmerged 2 commits intomain fromrefs/pull/12302/headmerged by juliusmarminge View on GitHub

maria-rckscommented

opening a tool group currently reveals every reasoning trace. thoughts now stay collapsed independently, showing a truncated reasoning preview and a chevron; expanding a thought reveals its full text and restores the thought label. thought-only groups retain their existing single disclosure.

validation: web typecheck and 120 existing timeline tests passed on blacksmith; targeted lint completed with 20 warnings and no errors. verified collapse, expansion, and restored previews in the web client using a real Claude thread through the shared server.

thought preview expands and collapses inside the tool group

model: gpt-6; harness: codex.

Spacing follow-up: collapsed thought headers now match the 24px tool rows, with no extra gaps between thought and tool sections. Verified expansion and collapse in an isolated web client with synthetic transcript data. Web typecheck and 173 focused timeline tests pass; targeted lint has warnings and no errors.

Before spacing fix:

Before: extra gaps around thought rows

After spacing fix:

After: consistent thought and tool row spacing

Expanded thought:

Expanded thought renders Markdown

Spacing follow-up model: GPT-6; harness: Codex.

Summary by CodeRabbit

  • New Features

    • Added expand/collapse controls for reasoning details within activity groups.
    • Collapsed reasoning sections now show a preview of the first visible message.
    • Expansion state is preserved when activity rows are recycled.
  • Style

    • Updated spacing and header styling for expanded reasoning details.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. Correction to the inline review suggestion: the opening and closing tag edits belong to the same hunk; the intervening child markup should remain unchanged.

      Posted via Macroscope — UI Consistency
    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This focused web UI change introduces independent collapse controls and previews for reasoning traces, changing the default visibility of thoughts when a tool group is opened. The implementation is isolated, but the changed product default warrants human review.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review Change StackReview Change Stack

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: Path: .coderabbit.yaml

      Review profile: CHILL

      Plan: Advanced

      Run ID: c0609b21-0ef7-4aaf-85d3-a7b6a75fc43c

      📥 Commits

      Reviewing files that changed from the base of the PR and between a2957cc1fa34b465e29e6d08274b7875e2d7719f and fbe895baa3f1615e1cec1f7ca6b1da55d9e2a093.

      📒 Files selected for processing (1)
      • apps/web/src/components/chat/MessagesTimeline.tsx
      🚧 Files skipped from review as they are similar to previous changes (1)
      • apps/web/src/components/chat/MessagesTimeline.tsx

      Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


      📝 Walkthrough

      Walkthrough

      The chat timeline adds expand/collapse behavior to reasoning traces. Collapsed traces show the first non-empty message as a preview. The disclosure state uses the activity row ID as its anchor.

      Changes

      Reasoning trace disclosure

      Layer / File(s)Summary
      Reasoning trace toggle and row anchoring
      apps/web/src/components/chat/MessagesTimeline.tsx
      ActivityGroupTimelineRow passes row.id as anchorKey. ReasoningTraceBlock reads and updates expanded state through the chat context. Its header toggles message visibility, shows a rotating chevron, displays a preview when collapsed, and adjusts the expanded details spacing.

      Priority: ⬇️ Low

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Sequence Diagram(s)

      sequenceDiagram
        participant User
        participant ReasoningTraceBlock
        participant ChatTimelineContext
        User->>ReasoningTraceBlock: Click reasoning trace header
        ReasoningTraceBlock->>ChatTimelineContext: Toggle message state with anchorKey
        ChatTimelineContext-->>ReasoningTraceBlock: Return updated expanded state
        ReasoningTraceBlock-->>User: Render messages or preview

      Merge Risk: ⚪ Minimal · up to fbe89

      The disclosure behavior preserves independent collapsed reasoning traces without an identified merge-blocking risk.

      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Title check✅ PassedThe title clearly and concisely describes the main change: collapsing thought traces within tool groups.
      Description check✅ PassedThe description explains the behavior change, the reason for it, UI interaction details, validation results, and includes screenshots and a video for the interaction change. It does not use the templa…
      • Fix all pre-merge checks with AI
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR

      Comment `@coderabbitai help` to get the list of available commands.
    5. juliusmarminge merged this592021f

    6. juliusmarminge closed this

Sign in to join this conversation.