Skip to content

fix(client): remove place-items: center from body so app fills window width#1375

Open
aicayzer wants to merge 1 commit into
modelcontextprotocol:mainfrom
aicayzer:fix/full-window-width
Open

fix(client): remove place-items: center from body so app fills window width#1375
aicayzer wants to merge 1 commit into
modelcontextprotocol:mainfrom
aicayzer:fix/full-window-width

Conversation

@aicayzer
Copy link
Copy Markdown

Summary

Closes #876.

The Vite/React template default body { place-items: center; ... } shipped into client/src/index.css keeps the app centered with visible blank margins on wide windows — see the before/after screenshots in #876. Removing the rule lets the React tree fill the viewport width as expected.

Fix

  • client/src/index.css — drop place-items: center from the body rule. Keep margin: 0, min-width: 320px, min-height: 100vh.
  • client/e2e/full-window-width.spec.ts (new) — Playwright regression with two assertions:
    • On a 1920×1080 viewport, #root's getBoundingClientRect().width is within 20px of the viewport width (scrollbar tolerance).
    • getComputedStyle(document.body).placeItems does not contain "center", so a future template paste-in can't silently reintroduce the bug.

Test plan

  • npm run lint clean
  • npm test — 515 tests passing
  • npx playwright test full-window-width.spec.ts --project=chromium — 2 passed
  • Re-ran the new spec against the pre-fix state with git stash: body does not center its children via grid fails on place-items: center, passes after removal — regression coverage works
  • Manual: opened the dev server on a wide window, confirmed the app now spans the full viewport

… width

The Vite/React template default `place-items: center` on <body> kept the
app centered with empty side margins on wide windows. Drop the rule and
add a Playwright regression covering both root-width and the computed
body style.

Fixes modelcontextprotocol#876.
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.

UI not using full window width due to place-items: center on <body>

1 participant