Skip to content

fix(playground): Stabilize mode switching and tighten label UX#132

Merged
mhiro2 merged 3 commits into
mainfrom
fix/playground-misc-issues
May 2, 2026
Merged

fix(playground): Stabilize mode switching and tighten label UX#132
mhiro2 merged 3 commits into
mainfrom
fix/playground-misc-issues

Conversation

@mhiro2

@mhiro2 mhiro2 commented May 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix ER diagram disappearing after switching modes by dropping the unnecessary about:blank navigation on the preview iframe and forcing the parent panel layout to settle before srcdoc is injected
  • Apply user-select: none consistently to playground UI chrome (buttons, mode tabs, severity badges, pills, section labels) so double-click and drag no longer highlight chrome text
  • Move the added/modified/removed diff badge (and the Join Table badge) out of the metrics grid in the detail drawer and pin them to a row next to the table title where they describe

Changes

  • 6d3519c : fix(playground): keep iframe srcdoc stable across mode switches
    • Stop clearing previewFrame.srcdoc in resetOutputPanels() so mode switches no longer queue a redundant about:blank navigation that could race with the next render/compare write
    • Force a synchronous layout flush (void previewPanel.offsetHeight) right after unhiding the preview panel in runRenderMode() and the visual branch of runCompareMode() so the in-iframe pan_zoom.js initial fit reads a real viewport size instead of falling back to the 0x0 ghost dimensions
  • a3bf26c : style(playground): make UI chrome non-selectable
    • Apply user-select: none in one consolidated rule covering buttons, mode tabs, severity badges, pills, topbar labels, surface labels, and stat card labels so chrome text no longer highlights on drag or double-click
    • Leave headings, descriptions, hints, finding bodies, diagnostic messages, and code/output untouched so users can still select and copy real content
  • b3488e2 : fix(viewer): pin diff and join badges to the drawer title row
    • Wrap the drawer title in detail-title-row with a sibling detail-title-badges slot and route the diff and Join Table badges through it so the status sits next to the table name instead of crammed above the metrics cards
    • Drop the now-unneeded grid-aware .detail-badge rules (grid-column: 1 / -1, width: fit-content) and add min-width: 0; overflow-wrap: anywhere to .detail-title so long names plus multiple badges wrap cleanly within the drawer
    • Mark the new badge container (and its descendants) user-select: none so the iframe-side labels behave like the rest of the chrome

mhiro2 added 2 commits May 2, 2026 22:45
Removing srcdoc on every reset forced an extra about:blank navigation
that could race with the next render. Also force a parent layout flush
before rewriting srcdoc so the in-iframe pan/zoom initial fit reads a
real viewport size instead of the 0x0 fallback.
Severity badges (breaking/caution/warning/info) and other label-style
elements were inheriting the default text selection, so double-click
and drag would highlight chrome instead of moving past it. Apply
user-select: none to buttons, mode tabs, badges, pills, and section
labels — content surfaces (headings, hints, finding bodies, output,
code) still allow selection.
@mhiro2 mhiro2 self-assigned this May 2, 2026
@mhiro2 mhiro2 added the bug Something isn't working label May 2, 2026
The diff (added/modified/removed) and join-table badges were dropped
into the metrics grid, so they sat awkwardly above the Columns / Relations
cards. Move them next to the table title where they describe — paired
with the row name they apply to. Mark the badge container non-selectable
so the labels don't snag on text selection.
@mhiro2
mhiro2 force-pushed the fix/playground-misc-issues branch from 402cba1 to b3488e2 Compare May 2, 2026 20:10
@github-actions

github-actions Bot commented May 2, 2026

Copy link
Copy Markdown

Code Metrics Report

main (1215079) #132 (b793dd5) +/-
Coverage 94.8% 94.8% +0.0%
Test Execution Time 1m30s 1m25s -5s
Details
  |                     | main (1215079) | #132 (b793dd5) |  +/-  |
  |---------------------|----------------|----------------|-------|
+ | Coverage            |          94.8% |          94.8% | +0.0% |
  |   Files             |             81 |             81 |     0 |
  |   Lines             |          39175 |          39201 |   +26 |
+ |   Covered           |          37160 |          37186 |   +26 |
+ | Test Execution Time |          1m30s |          1m25s |   -5s |

Code coverage of files in pull request scope (100.0% → 100.0%)

Files Coverage +/- Status
crates/relune-render-html/src/components.rs 100.0% 0.0% modified
crates/relune-render-html/src/css.rs 100.0% 0.0% modified

Reported by octocov

@github-actions

github-actions Bot commented May 2, 2026

Copy link
Copy Markdown

Schema review

Tip

✅ No risk findings — schema changes look safe to merge.

@mhiro2
mhiro2 merged commit 9f42bad into main May 2, 2026
6 checks passed
@mhiro2
mhiro2 deleted the fix/playground-misc-issues branch May 2, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant