fix(web): stop MCP server snippet code from inheriting the inline-code chip#4516
fix(web): stop MCP server snippet code from inheriting the inline-code chip#4516maxmilian wants to merge 1 commit into
Conversation
…e chip In Settings -> MCP server, the generated CLI command (`claude mcp add-json …`) renders inside a dark `<pre><code>` block, but the inner `<code>` had no style of its own and inherited the global inline-`code` chip rule from primitives.css (`background: var(--bg-subtle)` + `padding: 1px 5px` + rounded corners). On the wrapped bash one-liner each wrapped segment painted its own light rounded rectangle, reading as permanent selection highlights (nexu-io#4509). Reset the inner `<code>` to a transparent, padding-less, inherit-color/font wrapper so it stops inheriting the inline-code chip styling and instead picks up the dark block's own color and monospace font. Applies to every CLI client (Claude / Codex / …) since they share the snippet block. Add a Playwright regression check that the snippet `<code>` computed background is transparent (it was the light `--bg-subtle` chip before this change). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Hi @maxmilian! 👋 Thanks for opening this draft PR — the write-up, before/after framing, and regression path are all very clear. |
|
Heads-up on CI: the This diff only edits |
PerishCode
left a comment
There was a problem hiding this comment.
@maxmilian I reviewed the changed Settings MCP snippet range and the new Playwright regression. The inline reset is scoped to the snippet's child code element and directly neutralizes the global inline-code chip styles without changing the surrounding MCP setup behavior; the regression asserts the computed transparent background and zero padding in the real Settings flow. Nice focused fix with a clear red/green path for #4509.
I was not able to rerun the package typechecks in this prepared worktree because node_modules is absent and tsc is not installed locally, so this approval is based on diff review plus the PR's reported validation.
|
🧪 This PR has changes that need a manual QA pass before merge — please hold off self-merging for now; we'll loop QA in once it's merge-ready (and design/product have signed off, where applicable). |
chaoxiaoche
left a comment
There was a problem hiding this comment.
UI/design LGTM. This is a focused visual cleanup for the MCP snippet: the command now reads as clean code inside the dark block instead of inheriting the inline-code chip background.
The before/after screenshots cover the change clearly, and I do not see any interaction concern from the UI side.
Fixes #4509
Why
Scratching the issue's itch (reported by @NightGlowww, root cause confirmed with @lefarcen). In Settings → MCP server, the generated CLI command (
claude mcp add-json …for Claude Code, and the other clients) renders inside a dark<pre><code>block. The inner<code>had no style of its own, so it inherited the global inline-codechip rule fromprimitives.css(background: var(--bg-subtle)+padding: 1px 5px+ rounded corners). On the wrapped bash one-liner (white-space: pre-wrap; word-break: break-all) each wrapped segment painted its own light rounded rectangle — which reads as the command being permanently selected, and makes the MCP setup UI look broken.What users will see
The MCP server setup command now renders as clean monospaced code on the dark block — no light rectangles behind wrapped lines, stable contrast, and no selection-like highlights unless you actually select text. Applies to every CLI client (Claude Code / Codex / …) since they share the snippet block.
Surface area
apps/web)Screenshots
Settings → MCP server, Claude Code snippet (the wrapped
claude mcp add-jsonone-liner):Bug fix verification
e2e/ui/settings-mcp-snippet-chip.test.ts→MCP server snippet code stays transparent, not the inline-code chip (#4509)mainand green on this branch? yes — the test navigates to Settings → MCP server and reads the snippet<code>computed style. Onmainit fails:backgroundisrgb(244, 245, 247)(the--bg-subtlechip) with1px 5pxpadding. On this branch it passes:backgroundisrgba(0, 0, 0, 0)(transparent),padding0px.Validation
pnpm typecheck— clean (apps/webDone)claude mcp add-jsonsnippet renders against the e2e mock daemon and the<code>no longer carries the chip background (before/after screenshots above)Implementation note: the fix is a small inline-style reset on the snippet's inner
<code>(background: transparent; padding: 0; border-radius: 0; color/font: inherit) so it stops inheriting the global inline-code chip styling and instead inherits the dark block's own color and monospace font. Nothing else in the MCP setup card changes.