Skip to content

Keep native windows unscrollable, and paint theme changes this frame - #15

Merged
AllTerrainDeveloper merged 1 commit into
mainfrom
fix/theme-window-scroll-and-instant-preview
Aug 19, 2026
Merged

AllTerrainDeveloper merged 1 commit into
mainfrom
fix/theme-window-scroll-and-instant-preview

Conversation

@AllTerrainDeveloper

Copy link
Copy Markdown
Owner

Two user-reported Theme-tab issues

1. The bottom gap. ([screenshot reported by Daniel]) The shell's os-window__body is overflow: auto, and under some tab-switch/resize sequences the browser decides our windows have scrollable overflow even though every pane manages its own. One stray wheel tick (or a focus-driven scrollIntoView) then shunts the whole tool up — toolbar hidden under the title bar, equal dead band at the bottom. Fix is belt and braces:

  • CSS: .os-window__body:has(> .atfb/.atfe/.atfs/.atfa) { overflow: hidden } — stops wheel scrolling.
  • JS: pinWindowBodyScroll() (new, ui.ts) — a passive scroll listener that snaps the body back to 0, catching the programmatic scrolls CSS can't; wired at all four window mounts.

Verified on the 8889 site with Playwright: forced scrollTop = 300 snaps back to 0; drag-resize and maximize keep the panes glued to the window bottom.

2. Non-instant theme controls. Every control waited out a 180ms debounce + REST round trip before anything changed. Since every theme token is a CSS custom property scoped to .atf-form-wrap, paintNow() writes the same values inline the instant a control is clicked — single tokens, quick dials, theme-card switches (full resolved set), and JSON imports. The debounced server render still lands and remains the truth; it just stopped being the first feedback.

Verified live: clicking Roundness → Pill sets --atf-radius-field: 999px on the wrapper in the same tick; clicking Midnight paints --atf-surface: #1d2327 in the same tick.

Tests

  • tsc --noEmit clean, 251 vitest ✓ (bundles rebuilt)

🤖 Generated with Claude Code

https://claude.ai/code/session_0119U4sRRWGcTQdwYreTwpAp

Two Theme-tab complaints with one root feeling: the tool stopped being
where you left it. The shell gives a native window's body overflow:auto,
and under some tab-switch/resize sequences the browser decides there is
scrollable overflow — one stray wheel tick then hides the toolbar under
the title bar and opens a dead band at the bottom. Nothing in these
windows ever wants the body scrolled: a stylesheet rule now stops the
wheel and pinWindowBodyScroll() undoes the scrolls CSS cannot reach.

And a theme control no longer waits out a debounce plus a REST round
trip to show what it did: every token is a custom property on the
preview's wrapper, so the same value written inline shows the change the
moment it is clicked — dials, single tokens, imports and whole theme
switches alike. The server render still lands 180ms later and remains
the truth; it just stopped being the first feedback.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0119U4sRRWGcTQdwYreTwpAp
@AllTerrainDeveloper
AllTerrainDeveloper merged commit f7b9280 into main Aug 19, 2026
3 checks passed
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.

1 participant