Skip to content

Fit the menu bar to the space it has instead of fixed breakpoints - #132

Merged
Mistium merged 1 commit into
developfrom
fix-menu-bar-overlap
Oct 8, 2026
Merged

Mistium merged 1 commit into
developfrom
fix-menu-bar-overlap

Conversation

@Mistium

@Mistium Mistium commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Preview: https://fix-menu-bar-overlap.scratch-gui.pages.dev/editor

The menu bar only collapsed at fixed window widths: labels at 1124px and the More menu at 900px. The right side never counted toward those widths. When it was wide (signed in, with "Save to MistWarp" plus "Unsaved changes", collab, chat, files, notifications and the avatar), the project title shrank to an empty dashed box. Help, the block count and the title then slid under the save button, and their text drew on top of each other.

The menu bar now measures how much room the main menu really has, keeping at least 120px for the project title. When it runs out, it drops one thing at a time:

  1. the save status text (the coloured dot and the tooltip still show it)
  2. the menu labels (icons stay)
  3. the save button label
  4. the full menu, behind the More button

It goes back up a step only once the space that step saved is free again, so the bar doesn't flicker at the boundary. The old viewport breakpoints stay as a floor.

Before

At 1200px with a wide right side, the block count, "Save to your computer" and "Unsaved changes" draw over each other and the title is a dashed sliver.
Before, 1200px

After

At 1700px only the status text is dropped.
After, 1700px

At 1300px the menu shows icons only and the save button shows its icon and status dot.
After, 1300px

At 1200px the menu moves behind the More button and the title keeps its room.
After, 1200px

The More menu still shows its labels.
More menu open at 1200px

The window narrowing from 1700px to 950px and back.
Resizing

The screenshots widen the right group with [data-mw-item="mw-editor-nav"]{min-width:300px} to match a signed-in account, since the dev server editor runs without community sign-in.

Testing

  • test/unit/lib/mw-menu-bar-fit.test.js covers the measurement and the step up and step down rules.
  • Resized a live editor through 1800, 1600, 1400, 1250, 1100, 950 and 800px and back, plus 1px steps around a boundary, with and without the wide right group. Main menu items never overlapped the right group, and the fit level changed once per step with no follow-up changes after settling.
  • lint, i18n checks, community CSS check, deps check and all unit tests pass.

The menu bar only collapsed at fixed window widths, so when the right side
was wide (signed in, with a long save status) the project title shrank to
an empty box and Help, the block count and the title slid under the save
button. Measure the free space instead and drop the save status text, menu
labels, the save label and finally the full menu, one step at a time.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying scratch-gui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3d70755
Status: ✅  Deploy successful!
Preview URL: https://0c0a86e6.scratch-gui.pages.dev
Branch Preview URL: https://fix-menu-bar-overlap.scratch-gui.pages.dev

View logs

@Mistium
Mistium merged commit 18beab9 into develop Oct 8, 2026
4 checks passed
mc20000-01 pushed a commit to mc20000-01/scratch-gui that referenced this pull request Nov 7, 2026
Fit the menu bar to the space it has instead of fixed breakpoints
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