Skip to content

fix(shell-docs): fix Tab double-escaping that hid multi-word tab content#5081

Merged
onsclom merged 1 commit into
mainfrom
fix/build-with-agents-json-config
May 28, 2026
Merged

fix(shell-docs): fix Tab double-escaping that hid multi-word tab content#5081
onsclom merged 1 commit into
mainfrom
fix/build-with-agents-json-config

Conversation

@onsclom

@onsclom onsclom commented May 28, 2026

Copy link
Copy Markdown
Contributor

Problem

On docs.copilotkit.ai/built-in-agent/build-with-agents, "JSON Configuration File" shows a blank panel.

image

Why

Our Tab wrapper called escapeValue() before passing to Fumadocs's FumadocsTab — which also calls it internally. For 3-word labels, the double-escape produces different values for the trigger vs the content panel, so Radix hides the content.

"JSON Configuration File"
  → trigger (1 pass):   json-configuration file    ← space
  → content (2 passes): json-configuration-file    ← hyphen (mismatch → hidden)

Fix

Remove escapeValue() from the Tab wrapper — Fumadocs already handles it. The Tabs defaultValue still needs pre-escaping since FumadocsTabs doesn't apply it internally.

…File content

Fumadocs's Tab component applies escapeValue() internally to the value
prop. Our DocsTab wrapper was also calling escapeValue() before passing
to FumadocsTab, causing multi-word tab values to be escaped twice.

For "JSON Configuration File" (3 words, 2 spaces):
  1st escape (our wrapper): "json-configuration file"  (1 space left)
  2nd escape (Fumadocs Tab): "json-configuration-file" (fully hyphenated)

The trigger value uses only ONE escapeValue call:
  escapeValue("JSON Configuration File") = "json-configuration file"

Trigger "json-configuration file" != content "json-configuration-file"
so Radix sets data-state="inactive" on the content panel, which is
then hidden by data-[state=inactive]:hidden.

Fix: remove escapeValue() from our Tab wrapper. The Tabs defaultValue
still needs pre-escaping because FumadocsTabs accepts it as-is (no
internal escape); only the individual Tab has internal escaping.

Single-word and two-word tabs (HTTP, Application Settings) were
unaffected because one escapeValue pass already produces a hyphen-only
string that is idempotent under a second pass. Same bug also affected
"stdio Transport (Local)" in the Windsurf section.
@vercel

vercel Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat-with-your-data Ready Ready Preview, Comment May 28, 2026 4:11pm
docs Ready Ready Preview, Comment May 28, 2026 4:11pm
form-filling Ready Ready Preview, Comment May 28, 2026 4:11pm
research-canvas Ready Ready Preview, Comment May 28, 2026 4:11pm
travel Ready Ready Preview, Comment May 28, 2026 4:11pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📣 Social Copy Generator

Generate social media copies (Twitter/X, LinkedIn, Blog Post) for this PR using Claude.

  • Generate social media copies

@tylerslaton tylerslaton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice 😄

@onsclom onsclom merged commit 4fbcb4c into main May 28, 2026
23 checks passed
@onsclom onsclom deleted the fix/build-with-agents-json-config branch May 28, 2026 17:38
@github-actions

Copy link
Copy Markdown
Contributor

❌ Showcase Build Failed

The Docker build triggered by this PR's merge failed.

Run: https://github.com/CopilotKit/CopilotKit/actions/runs/26591550808
Commit: 4fbcb4c1

@onsclom — please check the build logs and fix the issue.

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.

2 participants