console: claim finishing box drops its button; Check again stays on stuck
Paul: the page re-checks by itself, so a committed claim that is slow to finish shows the finishing message with nothing to press and keeps polling every 10 s. Only the really-long rollback-deadline stuck box keeps Check again. No new strings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+7
−1
internal/console/templates/demo_claim.html+1 −1internal/console/testdata/demo_claim_resume_browser.mjs+6 −0
CI passed — run details
Intent
Attributed to this commit: 22.4 g CO₂e (2,795,865 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on claim-picker-rows, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/internal/console/templates/demo_claim.html b/internal/console/templates/demo_claim.html| index 23c3ad987..040865493 100644 |
| --- a/internal/console/templates/demo_claim.html |
| +++ b/internal/console/templates/demo_claim.html |
| @@ -268,7 +268,7 @@ |
| <div id="claim-progress" data-stage="{{.Step}}"{{if .AutoSubmit}} data-pending{{end}}{{with .CommittedFor}} data-committed-for="{{.}}"{{end}}{{with .DeadlineIn}} data-deadline-in="{{.}}"{{end}} data-failure-heading="{{.Copy.failureHeading}}" data-neutral="{{.Copy.resuming}}" data-stopping="{{.Copy.stopping}}" data-copying="{{.Copy.copying}}" data-starting="{{.Copy.starting}}" data-done="{{.Copy.done}}" data-aborted="{{.Copy.aborted}}" data-poll-failed="{{.Copy.pollFailed}}"> |
| <p id="claim-status"{{if gt .Step 0}} class="claim-sr-only"{{end}} role="status" aria-live="polite">{{if eq .State "stopping"}}{{.Copy.stopping}}{{else if eq .Step 2}}{{.Copy.starting}}{{else if eq .Step 1}}{{.Copy.copying}}{{else}}<span class="claim-spinner" aria-hidden="true"></span>{{.Copy.resuming}}{{end}}</p> |
| <div id="claim-stuck" class="claim-stuck" role="alert" hidden><p><strong>{{.Copy.stuckHeading}}</strong></p><p class="claim-detail">{{.Copy.stuckDetail}}</p><a class="btn btn-sm" href="/demo/claim">{{.Copy.stuckAction}}</a></div> |
| -<div id="claim-finishing" class="claim-stuck" role="status" hidden><p><strong>{{.Copy.finishingHeading}}</strong></p><p class="claim-detail">{{.Copy.finishingDetail}}</p><a class="btn btn-sm" href="/demo/claim">{{.Copy.stuckAction}}</a></div> |
| +<div id="claim-finishing" class="claim-stuck" role="status" hidden><p><strong>{{.Copy.finishingHeading}}</strong></p><p class="claim-detail">{{.Copy.finishingDetail}}</p></div> |
| <div class="claim-transit" aria-hidden="true"><span>{{icon "layers"}}</span><span class="claim-track"><i></i><i></i><i></i></span><span class="claim-home">{{icon "server"}}</span></div> |
| {{if ne .State "stopping"}}<div class="claim-bar" role="progressbar" aria-label="{{.Copy.progressLabel}}" aria-valuemin="0" aria-valuemax="100"><i></i></div> |
| <p id="claim-elapsed" class="claim-elapsed" data-template="{{.Copy.elapsed}}" hidden></p>{{end}} |
diff --git a/internal/console/testdata/demo_claim_resume_browser.mjs b/internal/console/testdata/demo_claim_resume_browser.mjs| index 09829df99..5b54820ea 100644 |
| --- a/internal/console/testdata/demo_claim_resume_browser.mjs |
| +++ b/internal/console/testdata/demo_claim_resume_browser.mjs |
| @@ -316,6 +316,7 @@ try { |
| await until('document.getElementById("claim-stuck")?.hidden === false'); |
| assert.equal(await evaluate('document.getElementById("claim-stuck").getAttribute("role")'),'alert'); |
| assert.equal(await evaluate('document.querySelector("#claim-stuck a").getAttribute("href")'),'/demo/claim'); |
| + assert.equal(await evaluate('document.querySelectorAll("#claim-stuck a").length'),1,'only the really-long case offers Check again'); |
| assert.equal(await evaluate('document.getElementById("claim-progress").hasAttribute("data-stuck")'),true); |
| assert.equal(await evaluate('document.querySelector("li[aria-current=step] .claim-step-detail").textContent'),original,'stuck page still rotates reassurance'); |
| await capture('stuck'); |
| @@ -333,6 +334,11 @@ try { |
| assert.equal(await evaluate('document.getElementById("claim-progress").hasAttribute("data-stuck")'),false); |
| assert.equal(await evaluate('document.getElementById("claim-finishing").innerText.includes("undone")'),false); |
| assert.equal(await evaluate('document.getElementById("claim-finishing").getAttribute("role")'),'status'); |
| + // The page re-checks by itself; a finishing claim offers nothing to press. |
| + assert.equal(await evaluate('document.querySelectorAll("#claim-finishing a, #claim-finishing button").length'),0,'finishing box has an action'); |
| + const finishingPolls = statusRequests; |
| + for (let i=0; i<120 && statusRequests === finishingPolls; i++) await new Promise(r=>setTimeout(r,100)); |
| + assert(statusRequests > finishingPolls, 'finishing box stopped checking'); |
| assert(await evaluate(bar) >= 90, 'committed bar below its band'); |
| await capture('committed-finishing'); |
| assert.equal(await evaluate('document.getElementById("claim-stuck").hidden'),true,'rollback box appeared later'); |