Fix Settings switch geometry and stabilize Model Pad chrome - #101
Fix Settings switch geometry and stabilize Model Pad chrome#101sambitcreate wants to merge 3 commits into
Conversation
Keep the shared Switch pill from being restyled as a flex button, so the thumb matches Plugins. Trailing switch rows stay compact and unclipped in Field, Appearance, Memory, shortcuts, and scheduled-task lists. Co-authored-by: Sambit Biswas <sambitcreate@users.noreply.github.com>
Reserve axis/legend height instead of measuring live canvas-minus-square geometry, cap the square to the visible scrollport, and give composer model details a fixed card so picking models no longer resizes the pad. Co-authored-by: Sambit Biswas <sambitcreate@users.noreply.github.com>
There was a problem hiding this comment.
ℹ️ No critical issues — one robustness suggestion inline. The geometry refactor reads coherently: the fixed chrome reservation and grid-only observation remove the label-wrap feedback loop, the measure math is consistent with the CSS caps, the source-reading contracts match the actual CSS/TSX, and all 98 focused unit tests pass.
Reviewed changes
- Model Pad measurement —
measureModelPadAvailableSizeextracted intorenderer/lib/model-pad-layout.tswith exportedMIN_SIZE/CHROME/GUTTERconstants; settings layout effect now observes only grid + scrollport and reserves 128px of fixed chrome instead of measuring live labels/legend, so legend wrap and marker labels can no longer resize the square outline. - Model Pad CSS —
.model-padgainsaspect-ratio: 1/1,flex-shrink: 0,align-self: start,min-width: 0;.model-pad-legendreservesmin-height: 2.5rem; square is additionally capped to the visible scrollport minus 1px. - Composer picker details card —
ModelHoverDetailsis now a fixed-height (min(22.5rem, 70vh)) column with an internal scroll area andpointer-events-auto, so popover height no longer shifts while model copy or catalog text changes. - Switch geometry — shared
Switchroot isinline-flex items-center shrink-0 overflow-visiblewith apointer-events-nonethumb; settings Field rows carryhas-[[role=switch]]trailing-switch columns; group/appearance cards dropoverflow: hiddenso the Plugins-style thumb is not clipped. - Trailing alignment —
items-centeron git-push and shortcut rows, removedmax-[540px]:justify-startin remote-access settings, new narrow-container:has([role="switch"])appearance rules. - Docs & tests —
settings-design-system.mdrow updated to the reserved-chrome contract; unit tests for the measure function, settings source/CSS contracts, memory-settings copy placement, and picker chrome; E2E waits for in-flight view-transition animations before measuring.
DeepSeek Flash | 𝕏
There was a problem hiding this comment.
✅ No new issues found. The previously flagged unbounded animation wait is now genuinely bounded: infinite-iteration animations are excluded via the finite-
endTimefilter, anything still pending is capped by the 500 ms race, and the infinite sentinel makes the old hang reproduce deterministically on regression rather than only when a spinner happens to be animating.
Reviewed changes
- Bounded Model Pad E2E wait — the pre-measure wait now snapshots
document.getAnimations(), filters to animations whose computedendTimeis finite (endTime: Infinityfor infinite iterations, so perpetual spinners drop out), and racesPromise.allSettled(finished)against a 500 ms cap — paused or never-ending animations can no longer stall the merge-gate spec until the Playwright action timeout. - Infinite-animation sentinel — a 1px, opacity-0, infinite-rotation element is appended to the page for the whole test, so the original unbounded-wait failure fails loudly on regression; the sentinel also exercises the filter on every panel iteration.
- Papercut documented —
.papercuts/troubleshooting.mdrecords theanimation.finishednever-settles rule and keeps geometry polling authoritative for E2E readiness.
DeepSeek Flash | 𝕏

Summary
This PR still includes the Settings switch geometry fix. It also keeps the Model Pad square outline stable while surrounding copy changes, and hardens the flaky responsive Electron check.
Model Pad
canvas − padmeasurement is gone, so legend wrap and marker labels no longer resize the outline.fits.Switches (unchanged intent)
Shared
Switchgeometry, trailing alignment on Settings rows, andoverflow-visibleon field cards so the Plugins-style thumb is not clipped.Tests
measureModelPadAvailableSize, Settings source/CSS contracts, and picker details chrome.Cannot run Electron E2E in this environment; scoped
test:model-padneedstsxfromnpm ci(registry was flaky here).