Fix editor YAML output not displaying in right panel#16618
Conversation
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>
There was a problem hiding this comment.
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.displaymanipulation to Primer CSS class-based toggling usingd-noneclass to properly manage visibility - Change the
#appcontainer frommin-height: 100vhtoheight: 100vhto 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.
| if (result.error) { | ||
| setStatus('error', 'Error'); | ||
| errorText.textContent = result.error; | ||
| errorBanner.classList.remove('d-none'); |
There was a problem hiding this comment.
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.
Summary
.d-flexclass usesdisplay: flex !important, which overrides inlinestyle.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.style.displaytoggling to Primer'sd-noneclass toggling (display: none !important), which properly overridesd-flex#appcontainer frommin-height: 100vhtoheight: 100vhso the flex layout constrains panel heights and the output container scrolls instead of expanding the pageTest plan
🤖 Generated with Claude Code