claude-code - 💡(How to fix) Fix Slash command/skill inputs not collapsible, blocks view of response [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49118Fetched 2026-04-17 08:50:22
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×1cross-referenced ×1

Error Message

Error rendering content: Cannot read properties of undefined (reading 'type')

Root Cause

Root cause (from reading the minified webview source)

Code Example

// Regular messages — correctly collapsible
createElement(Ho1, {content: w, context: X, maxHeight: 60})

---

// Slash commands — no collapse, renders full height
if (N.isSlashCommand)
  return createElement("div",
    {className: \`\${z2.userMessage} \${z2.slashCommandMessage}\`},
    N.text   // <-- raw text, no Ho1 wrapper
  )

---

Error rendering content: Cannot read properties of undefined (reading 'type')
RAW_BUFFERClick to expand / collapse

Bug

When invoking any skill or slash command with a large input (e.g., pasting 50+ lines of text as arguments), the user message renders at full height with no collapse toggle. The assistant's response is pushed far below the viewport, making it impossible to see what Claude is doing without scrolling past the entire input.

Regular user messages correctly collapse at 60px with a gradient overlay and expand/collapse button. Slash command messages bypass this.

Reproduces on both VS Code (macOS) and Claude Desktop (Windows).

Root cause (from reading the minified webview source)

In webview/index.js, regular user messages are wrapped in an expandable container component (Ho1) with maxHeight: 60:

// Regular messages — correctly collapsible
createElement(Ho1, {content: w, context: X, maxHeight: 60})

But when isSlashCommand is true, the text renders directly without the expandable wrapper:

// Slash commands — no collapse, renders full height
if (N.isSlashCommand)
  return createElement("div",
    {className: \`\${z2.userMessage} \${z2.slashCommandMessage}\`},
    N.text   // <-- raw text, no Ho1 wrapper
  )

The Ho1 component provides the collapse behavior: it measures scrollHeight against maxHeight, and when content overflows, it adds a gradient overlay (truncationGradient_xGDvVg), sets overflow-y: hidden with a CSS transition, and renders expand/collapse buttons.

Attempted fix

Wrapping N.text in Ho1 crashes the webview:

Error rendering content: Cannot read properties of undefined (reading 'type')

Ho1 internally calls a child renderer that expects a structured content object, not a raw string. The fix needs to either:

  1. Wrap N.text in the expected content shape before passing to Ho1, or
  2. Add a simpler CSS-only truncation (max-height + overflow hidden + gradient) to .slashCommandMessage

Steps to reproduce

  1. Open Claude Code in VS Code or Desktop
  2. Invoke any skill with large input (50+ lines of text as arguments)
  3. The entire input renders expanded, no collapse button
  4. Assistant response is hidden below the fold — user cannot see progress

Expected

Slash command inputs should collapse like regular user messages, with a gradient and expand/collapse toggle.

extent analysis

TL;DR

Wrap the N.text in a structured content object compatible with the Ho1 component to enable collapse behavior for slash command messages.

Guidance

  • Verify that the Ho1 component expects a specific content shape by reviewing its internal child renderer.
  • Attempt to wrap N.text in a minimal structured content object, such as { content: N.text }, to pass to Ho1.
  • Consider adding a simpler CSS-only truncation as a fallback solution if wrapping N.text in Ho1 proves difficult.
  • Test the fix by invoking a skill with a large input and verifying that the input collapses with a gradient and expand/collapse toggle.

Example

// Example of wrapping N.text in a structured content object
if (N.isSlashCommand)
  return createElement(Ho1, {
    content: { text: N.text }, // Assuming { text: string } is the expected content shape
    context: X,
    maxHeight: 60
  })

Notes

The exact structure of the content object expected by Ho1 is unclear, so the example provided is speculative. Additional debugging may be necessary to determine the correct content shape.

Recommendation

Apply workaround: Wrap N.text in a structured content object compatible with the Ho1 component, as this approach is more likely to provide the desired collapse behavior for slash command messages.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING