Repository navigation
Show account email, token-account label and Codex credits on cards #820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
bd083d5
Show account email, token-account label and Codex credits on cards
Finesssee 8ac5c7e
Merge remote-tracking branch 'origin/main' into feat/mac-fields-identity
Finesssee 786bcc0
Merge remote-tracking branch 'origin/main' into feat/mac-fields-identity
Finesssee cb17161
Hide the token-account label under Hide Personal Info like upstream
Finesssee 4c2a841
Merge remote-tracking branch 'origin/main' into feat/mac-fields-identity
Finesssee c0dae63
Merge branch 'main' into feat/mac-fields-identity
Finesssee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
40 changes: 40 additions & 0 deletions
40
apps/desktop-tauri/src/components/MenuCard.headerAccount.test.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import { describe, expect, it } from "vitest"; | ||
| import { headerAccount, maskEmail } from "./MenuCard"; | ||
|
|
||
| describe("headerAccount", () => { | ||
| it("prefers the provider email over the token-account label", () => { | ||
| expect( | ||
| headerAccount({ accountEmail: "parity.user@example.com", accountLabel: "Work" }, false), | ||
| ).toBe("parity.user@example.com"); | ||
| }); | ||
|
|
||
| it("falls back to the active token-account label", () => { | ||
| expect(headerAccount({ accountEmail: null, accountLabel: "parity-github" }, false)).toBe( | ||
| "parity-github", | ||
| ); | ||
| expect(headerAccount({ accountEmail: " ", accountLabel: " parity-github " }, false)).toBe( | ||
| "parity-github", | ||
| ); | ||
| }); | ||
|
|
||
| it("masks the email and hides the label under Hide Personal Info", () => { | ||
| expect(headerAccount({ accountEmail: "parity.user@example.com" }, true)).toBe( | ||
| "p••••••••••@example.com", | ||
| ); | ||
| expect( | ||
| headerAccount({ accountEmail: null, accountLabel: "parity-github" }, true), | ||
| ).toBeNull(); | ||
| expect( | ||
| headerAccount({ accountEmail: null, accountLabel: "parity.user@example.com" }, true), | ||
| ).toBeNull(); | ||
| }); | ||
|
|
||
| it("shows nothing without an email or label", () => { | ||
| expect(headerAccount({ accountEmail: null }, false)).toBeNull(); | ||
| expect(headerAccount({ accountEmail: null, accountLabel: "" }, true)).toBeNull(); | ||
| }); | ||
|
|
||
| it("masks a non-email label completely", () => { | ||
| expect(maskEmail("parity-github")).toBe("••••@••••"); | ||
| }); | ||
| }); |
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Attach the label only when the fetch uses that token account.
If Claude uses a selected manual cookie,
build_fetch_contextgives that cookie precedence over the active token-account credential. This assignment still attaches the token-account label. When the cookie response has no email, the card displays the token account’s label beside the cookie account’s quota. Carry the effective account selection frombuild_fetch_context, and omit the label when another source wins.🤖 Prompt for AI Agents