Skip to content

Commit 54e73bf

Browse files
committed
fix(codex-auth): preserve reset ticket badge styling
1 parent 57b4a8b commit 54e73bf

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

devlog/290_rate-limit-reset-credits/02_ui-spec.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ function TicketBadge({ account, onClick }: { account: AccountEntry; onClick: ()
246246
```
247247

248248
Uses `<button>` instead of `<span>` for accessibility (keyboard focus, screen reader).
249+
The `badge-clickable` class must not override `background`, `border`, or `font`;
250+
the visual badge variant (`badge-amber`, `badge-muted`, `badge-primary`) owns those styles.
249251

250252
### Reset Credit Popup (new modal, after existing confirm modal)
251253

gui/src/styles.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
183183
.model-card .id { font-family: var(--mono); font-weight: 600; font-size: 13px; letter-spacing: -0.01em; color: var(--text); }
184184

185185
/* ---- badges / status dot ---- */
186-
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; font-family: var(--mono); letter-spacing: 0.01em; }
186+
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1px solid transparent; font-family: var(--mono); letter-spacing: 0.01em; }
187187
.badge-accent { background: var(--accent-soft); color: var(--accent-hover); }
188188
.badge-green { background: var(--green-soft); color: var(--green); }
189189
.badge-amber { background: var(--amber-soft); color: var(--amber); }
190190
.badge-muted { background: var(--raised); color: var(--muted); border: 1px solid var(--border); }
191-
.badge-clickable { cursor: pointer; transition: filter 0.12s; border: none; background: inherit; font: inherit; }
191+
.badge-clickable { cursor: pointer; transition: filter 0.12s; appearance: none; }
192192
.badge-clickable:hover { filter: brightness(1.1); }
193193
.badge-disabled { opacity: 0.5; cursor: default; }
194194
.confirm-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--amber-soft); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; color: var(--amber); }

tests/rate-limit-reset-credits.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ describe("rate-limit reset credits", () => {
9898
expect(source).toContain("if (credits === undefined) return null;");
9999
expect(source).toContain("className={`badge ${hasCredits ? \"badge-amber\" : \"badge-muted\"} badge-clickable`}");
100100
});
101+
102+
it("keeps clickable ticket badges from overriding visual badge colors", async () => {
103+
const styles = await Bun.file("gui/src/styles.css").text();
104+
const match = styles.match(/\.badge-clickable\s*\{([^}]*)\}/);
105+
expect(match).not.toBeNull();
106+
expect(match![1]).not.toContain("background:");
107+
expect(match![1]).not.toContain("border: none");
108+
expect(styles).toContain("border: 1px solid transparent");
109+
});
101110
});
102111

103112
describe("updateAccountQuota resetCredits", () => {

0 commit comments

Comments
 (0)