IDE extension: expanding a long user message pushes 'Show less' off-screen with no in-message scroll — can't collapse without scrolling the whole session

Status Open
Maintainer reply None cached
Activity 3 comments · opened Jul 12, 2026

What happened

In the Claude Code VS Code extension chat, expanding a very long user message ("Show more") makes it impossible to collapse the message again without a workaround:

  • The "Show less" control renders below the visible viewport.
  • The message's internal scroll does not work — the expanded message just grows past the viewport.
  • The only way to reach "Show less" is to scroll the entire session to the very bottom until the button re-appears, collapse it there, then scroll back up.

Effectively an expanded long message hijacks navigation until you manually work around it.

Steps to reproduce

  1. Have a chat where a single user message contains a large amount of text (long enough to be truncated behind a "Show more" toggle).
  2. Click Show more to expand that message.
  3. Try to collapse it again.

Expected

The expanded message is scrollable within its own bounds, or the "Show less" control stays reachable (sticky / inside the message container), so the message can be collapsed in place — without scrolling the whole conversation.

Actual

"Show less" is off-screen and there is no in-message scroll; you must scroll to the end of the entire session to find the button, collapse, and scroll back.

Environment

  • Claude Code VS Code extension: anthropic.claude-code v2.1.207 (darwin-arm64)
  • VS Code: 1.128.0 (commit fc3def6774c76082adf699d366f31a557ce5573f, 2026-07-07)
  • Electron: 42.5.0 · Chromium: 148.0.7778.271 · Node.js: 24.17.0
  • OS: macOS (Darwin arm64 25.5.0)

Severity

Usability / Minor–Medium — no data loss, but interaction is blocked until a non-obvious workaround, and it gets worse the longer the message and the session.

View original on GitHub ↗

3 Comments

byungkwonyang-code · 1 month ago

Still reproduces on v2.1.241 (win32-x64, VS Code extension host on Windows 11). Adding the root cause from the shipped webview/index.js, since this one is a two-line fix.

Root cause

Every user message is rendered by the expandable-content component, called with maxHeight: 60 from the user-message renderer:

b(aat, { content: w, context: o, maxHeight: 60 })

and the component itself:

function aat({content:e,context:t,maxHeight:i=250}){
  let n=_e(null),[o,r]=ie(!1),[s,a]=ie(!1),[l,c]=ie(!1);
  se(()=>{if(n.current){let u=n.current.scrollHeight;r(u>i)}},[i,e]);
  let d=()=>{a(!s)};
  ...
  onClick: !s&&o ? d : void 0,                      // click-to-collapse only while COLLAPSED
  ...
  style: !s&&o ? {maxHeight:`${i}px`} : void 0,     // height cap only while COLLAPSED
  ...
  s&&o && b("div",{...,children:b("button",{...,"aria-label":"Show less",children:"Show less"})})
}

Two things combine into the reported behavior:

  1. The height cap is applied only while collapsed. Expanding sets style to void 0, so the block grows to the full height of the content. "Show less" is the last child of the container in normal flow, so on a long initial prompt it lands thousands of pixels below the fold — matching the "scroll to the very bottom of the session to find it" workaround in the report.
  1. Click-to-collapse is disabled while expanded (onClick: !s&&o ? d : void 0). So that off-screen button is the only way back, which is why the message effectively hijacks navigation.

There is a related defect in the same component: o (is-truncated) is measured once per [maxHeight, content], so resizing the sidebar never re-measures. A message that crosses the 60px threshold after a resize renders fully expanded with no button at all — that looks like the mechanism behind #85792 and #88512.

Suggested fix

Capping the expanded height and letting it scroll internally fixes the reported symptom on its own, since "Show less" then always sits just under the block:

style: o ? (s ? {maxHeight:"70vh", overflowY:"auto"} : {maxHeight:`${i}px`}) : void 0,

Making the button sticky within the container would work too. Re-enabling click-to-collapse while expanded (or wrapping the measurement in a ResizeObserver) would address the second and third points respectively.

I have been running the 70vh + overflowY:auto variant as a local patch on the shipped bundle for several releases and have not hit a layout regression from it.

Note on identifiers

The names above are minifier output and change every release — aat here was _nt in 2.1.239, and the effect-hook alias went ce → re → se across 2.1.79 / 2.1.239 / 2.1.241. The structure has been stable; only the short names move.

AndresDiagoM · 27 days ago

Still reproduces on anthropic.claude-code v2.1.274 with VS Code 1.138.0 (Windows 11).

Same symptom as described: on a large prompt, clicking Show more expands the message to full height with no internal scroll, and the Show less control lands off-screen. Since click-to-collapse is disabled while expanded, the only way back is scrolling the whole session down to find the button — which in my case made it feel like the modal for the previous prompt was stuck/unclosable while trying to work with a new one.

Environment

  • Extension: anthropic.claude-code v2.1.274
  • VS Code: 1.138.0
  • OS: Windows 11 Pro

+1 on the root-cause analysis above — the height cap only applying while collapsed, plus disabling click-to-collapse when expanded, matches what I'm seeing.

robster7674 · 4 days ago

+1, would be great to have this fixed. Still happens on 2.1.284, macOS/VSCodium.