Windows hover card: show sign-in only when signed out, and give the flat notch its own size and room - #302
Merged
Conversation
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.
Owner
|
Merged as I checked it against the three notch PRs of yours that landed on Thursday, since this touches the same area: Showing sign-in only when signed out is the right call; it was rendering unconditionally on the Claude card since #257. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.needsAuth, which is when the Mac's card shows its "Sign in to Claude Code to read your usage" line.claude_authruns the CLI withoutCLAUDE_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_providerfor Claude, which a click on the ring and the menu's Refresh now already do, sorefresh_claude_usageand the three Russian strings only it used go too.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_FLATforfitZoom, 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.
placeCardmeasures withgetBoundingClientRect, 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.htmland compares them withnotch_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_Hhad no other reader, so it andNOTCH_UPRIGHT_Hare 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) andcargo 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, andnode scripts/check-ui-scripts.mjsRefs #257, #282