Skip to content

Fix editor YAML output not displaying in right panel#16618

Merged
Mossaka merged 1 commit intomainfrom
fix/editor-yaml-display
Feb 18, 2026
Merged

Fix editor YAML output not displaying in right panel#16618
Mossaka merged 1 commit intomainfrom
fix/editor-yaml-display

Conversation

@Mossaka
Copy link
Collaborator

@Mossaka Mossaka commented Feb 18, 2026

Summary

  • Root cause: Primer CSS's .d-flex class uses display: flex !important, which overrides inline style.display = 'none' set by JavaScript. The output placeholder was never actually hidden after compilation, making both the placeholder and the YAML <pre> render simultaneously, pushing the page to ~10,000px tall.
  • Switch from style.display toggling to Primer's d-none class toggling (display: none !important), which properly overrides d-flex
  • Change #app container from min-height: 100vh to height: 100vh so the flex layout constrains panel heights and the output container scrolls instead of expanding the page

Test plan

  • Verified with Playwright: page body stays at viewport height (800px) in all states
  • Initial state: placeholder visible, pre hidden — body 800px
  • After compilation with 200+ lines of YAML: body 800px, output container scrollable (scrollHeight 8426 > clientHeight 643)
  • After clearing editor: placeholder shown again, pre hidden — body 800px
  • Visual check on https://github.github.com/gh-aw/editor/index.html after deploy

🤖 Generated with Claude Code

Primer CSS's `.d-flex` uses `display: flex !important` which overrides
inline `style.display = 'none'` set by JavaScript. Switch to toggling
Primer's `d-none` class (which uses `display: none !important`) instead
of setting inline display styles.

Also change `#app` from `min-height: 100vh` to `height: 100vh` so the
flex layout properly constrains panel heights and the output container
scrolls instead of expanding the page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 18, 2026 18:03
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 display bug in the editor where the YAML output panel was not properly hiding/showing content. The root cause was that Primer CSS's .d-flex class uses display: flex !important, which overrode inline JavaScript style.display = 'none' assignments, causing both the placeholder and YAML output to render simultaneously.

Changes:

  • Switch from inline style.display manipulation to Primer CSS class-based toggling using d-none class to properly manage visibility
  • Change the #app container from min-height: 100vh to height: 100vh to constrain the flex layout and enable proper scrolling within the output panel
Comments suppressed due to low confidence (1)

docs/public/editor/index.html:587

  • When an exception is caught during compilation, the visibility of outputPre and outputPlaceholder is not managed. This means the output panel will continue to show whatever was previously displayed. Consider adding the same visibility management logic here as in the result.error case to provide consistent user feedback.
  } catch (err) {
    setStatus('error', 'Error');
    errorText.textContent = err.message || String(err);
    errorBanner.classList.remove('d-none');

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

Comment on lines 568 to 571
if (result.error) {
setStatus('error', 'Error');
errorText.textContent = result.error;
errorBanner.classList.remove('d-none');
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

When a compilation error occurs, the visibility of outputPre and outputPlaceholder is not managed. This means the output panel will continue to show whatever was previously displayed (either the placeholder or previous successful output). Consider adding logic to explicitly hide the outputPre and show the placeholder with an appropriate message when an error occurs, so users have clear feedback that the compilation failed.

This issue also appears on line 584 of the same file.

Copilot uses AI. Check for mistakes.
@Mossaka Mossaka merged commit f1caf72 into main Feb 18, 2026
49 checks passed
@Mossaka Mossaka deleted the fix/editor-yaml-display branch February 18, 2026 20:21
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