Skip to content

Comments

Fix YAML output not displaying in playground editor#16719

Merged
Mossaka merged 2 commits intomainfrom
fix/wasm-editor-yaml
Feb 19, 2026
Merged

Fix YAML output not displaying in playground editor#16719
Mossaka merged 2 commits intomainfrom
fix/wasm-editor-yaml

Conversation

@Mossaka
Copy link
Collaborator

@Mossaka Mossaka commented Feb 19, 2026

Summary

  • Primer CSS's d-flex class applies display: flex !important, which overrides the inline style.display = 'none' set by JavaScript after compilation
  • The placeholder div remained visually visible (computed display: flex) despite the inline style saying none, pushing the YAML CodeMirror output below the visible container area where overflow: hidden clipped it
  • Switched to toggling Primer's d-none/d-flex utility classes (which also use !important) instead of inline display styles, matching the pattern already used by the error/warning banners

Root cause

Introduced in #16710 (CodeMirror migration). The old textarea-based editor used a <pre> element without d-flex, so inline display toggling worked fine. The new placeholder div has d-flex for centering, creating the specificity conflict.

Test plan

  • Used Playwright to confirm bug on live site: getComputedStyle(placeholder).display returns "flex" when it should be "none"
  • Applied fix at runtime via Playwright and verified: placeholder hidden, YAML output visible with syntax highlighting
  • Verified before/after screenshots show correct behavior

🤖 Generated with Claude Code

Primer CSS's `d-flex` class applies `display: flex !important`, which
overrides the inline `style.display = 'none'` set by JavaScript. The
placeholder remained visible (computed display: flex) even after
compilation, pushing the YAML output below the visible area where it
was clipped by `overflow: hidden`.

Switch to toggling Primer's `d-none`/`d-flex` utility classes instead
of setting inline display styles, matching the pattern already used by
the error/warning banners.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 19, 2026 02:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a CSS specificity issue where the YAML output was not displaying in the playground editor after compilation. The root cause was that Primer CSS's d-flex class (which uses !important) was overriding the inline style.display = 'none' set by JavaScript on the placeholder div. The fix switches from inline style toggling to using Primer's d-none/d-flex utility classes, which also use !important and thus work correctly.

Changes:

  • Modified display toggling for the output placeholder from inline styles to Primer utility classes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Primer CSS's `d-flex` class applies `display: flex !important`, which
overrides the inline `style.display = 'none'` set by JavaScript. The
placeholder remained visible (computed display: flex) even after
compilation, pushing the YAML output below the visible area where it
was clipped by `overflow: hidden`.

Switch to toggling Primer's `d-none`/`d-flex` utility classes instead
of setting inline display styles, matching the pattern already used by
the error/warning banners.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Mossaka Mossaka merged commit c8d1c06 into main Feb 19, 2026
2 checks passed
@Mossaka Mossaka deleted the fix/wasm-editor-yaml branch February 19, 2026 03:52
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.

1 participant