Skip to content

Windows hover card: show sign-in only when signed out, and give the flat notch its own size and room - #302

Merged
vinzdg merged 2 commits into
vinzdg:mainfrom
RawJat:fix/windows-claude-card-auth
Sep 22, 2026
Merged

vinzdg merged 2 commits into
vinzdg:mainfrom
RawJat:fix/windows-claude-card-auth

Conversation

@RawJat

@RawJat RawJat commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Three fixes to the Windows hover card, all visible in 1.16.0, in two commits: the Claude sign-in block, then the flat notch's geometry. Either commit can be dropped on its own.

1. Claude sign-in shows only when Claude is signed out

Follows up a note on #257's merge: the Sign in / Refresh buttons render on the Claude card unconditionally rather than only on needsAuth. Today every Claude hover shows them under a live reading.

  • The block now shows only while Claude's status is needsAuth, which is when the Mac's card shows its "Sign in to Claude Code to read your usage" line.
  • Only on the default account's card. claude_auth runs the CLI without CLAUDE_CONFIG_DIR, so the button always signs in ~/.claude. On a second account's card (windows: read every Claude account, not just ~/.claude #279) it would sign in a different profile from the one the card shows.
  • Refresh goes. It asked refresh_provider for Claude, which a click on the ring and the menu's Refresh now already do, so refresh_claude_usage and the three Russian strings only it used go too.
  • A background token renewal no longer shows as a disabled "Signing in…" on a signed-in card, since the block isn't drawn there. That was Windows: sign in to Claude directly from the usage card #257's other note.

The sign-in flow itself is unchanged.

2. A flat notch is drawn at its own size, and its card is placed right

#282 widened the top/bottom window from 520 to 650 px so a sixth ring would fit. The page keeps that width as DESIGN_W_FLAT for fitZoom, which reads a viewport wider than the design as a DPI disagreement, so the whole notch has been zoomed by 650/520 on the flat edges: a quarter larger than upright, and a size above what Size asks for.

The card came off worse. placeCard measures with getBoundingClientRect, which returns zoomed values, and writes styles, which are not, so its 30 px gap above the pill lands about 75 px low at 150 % — over the rings on a bottom notch, and on a notch lifted clear of the taskbar it reads as the card alone having missed it.

The page takes the window's width again. A test now reads both constants out of notch.html and compares them with notch_window_size, because nothing in the build reads the page.

3. The flat card gets the room the upright one has

Lying flat, the card opens above or below the pill rather than beside it, so max-height: calc(100% - 150px) leaves it the window less the pill's depth, the 30 px gap and the margins. The flat window was 520 tall against the upright window's 650, which left the card 370 px; a stale Antigravity card with two model groups measures 400, so it scrolled.

The flat window is square now, 650 on both sides, leaving the card 500 px — about what it had before the settings orb raised the upright window. NOTCH_H had no other reader, so it and NOTCH_UPRIGHT_H are one constant, NOTCH_LONG. The test asks for the room rather than the number.

Tests

  • cargo test (126, including the new guard, which fails on the old 520) and cargo clippy --all-targets (6 warnings, all pre-existing)
  • node scripts/test-claude-auth-ui.cjs, which now also covers when the sign-in block shows, and node scripts/check-ui-scripts.mjs
  • Live at 150 %, signed in: the Claude card shows no buttons
  • Live at 150 %: a bottom notch draws at the Size chosen, its card sits clear above the pill, and Antigravity's card does not scroll

Refs #257, #282

Since 1.16.0 the Claude card has carried Sign in and Refresh buttons
under every reading, signed in or not. The Mac's card offers nothing of
the kind while a reading comes through; signed out, it shows one line,
"Sign in to Claude Code to read your usage". The block now appears only
in that state, needsAuth, where it is the Windows way of acting on it.

It appears on the default account's card only. The CLI's login runs with
CLAUDE_CONFIG_DIR stripped, so it always signs in ~/.claude, and on a
second account's card it would have signed in a profile other than the
one the card shows.

Refresh goes. It asked refresh_provider for Claude, which a click on the
ring and the menu's Refresh now already do, so refresh_claude_usage and
the three Russian strings only it used go with it. A background token
renewal no longer turns the button into a disabled "Signing in…" on a
signed-in card either, since the block is not drawn there.

The decision sits inside the markers the sign-in test reads, so the test
now covers it.
The top and bottom window went from 520 to 650 px wide so a sixth ring
would fit. The page keeps that width as DESIGN_W_FLAT, because fitZoom
reads a viewport wider than the design as a DPI disagreement and zooms
the layout to close it; left at 520, it read the wider window as one and
zoomed the whole notch by 650/520.

So a flat notch has been drawn a quarter larger than the upright one and
a size bigger than the setting asks for. The card came off worse:
placeCard measures with getBoundingClientRect, which comes back zoomed,
and writes styles, which are not, so its 30 px gap above the pill landed
about 75 physical px low at 150 % — over the rings on a bottom notch,
and low enough on a lifted one to look as though the card alone had
missed the taskbar. The page takes the window's width again.

The card was short of room as well. Lying flat it opens above or below
the pill rather than beside it, so max-height: calc(100% - 150px) leaves
it the window less the pill's depth, the 30 px gap and the margins: 370
px, against 634 upright. A stale Antigravity card with two model groups
measures 400, so it scrolled, and a scrollbar in a 246 px card reads as
something being wrong with it. The flat window is square now, 650 on
both sides, which leaves the card 500 — about what it had before the
settings orb raised the upright window. NOTCH_H had no other reader, so
the two constants are one: NOTCH_LONG, the window's long side.

Two tests hold this together, because nothing in the build reads the
page: one compares both of notch.html's design widths with
notch_window_size, and the flat-window test asks for the card's room
rather than a number.
@RawJat
RawJat requested a review from vinzdg as a code owner September 21, 2026 18:46
@vinzdg
vinzdg merged commit 14ed08f into vinzdg:main Sep 22, 2026
4 checks passed
@vinzdg

vinzdg commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Merged as 1f30e2f. Thanks @RawJat.

I checked it against the three notch PRs of yours that landed on Thursday, since this touches the same area: notch_window_size still branches on edge, the carry and fold logic is untouched, and the 44px ring in a six-ring flat window survives. a_flat_notch_is_wide_enough_for_six_rings keeps its width assertion and swaps the height one for h - 150.0 >= 400.0, which is honest — it mirrors the max-height:calc(100% - 150px) on the card, and 650×650 satisfies it with room. The new the_pages_design_widths_are_the_window_widths test closing the fitZoom foot-gun is a good addition.

Showing sign-in only when signed out is the right call; it was rendering unconditionally on the Claude card since #257.

@RawJat
RawJat deleted the fix/windows-claude-card-auth branch September 23, 2026 06:37
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.

2 participants