Skip to content

fix: cap the re-auth banner width and move its flat CSS into the Paper theme - #2266

Merged
cliffhall merged 1 commit into
v2/mainfrom
v2/fix/2218-reauth-banner-width
Sep 6, 2026
Merged

fix: cap the re-auth banner width and move its flat CSS into the Paper theme#2266
cliffhall merged 1 commit into
v2/mainfrom
v2/fix/2218-reauth-banner-width

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2218

Both findings from the v2.5.0 milestone-merge review (#2215), filed on #2218 rather than fixed in the merge PR.

1. The fixed 420px width overflowed a narrow viewport

ReAuthBannerBar set an unconditional w: 420. Because the banner is centred by left: 50% plus a translate(-50%, -50%), a viewport narrower than 420px made it overflow both edges equally — clipping the close button on one side and the action button on the other, which are the only two controls it has. Losing both is a dead end rather than a cosmetic clip: dismissing is not equivalent to re-authorizing, since "Authorize again" also clears the stale OAuth state that a plain reconnect leaves behind.

It is reachable on a narrow desktop window, not only a phone — the element is fixed-positioned against the viewport, so a browser docked to a third of a wide screen hits it.

The width is now capped rather than fixedmaw={420} with w="calc(100vw - 2rem)" — so the banner shrinks with a 1rem gutter on each side and the shadow and radius still read. Above 420px nothing changes.

Before / after, at a 360px viewport

Before After
Re-auth banner at a 360px viewport before the fix: the heading is clipped off the left edge and the close button off the right Re-auth banner at a 360px viewport after the fix: the whole banner fits with a gutter on each side, both the close button and the action button visible

2. transform / zIndex moved into a Paper theme variant

The same constant carried flat CSS in component-level styles. The file's existing comment is correct that Mantine exposes neither transform nor zIndex as a style prop — but that argues for the next tier in the repo's preference order (props → theme variant → CSS class), not for inline styles. Both now live in a reauth variant in clients/web/src/theme/Paper.ts, alongside the existing code, contained and panel variants, and the constant selects it with variant: "reauth".

Not actionable

The third finding on #2215 — an unterminated inline-code span in clients/web/src/lib/authToken.ts:18 — is incorrect. The line carries exactly two backticks, balanced. No change.

Tests

ReAuthBannerBar.test.tsx gains two cases beside the existing one: that the width is capped rather than fixed (width: calc(100vw - 2rem), max-width at 420px scaled), and that the centring offset arrives via the theme variant rather than inline styles. Nothing exercised this component below 420px before.

npm run local:gate passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LYcBw3Sftq5Yx4WpdzXttb

…r theme (#2218)

`ReAuthBannerBar` set an unconditional `w: 420`. Because the banner is centered
with `left: 50%` plus a `translate(-50%, -50%)`, a viewport narrower than 420px
made it overflow *both* edges equally — clipping the close button on one side
and "Authorize again" on the other, which are the only two controls it has.
Losing both is a dead end rather than a cosmetic clip, since dismissing is not
equivalent to re-authorizing ("Authorize again" also clears the stale OAuth
state). It is reachable on a narrow desktop window too, not only a phone: the
element is `fixed`-positioned against the viewport.

The width is now capped rather than fixed — `maw={420}` with
`w="calc(100vw - 2rem)"` — so the banner shrinks with a 1rem gutter on each
side and the shadow and radius still read.

The same constant also carried `transform` and `zIndex` as flat CSS in
component-level `styles`. Mantine exposes neither as a style prop, but that
argues for the next tier in the repo's preference order — a theme variant — not
for inline `styles`. Both move to a `reauth` variant in `theme/Paper.ts`,
alongside the existing `code`, `contained` and `panel` variants.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LYcBw3Sftq5Yx4WpdzXttb
Signed-off-by: cliffhall <cliff@futurescale.com>
@cliffhall cliffhall added the v2 Issues and PRs for v2 label Sep 6, 2026
@cliffhall
cliffhall requested a balanced review from Copilot September 6, 2026 03:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation resolves both reported issues and includes focused regression coverage.

Pull request overview

Fixes narrow-viewport overflow in the re-authentication banner and moves its positioning styles into the Paper theme.

Changes:

  • Makes the banner responsive while retaining a 420px maximum width.
  • Adds a reauth Paper theme variant for centering and stacking.
  • Tests responsive width and theme variant behavior.
File summaries
File Description
clients/web/src/theme/Paper.ts Adds the reauth Paper variant.
clients/web/src/components/groups/ReAuthBanner/ReAuthBannerBar.tsx Applies responsive sizing and the theme variant.
clients/web/src/components/groups/ReAuthBanner/ReAuthBannerBar.test.tsx Covers width constraints and theme styling.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation addresses both reported findings with focused regression coverage.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@cliffhall
cliffhall merged commit 5402aea into v2/main Sep 6, 2026
6 checks passed
@cliffhall
cliffhall deleted the v2/fix/2218-reauth-banner-width branch September 6, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ReAuthBannerBar overflows viewports narrower than 420px, and keeps flat CSS out of the Paper theme

2 participants