Skip to content

fix(chat): contain activity response previews - #26

Merged
chryzxc merged 1 commit into
mainfrom
fix/issue-21-activity-step-overflow
Aug 4, 2026
Merged

fix(chat): contain activity response previews#26
chryzxc merged 1 commit into
mainfrom
fix/issue-21-activity-step-overflow

Conversation

@chryzxc

@chryzxc chryzxc commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • constrain response cards and previews to their activity-card width
  • keep the full-response affordance inside the bounded preview
  • add a regression test for the containment contract

Verification

  • TAP version 13

Subtest: chat source css keeps active Tailwind directives

ok 1 - chat source css keeps active Tailwind directives

duration_ms: 1.197125
...

Subtest: chat css pipeline keeps Tailwind enabled for utility-heavy React chat components

ok 2 - chat css pipeline keeps Tailwind enabled for utility-heavy React chat components

duration_ms: 0.2705
...

Subtest: details tabs use one shared content gutter with an overview reset

ok 3 - details tabs use one shared content gutter with an overview reset

duration_ms: 0.293167
...

Subtest: Active Task is a peer overview section instead of a parent heading

ok 4 - Active Task is a peer overview section instead of a parent heading

duration_ms: 0.281084
...

Subtest: overview section headers use labels and chevrons without decorative dots

ok 5 - overview section headers use labels and chevrons without decorative dots

duration_ms: 0.462542
...

Subtest: active checklist progress marker uses the themed status indicator

ok 6 - active checklist progress marker uses the themed status indicator

duration_ms: 2.357333
...

Subtest: active compaction uses the shared card border token

ok 7 - active compaction uses the shared card border token

duration_ms: 0.607208
...

Subtest: activity path tooltips use an owned opaque surface

ok 8 - activity path tooltips use an owned opaque surface

duration_ms: 0.635375
...

Subtest: response previews stay contained inside activity cards

ok 9 - response previews stay contained inside activity cards

duration_ms: 0.868833
...

Subtest: markdown-body ordered lists must display with decimal numbers (not bullets)

ok 10 - markdown-body ordered lists must display with decimal numbers (not bullets)

duration_ms: 0.242708
...

Subtest: markdown-body unordered lists must display with disc bullets

ok 11 - markdown-body unordered lists must display with disc bullets

duration_ms: 0.16625
...

Subtest: markdown-body lists must have separate rules for ul and ol (not combined)

ok 12 - markdown-body lists must have separate rules for ul and ol (not combined)

duration_ms: 0.33725
...

Subtest: markdown-body code blocks must include a visible copy button affordance

ok 13 - markdown-body code blocks must include a visible copy button affordance

duration_ms: 0.259708
...
1..13

tests 13

suites 0

pass 13

fail 0

cancelled 0

skipped 0

todo 0

duration_ms 78.770292

opencode-vscode-chryzxc@0.3.8 guard:streaming
node scripts/streaming-contract-check.mjs

opencode-vscode-chryzxc@0.3.8 webview:build
npm --prefix webview/shared run build

opencode-webview@0.0.1 build
vite build && node ../../scripts/merge-css.mjs

vite v5.4.21 building for production...
transforming...
✓ 1534 modules transformed.
rendering chunks...
computing gzip size...
dist/ThemeFileIcon.css 2.18 kB │ gzip: 0.80 kB
dist/chat.css 271.00 kB │ gzip: 45.69 kB
dist/walkthrough.js 2.39 kB │ gzip: 0.88 kB
dist/textarea.js 12.55 kB │ gzip: 3.53 kB
dist/plan.js 36.02 kB │ gzip: 7.69 kB
dist/chat.js 1,613.95 kB │ gzip: 290.97 kB
dist/ThemeFileIcon.js 1,866.17 kB │ gzip: 476.06 kB
✓ built in 3.40s
Merged 2 CSS files into chat.css

opencode-vscode-chryzxc@0.3.8 typecheck
tsc --noEmit

Closes #21

Summary by CodeRabbit

  • Bug Fixes
    • Prevented response previews from overflowing their activity cards.
    • Improved layout behavior for long response content in flexible layouts.
    • Constrained preview height and hid excess content for a cleaner chat experience.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The chat response layout now constrains response width and hides overflow. A regression test verifies clipped activity-card content and bounded response previews.

Changes

Chat response bounds

Layer / File(s) Summary
Constrain response card layout
webview/shared/src/chat/MessageComponents.tsx
Response sections and content wrappers now use width constraints. Response sections also hide overflowing content.
Validate bounded previews
tests/regression/chat-css-regression.test.mjs
The regression test loads MessageComponents.tsx and checks overflow clipping and bounded preview height.

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

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: containing activity response previews.
Linked Issues check ✅ Passed The changes address issue #21 by constraining response content and adding a regression test for bounded previews and visible controls.
Out of Scope Changes check ✅ Passed The code and test changes directly support the linked issue and stated objectives; no unrelated changes are identified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-21-activity-step-overflow

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/regression/chat-css-regression.test.mjs (1)

143-155: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Add a runtime regression for the preview toggle.

These assertions inspect source text only. They do not render an overflowing response or exercise the Show full response to Show less transition. Add a focused DOM or component test. Assert that Show less remains available after expansion.

As per coding guidelines, tests must maintain regression and contract coverage for behavior changes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/regression/chat-css-regression.test.mjs` around lines 143 - 155, Add a
focused runtime DOM or component test alongside the existing source assertions
that renders an overflowing response preview, activates the “Show full response”
control, and verifies the “Show less” control remains available after expansion.
Keep the current source-text assertions and target the existing preview toggle
behavior rather than changing production code.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@webview/shared/src/chat/MessageComponents.tsx`:
- Around line 12753-12755: Update the response preview overflow handling near
shouldConstrainResponsePreview so expanding via “Show full response” does not
clear hasResponseOverflow. Preserve the measured overflow state, or measure it
independently against the collapsed max-h-32 constraint, so the “Show less”
control in the response toggle remains available.

---

Nitpick comments:
In `@tests/regression/chat-css-regression.test.mjs`:
- Around line 143-155: Add a focused runtime DOM or component test alongside the
existing source assertions that renders an overflowing response preview,
activates the “Show full response” control, and verifies the “Show less” control
remains available after expansion. Keep the current source-text assertions and
target the existing preview toggle behavior rather than changing production
code.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: dbefb350-7020-4bfe-af9b-7ded93bbc966

📥 Commits

Reviewing files that changed from the base of the PR and between cccdecd and 0170b9c.

📒 Files selected for processing (2)
  • tests/regression/chat-css-regression.test.mjs
  • webview/shared/src/chat/MessageComponents.tsx

Comment on lines +12753 to 12755
"relative min-w-0 max-w-full mt-1.5 space-y-1.5",
shouldConstrainResponsePreview && "max-h-32 overflow-hidden",
)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep the overflow state when the response expands.

When the response exceeds max-h-32, hasResponseOverflow becomes true. After the user clicks Show full response, the effect at Lines 11724-11742 clears this state. The Show less control at Lines 12776-12789 then disappears.

Retain the measured state while expanded, or measure overflow against the collapsed height independently.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@webview/shared/src/chat/MessageComponents.tsx` around lines 12753 - 12755,
Update the response preview overflow handling near
shouldConstrainResponsePreview so expanding via “Show full response” does not
clear hasResponseOverflow. Preserve the measured overflow state, or measure it
independently against the collapsed max-h-32 constraint, so the “Show less”
control in the response toggle remains available.

@chryzxc
chryzxc merged commit 2cf4be8 into main Aug 4, 2026
2 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.

Activity step content overflows parent container and clips full response control

1 participant