refactor(SplitterPanel): replace overflow:hidden with min-size: 0#217
Draft
johnleider wants to merge 1 commit into
Draft
refactor(SplitterPanel): replace overflow:hidden with min-size: 0#217johnleider wants to merge 1 commit into
johnleider wants to merge 1 commit into
Conversation
|
commit: |
4 tasks
The previous fix restored overflow:hidden to suppress the flex implied minimum size (CSS Flexbox §4.5) and close the layout feedback loop. That works, but bundles two effects in one declaration: structural (kill min-content sizing) and visual (clip overflow). Setting min-width: 0; min-height: 0 achieves the structural payload without clipping. Consumers retain the ability to render content that escapes the panel bounds (tooltips, focus rings, drop shadows) — the splitter math stays closed because flex no longer derives the panel's minimum size from its content. Verified on the playground: panels stable at 752/451/301px across a 5s observation window, identical to the overflow:hidden behavior.
7d8540c to
751e5dc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
dd7fed85restoredoverflow: hiddenonSplitterPanelto fix the playground's infinite vertical growth. That works because CSS Flexbox §4.5 says: when an item'soverflowis anything other thanvisible, the implied minimum size becomes0instead of its min-content size. Without that, content like the playground'seditor-container { height: calc(100% + 1px) !important }forces the panel's min-height past itsflex-basis, and ResizeObservers turn it into a feedback loop.The trouble:
overflow: hiddenbundles two effects.Headless components shouldn't ship the second one. Tooltips, focus rings, drop shadows, popovers anchored inside a panel — all reasonable consumer needs that
overflow: hiddenquietly forbids.What
Replace
overflow: 'hidden'withminWidth: 0; minHeight: 0in the panel's inline structural style.:style="[attrs.style, slotProps.attrs.style, { flexGrow: 0, flexShrink: 0, flexBasis: `${size}%`, - overflow: 'hidden', + minWidth: 0, + minHeight: 0, }]"Per the Flexbox spec, an explicit
min-size: 0on the main axis short-circuits the implied-minimum rule the same wayoverflow: hiddendoes — but without clipping. Setting both axes covers horizontal and vertical splitters and protects against cross-axis overflow contributing back to the container.Verification
overflow: hiddenbaseline. Editor container 397px, repl 396px, body 800px = viewport.pnpm lint:fix,pnpm typecheck,pnpm test:runclean. Pre-push gauntlet (repo:knip+repo:sherif) clean.Notes
Draft because:
min-width: 0; min-height: 0is fully equivalent tooverflow: hiddenfor breaking the implied-minimum loop.calc(100% + 1px) !importantworkaround inPlaygroundEditor.vue:97is the originating trigger. Worth tracing that 1px's history — likely a Monaco scrollbar artifact — and removing it if no longer needed.