Hide redeemed reset cards from the account menu

This commit is contained in:
2026-09-20 10:52:35 +08:00
parent c953126284
commit fba5880557
5 changed files with 84 additions and 21 deletions

View File

@@ -0,0 +1,50 @@
# Task: Hide used reset cards from account sidebar menu
## Identity
- Task ID: 20260920-hide-used-reset-cards-7a391bd2
- Mode: Feature
- Branch: codex/20260920-hide-used-reset-cards-7a391bd2-hide-used-reset-cards
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260920-hide-used-reset-cards-7a391bd2
- Base commit: c953126284eb81a3ac446c2213441db24e23929c
- Owner: codex
- Status: Ready for Integration
## Scope
- Hide redeemed reset cards from the lower-left account menu, including initial load and successful redemption, and show a suitable empty state.
- Update focused Sidebar tests, reset-card Electron fixture and README.
## Intent And Constraints
- User explicitly requested already-used cards no longer appear. Keep available/expired inventory behavior and server card/entitlement records unchanged.
- Retain explicit owner-authorized redemption, shared-wallet restrictions, confirmation semantics, and authoritative card/balance refresh.
- Concurrent Task Gate and Planning Gate passed. Isolated feature from c953126; prior sharing-removal and QR-completion commits included, no peer reset-card ownership conflict identified.
## Outcome
- Sidebar derives a visible list excluding cards with server status redeemed, used consistently for rows, loading/empty states, available count and shared-wallet notice.
- Removed the redeemed badge/date presentation. Existing available and expired card behavior stays unchanged.
- Confirmed redemption already updates card state before refreshing authoritative inventory and balance; the new projection removes the row immediately. When no visible cards remain, the drawer shows 暂无未使用的重置卡。
- README describes the account-menu behavior. Reviewed the complete diff and the Electron screenshot of the empty drawer with successful redemption feedback.
## Verification
- Pinned pnpm 10.33.4 frozen install: passed, lockfile unchanged.
- Sidebar token-point unit suite: 9 passed, covering mixed inventory, all-redeemed empty state, removal after redemption, refreshed balance, expired cards and shared-wallet restrictions.
- Typecheck and scoped ESLint on Sidebar, its unit test and reset-card E2E: passed.
- pnpm run build:vite: passed.
- Electron reset-card-wallet.spec.ts: 1 passed. Confirms row and count disappear, empty state is visible, balance refreshes and exactly one redemption is submitted.
- Visually inspected test-results/reset-card-wallet-Account--4d6fc-authoritative-point-balance/used-reset-card-hidden.png.
- git diff --check and task-aware check_doc_drift.py: passed. Electron uses a local Host fixture; no actual account reset card was consumed.
## Follow-ups
- Based on c953126 (QR completion), which includes e047877 (sharing removal). This task does not merge, package or deploy; the updated client is required to expose these changes.
## Promotion Candidates
- Target: .project-docs/40-domain/business-rules.md and .project-docs/30-worklog/current-state.md.
- Proposal: the account-menu reset-card inventory omits redeemed cards and removes a card on confirmed redemption, retaining authoritative card/balance refresh and owner/shared-wallet restrictions.
- Evidence: explicit user request, 9 unit tests and passing Electron scenario. Future impact: keep used-card history out of this compact action menu.
- Semantic conflict: none; this narrows display only, without deleting server history or changing redemption. Human confirmation is supplied by the request.