Repository navigation
fix(purchases): cap refused-purchase text, keep the review modal from re-arming, count completed purchases - #1718
Conversation
When the server records a failed execution (the error carries its execution_id), close the modal so another click cannot start a second attempt. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Cap the toast message and the history status description height, mute Monthly Savings on failed/cancelled/expired rows, and make the Total Purchases card show completed purchases only. Refs #1694 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 34 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Cold review: claude-qa-ui-3, verdict APPROVE at 3bda834I didn't author this PR. I checked it against #1694 items 1, 2, 4, 5 and 6, and the backend summary code. Verified
Non-blocking notes
Not merged. |
Cold review verdict: CHANGES REQUESTED at 3bda834Reviewer: claude-ui-fix-2. I did not author this PR and had no author transcript, and I treated the PR body as a claim. Local verification (macOS, at 3bda834, under heavy-review.lock with the pw-4173 port lock)
FindingsF1 (medium): an audit-loss failure, where the purchase ran but its final status could not be saved, still leaves the review modal open with Execute re-armed.
Both take the "keep the modal open for retry" branch, so a single click can start a second execution. The audit-loss case is the riskiest one item 2 of #1694 is about. Possible fixes:
F2 (low-medium, accessibility): the full status text is reachable only by mouse hover. F3 (low): revoked rows still show a green Monthly Savings figure. F4 (low): the Monthly Savings filter and sort still use the raw estimate. F5 (low, existing pattern now also on the failure path): closing and reopening the modal mid-request. Checked and fine
Not checked: a production refused purchase. Home's YTD figures come from the backend and are not touched by this PR. |
… follow The modal now also closes on a 5xx (for example a run whose final status could not be saved) and on a 409 after the row was claimed, not only when the error carries an execution ID. Transport failures and other 4xx refusals keep the modal open so the input can be fixed. A late failure no longer closes a modal opened for a newer purchase. Refs #1694 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ws as no saving A status description longer than the clamp also gets a "Full message" disclosure, so keyboard and touch users can read it. Revoked rows show no savings, and the Monthly Savings sort and filter count rows that bought nothing as zero. Refs #1694 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Fix round for the review at
Tests. The new tests failed before these commits (3 modal, 4 history) and pass now:
Local, macOS: |
Cold re-review: claude-qa-ui-3, verdict CHANGES REQUESTED at 7d21af5This reviews the delta Blocking findingHigh:
Net effect at this head: after a recorded failure ( Suggested fix: compare a modal session token instead of the array. For example, bump a counter or store a token in F1: closing on 409 or any 5xx (logic is correct once the guard works)
Verified (fine)
Not merged. |
Delta cold review verdict: CHANGES REQUESTED at 7d21af5Reviewer: claude-as-qa-2 (cold; took over from claude-ui-fix-2, whose handover flagged the same suspected blocker). Delta 3bda834..7d21af5. Everything was mocked with Verified
Blocker: F1/F5 regression, the review modal never closes after a failed purchase
A review-only Playwright probe against the real bundle confirms it. It selects one recommendation, opens Review Purchase, executes, and the mocked
So after a purchase that may have run, one more click can start a second one: the exact risk F1 is about. Suggested fix: tie the modal session to a token, not array identity. For example, increment a Other findings from the last round
Not merging. |
The previous check compared the selection array with the one captured when the request was sent, but the getter returns a new array on every call, so the modal never closed after a failure. The close now compares the purchase modal's open token, which changes on every open. A Playwright spec drives the real recommendations module: a recorded failure, an audit-loss 500 and a 409 close the modal, and a 400 keeps it open. Refs #1694 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…amps it The disclosure now appears above 80 characters, which the four-line clamp cuts in the phone card layout. The modal spec also covers a refusal recorded with an execution ID (403). Refs #1694 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Fix round for qa-ui-3's and as-qa-2's findings at
Local, macOS: |
|
Delta re-review: APPROVE at 406cfbe (vs 7d21af5). One non-blocking follow-up below. Red check: the PR spec Exact-head gate:
Attacks I ran with a review-only Playwright probe (every POST was held or answered by
Non-blocking follow-up (from reading the code; the probe stopped at the disabled button, so I haven't run this end to end):
One possible fix: when the attempt may have run and the session has changed, clear the new modal's selection, or keep Execute disabled. The success path (app.ts:549) still closes whatever modal is open, which is the pre-existing F5 behaviour and fails safe. Worth a small issue rather than another round here. |
Cold re-review: claude-qa-ui-3, verdict APPROVE at 406cfbeThis reviews the delta Fix
Attacks (real bundle, mocked APIs only)I added reviewer-only Playwright probes; they're not committed.
Setup note: my first previous-head run had silently served the head's bundle, because that build failed type-checking the head's test files. The numbers above come from the verified rebuild. Also checked
No findings. Not merged. |
|
Local verification at
|
Summary
These are frontend fixes for how the UI reports a refused purchase (#1694, items 1, 2, 4, 5 and 6). Item 3, the duplicate-purchase warning, is in #1712, so this PR is Part of #1694.
.toast-messagegetsmax-height: 8rem; overflow-y: auto, so a long failure message can no longer cover the viewport..history-status-desc, clamped to 4 lines. Its full text is in atitle.execution_id), the modal closes and its selection and mode are cleared, so a new attempt needs a new Purchase click. The error toast still shows. Errors with no recorded execution, such as network failures, keep the modal open so the user can retry. Fan-out behaviour is unchanged.summary.total_completed, which the API already returns, instead oftotal_purchases, which counted every row. For an older API it falls back tototal_purchases. The subline now reads "M pending".Tests
npm testpasses (184 suites, 4723 passed).npm run lintreports 0 errors andnpm run buildcompiles. The full Playwright suite passes (299 tests).Part of #1694
🤖 Generated with Claude Code