refactor(quota): simplify reset expiry display

- Remove redundant reset count and applicability labels
- Display each Codex and Claude reset expiry directly
- Improve reset expiry layout with clearer spacing and separators
- Update quota panel and quota page tests
This commit is contained in:
lzt404 committed 2026-10-05 00:45:17 +08:00
1 parent 1532bdb056
commit 7c3008dd81
8 files changed
+10 -19

No files matched your search

+2 -2
View File
@@ -31,8 +31,8 @@ describe('compact credential panels', () => {
expect(beforeDetails).not.toContain('Extra model');
expect(compact).toMatch(/<details[^>]*><summary>Details \(\+1\)<\/summary>.*Extra model.*Additional quota detail.*<\/details>/);
expect(compact).toContain('title="Reset Quota"');
expect(compact).toContain('2 manual resets');
expect(compact).toContain('Currently applicable: 0');
expect(compact).not.toContain('2 manual resets');
expect(compact).not.toContain('Currently applicable: 0');
expect(compact).not.toContain('credential-quota-refresh');
expect(compact).not.toContain(quota.plan!);
+2 -2
View File
@@ -30,9 +30,9 @@ it('shows reset credits beside the button while preserving applicability and exp
});
const resetButton = html.match(/<button[^>]*credential-quota-reset[^>]*>[\s\S]*?<\/button>/)?.[0];
expect(resetButton).toContain('Reset');
expect(html).toMatch(/credential-quota-reset-credits[^>]*>[^<]*2/);
expect(html).not.toContain('Manual resets');
expect(resetButton).not.toContain('disabled=""');
expect(html).toContain('Currently applicable: 0');
expect(html).not.toContain('Currently applicable: 0');
expect(html).toContain('Subscription expires');
});
-1
View File
@@ -57,7 +57,6 @@ test('loads grant counts and renders a working reset action on both surfaces', a
]) {
expect(html).toContain('Reset Quota');
expect(html).not.toContain('disabled=""');
expect(html).toContain('2');
}
updateQuotaCache({ [quotaKey(file)]: quota });
expect(await resetQuotaWithConfirmation(file, async () => false)).toBe('cancelled');
+1 -1
View File
@@ -18,7 +18,7 @@ describe('quota card rendering', () => {
expect(html).toMatch(/<button[^>]*title="Reset Quota"[^>]*>Reset Quota<\/button>/);
expect(html).not.toMatch(/<button[^>]*disabled=""[^>]*>Reset Quota<\/button>/);
expect(html).not.toContain('No applicable reset credits');
expect(html).toContain('Currently applicable: 0');
expect(html).not.toContain('Currently applicable: 0');
expect(html).not.toContain('temporary failure');
expect(html).toContain('Expires 01/01/2030, 00:00');
expect(html).not.toContain('Subscription expires:');