From 8862ff85a2d31bbd670be9b4f55f1be6bf275d9b Mon Sep 17 00:00:00 2001 From: jackwener Date: Tue, 30 Jun 2026 23:01:26 +0800 Subject: [PATCH] PR-MODEL-ROW-AND-OAUTH-EMAIL-FIX-0: 2 of 6 bug bundle (WAWQAQ c71b4dcb / 77221a77) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two of WAWQAQ's screenshots flagged 6 issues. This PR ships the 2 with clean root causes (1 CSS + 1 backend); 4 others split out per scope: ### Bug 1 fixed: model-row second line clipped (1 of 4 model-list bugs) `.modelTableRow` is a `Button` primitive whose default `size="md"` ships `h-9` (36px fixed). Each row now has TWO text lines (display name + raw id when `showRawId`), so the second line's lower descender got clipped ("gpt-5.4" → "ant 5.4" in the screenshot). Override on the recipe: height: auto; min-height: 44px; padding: 8px 10px; /* was 4px 8px */ This also resolves the apparent "middle row has a different background" bug — the user just hovered/focused that row; with the taller row it reads as expected hover state, not a separate visual. ### Bug 6 fixed: OAuth display name leaks user email `apps/desktop/src/main/main.ts` was constructing the connection display name as `Claude OAuth · ${state.profile.email}` (and the symmetric Codex path). That value is persisted as `connection.name` and surfaces in every model picker, settings dropdown, account list, and capability audit — anywhere the connection is identified by name. The email belongs on the Account · 模型 page, not in model identity. Both paths now use brand-only labels: const displayName = 'Claude OAuth'; const displayName = 'Codex OAuth'; The email is still available via the OAuth state for the dedicated account surfaces that legitimately need it. Existing stored connections will refresh to the brand-only name on next sync. ### NOT in this PR — split out for scope - **Bug 5 (default-model dropdown lacks model selection)** — requires a new IPC contract (`setDefault({slug, model})` vs current slug-only), plus rewiring `GeneralDefaultsCard` onto the grouped `Select` pattern that `ChatModelSwitcher` already uses. Separate backend-touching PR. - **Bug 3 (row title truncation not matching second-line truncation)** — `.modelTableRowId` already has `overflow:hidden + text-overflow: ellipsis` per current CSS; the screenshot's apparent mismatch was the same height-clip as bug 1 misread as horizontal truncation. Fixed transitively by the bug-1 height fix. - **Bug 4 ("mint refresh button" misattributed to PR #329 L3)** — PR #329's L3 commit was not merged (only the vibrancy unblock from L1 shipped via `7d008d51`). The sage-green refresh button is the existing `Button variant="default"` rendering `--primary`, unchanged. No fix needed. ### Tests `tsc --noEmit` clean against my edits. The two pre-existing errors (`displayName` in `model-catalog-choices.test.ts` and `recordActiveFullCompactBlock` in `main.ts:888`) also fail on `main` without my changes; unrelated to this PR. --- apps/desktop/src/main/main.ts | 17 +++++++++++++---- .../styles/settings/provider-editor.css | 11 ++++++++++- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/apps/desktop/src/main/main.ts b/apps/desktop/src/main/main.ts index 235272eb00..9133937793 100644 --- a/apps/desktop/src/main/main.ts +++ b/apps/desktop/src/main/main.ts @@ -343,9 +343,15 @@ async function syncClaudeSubscriptionConnection(): Promise const defaults = PROVIDER_DEFAULTS['claude-subscription']; const fallbackModels = defaults.fallbackModels.map((id) => ({ id })); - const displayName = state.profile?.email - ? `Claude OAuth · ${state.profile.email}` - : 'Claude OAuth'; + // PR-OAUTH-NAME-EMAIL-STRIP-0 (WAWQAQ msg `77221a77` 2026-06-30): the + // connection display name used to embed the OAuth account email + // (`Claude OAuth · user@example.com`). That value leaks the user's + // account identity into every model picker, settings dropdown, and + // anywhere else `connection.name` shows up. The email belongs on the + // Account · 模型 page, not in the model identity. Use the brand-only + // label here; the email is still available via the OAuth state for + // the dedicated account surfaces that legitimately need it. + const displayName = 'Claude OAuth'; const now = Date.now(); const connection: LlmConnection = { slug: CLAUDE_SUBSCRIPTION_CONNECTION_SLUG, @@ -399,7 +405,10 @@ async function syncCodexSubscriptionConnection(): Promise normalizedModels.map((entry) => entry.id), defaults.fallbackModels[0] || '', ); - const displayName = state.email ? `Codex OAuth · ${state.email}` : 'Codex OAuth'; + // PR-OAUTH-NAME-EMAIL-STRIP-0 — same email-leak fix as Claude OAuth + // above. Codex's was the one that surfaced in the screenshot, but the + // symmetric Claude path had the same shape; both now use brand-only. + const displayName = 'Codex OAuth'; const now = Date.now(); const connection: LlmConnection = { slug: CODEX_SUBSCRIPTION_CONNECTION_SLUG, diff --git a/apps/desktop/src/renderer/styles/settings/provider-editor.css b/apps/desktop/src/renderer/styles/settings/provider-editor.css index c100e43975..60592dc458 100644 --- a/apps/desktop/src/renderer/styles/settings/provider-editor.css +++ b/apps/desktop/src/renderer/styles/settings/provider-editor.css @@ -350,13 +350,22 @@ grid-template-columns: 16px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; - padding: 4px 8px; + padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--foreground); text-align: left; transition: background var(--duration-base) var(--ease-out-strong), border-color var(--duration-base) var(--ease-out-strong), box-shadow var(--duration-base) var(--ease-out-strong); + /* PR-MODEL-ROW-HEIGHT-FIX-0 (WAWQAQ msg c71b4dcb 2026-06-30): the + Button primitive ships size=md = `h-9` (36px fixed), but each row + now has TWO lines (display name + raw id when shown). The fixed + height clipped the second line's lower descender (gpt-5.4 → "ant + 5.4"). Override to auto height with a comfortable min-height; the + padding above plus the inner 2px gap leaves room for the second + line without breaking single-line rows. */ + height: auto; + min-height: 44px; } .modelTableRow:hover {