Skip to content

fix(wasm): stop the frontend page overflowing 40px and let the title scale - #4421

Merged
zackees merged 1 commit into
masterfrom
fix/4420-wasm-frontend-layout
Sep 18, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/4420-wasm-frontend-layout

Conversation

@zackees

@zackees zackees commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Fixes #4420. Mirrors FastLED/cli#268 (PR FastLED/cli#270), so FastLED's frontend copy and fastled-wasm's stay identical.

The two bugs (byte-identical in both copies)

  1. #main-container was content-box with width: 100% plus padding: 20px, so the page was always 40 px wider than the window for any window narrower than about 1440 CSS px, and #ui-controls ran off the right edge. It is now border-box.
  2. The page title was a fixed 6em (96 px) at every viewport. It is now clamp(2rem, 5vw, 6em), keeping 6em on screens 1920 px and wider.

RED → GREEN on this repo's own copy

Measured with Playwright against src/platforms/wasm/compiler/index.html + index.css (bundled with esbuild, no WASM needed) at 989×700, the viewer viewport the bug was reported from:

overflow #main-container right edge title @ 989 px title @ 2200 px
before (Chromium / WebKit) 40 px / 40 px 1029 / 1029 of 989 96 px 96 px
after (Chromium / WebKit) 0 / 0 989 / 989 ~49 px 96 px

Wide screens are unchanged (the clamp upper bound is the old 6em). The same two rules are covered by an automated regression test on the fastled-wasm side, tests/frontend/test_layout.py, which failed on its main with page overflows by 40px.

CSS only: no JS, no WASM or compiler flags, no JSPI.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Style
    • Improved heading responsiveness across different screen sizes.
    • Adjusted the main container sizing to account for internal padding more accurately.

Fixes #4420. Mirrors FastLED/cli#268 so the two frontend copies stay
identical.

`#main-container` was content-box with `width: 100%` plus 20 px of padding, so
the page was always 40 px wider than any window narrower than about 1440 CSS
px, and the controls column ran off the right edge. It is border-box now.

The page title was a fixed 6em (96 px) at every viewport. It now scales with
clamp(2rem, 5vw, 6em), keeping 6em on screens 1920 px and wider.

Measured on this copy's own index.html and index.css at 989x700: overflow
40 px -> 0 and title 96 px -> ~49 px on Chromium and WebKit, with the title
still 96 px at 2200 px.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: b72ff19f-9681-4aa5-9360-5e95aa2d95ed

📥 Commits

Reviewing files that changed from the base of the PR and between df106df and 0be94df.

📒 Files selected for processing (1)
  • src/platforms/wasm/compiler/index.css

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The WASM compiler stylesheet now scales h1 size and margins with clamp(). It also applies border-box sizing to #main-container, including its padding within the declared width.

Changes

WASM frontend layout

Layer / File(s) Summary
Responsive layout rules
src/platforms/wasm/compiler/index.css
h1 uses responsive font-size and margin values. #main-container uses box-sizing: border-box so its padding is included in its 100% width.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 0be94

The changes address the responsive title and horizontal overflow goals without identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes both main changes: preventing 40px frontend overflow and making the title responsive.
Linked Issues check ✅ Passed For directly linked issue #4420, the diff changes #main-container to box-sizing: border-box and applies the specified responsive clamp() rules to h1 font size and vertical margins. These rules…
Out of Scope Changes check ✅ Passed The pull request changes one CSS file and modifies only the two layout rule groups specified by issue #4420. The added comments document those layout changes. No unrelated source, layout, or behavior …
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zackees
zackees merged commit e2d34dc into master Sep 18, 2026
16 checks passed
@zackees
zackees deleted the fix/4420-wasm-frontend-layout branch September 18, 2026 03:26
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(wasm): frontend page overflows 40px and the title never scales (mirror of zackees/fastled-wasm#268)

1 participant