Skip to content

Commit 2def722

Browse files
committed
Expose retained draft selection to assistive technology
1 parent 5820e6e commit 2def722

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎docs/implementation/read-only-review.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,5 @@ Held-response browser regressions reproduced Refresh replacing newer question/ch
118118
The browser owns unsent text, mode, navigation, and attachments; the refreshed response owns the persisted plan, approvals, notes, and snapshot. Refresh remains serialized with review actions and invalidates older question polls through the existing generation counter. A valid attached snippet survives; changed snapshot or assignment context keeps the text and marks the attachment outdated, blocking submission until it is removed or reselected. Removed items with drafts remain accessible as retained-draft rows, with submission disabled and instructions to copy the text to a current item. These drafts remain page-local and do not survive a browser reload.
119119

120120
The regression gate is `npm run test:browser -- --grep 'during refresh'`. It checks visible drafts and refreshed durable approval/snapshot/plan state, and confirms no draft was accidentally saved as a note. Issues #10 (review edge cases), #12 (polling efficiency), and #3 (human go/no-go experiment) remain separate work.
121+
122+
PR #14 review round 1 found that retained-draft rows omitted the regular rows' `aria-current` state. A browser assertion reproduced the missing attribute. Retained rows now expose their selected state; the regression checks selection, navigation away, and selection again. No findings were declined.

‎test/browser/review.spec.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,12 @@ for(const scenario of ['navigation','snapshot','removed item','failure']) test(`
288288
}
289289
if(scenario==='removed item'){
290290
await expect(page.locator('#item-details')).toContainText('no longer in the plan');await expect(page.locator('#save-note')).toBeDisabled();
291+
await expect(page.getByRole('button',{name:'! P1 · Retained draft',exact:true})).toHaveAttribute('aria-current','true');
291292
await expect(page.getByRole('button',{name:/P1 Bound exponential retries/})).toHaveCount(0);
292-
await page.getByRole('button',{name:/P2 Document retry behavior/}).click();await page.getByRole('button',{name:'! P1 · Retained draft',exact:true}).click();
293+
await page.getByRole('button',{name:/P2 Document retry behavior/}).click();
294+
await expect(page.getByRole('button',{name:'! P1 · Retained draft',exact:true})).toHaveAttribute('aria-current','false');
295+
await page.getByRole('button',{name:'! P1 · Retained draft',exact:true}).click();
296+
await expect(page.getByRole('button',{name:'! P1 · Retained draft',exact:true})).toHaveAttribute('aria-current','true');
293297
await expect(page.locator('#message')).toHaveValue('Latest question');await expect(page.locator('#message')).toBeEnabled();
294298
expect(app.service.load().items.map(item=>item.id)).toEqual(['P2','P3']);
295299
}

‎web/public/app.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function render() {
173173
`<button class="plan-row ${row === selected ? "selected" : ""}" data-select="${row}"><span class="row-title ${row === "Unplanned" ? "bad" : row === "Ambiguous" ? "warn" : "muted"}">${row === "Unplanned" ? "✕" : row === "Ambiguous" ? "!" : "✓"} ${row}${row === "Unplanned" ? " changes" : ""}<span class="count">${data.segments.filter((s) => s.row === row).length}</span></span></button>`,
174174
)
175175
.join("") + retainedItems.map((id) =>
176-
`<button class="plan-row ${id === selected ? "selected" : ""}" data-select="${esc(id)}"><span class="warn">! ${esc(id)} · Retained draft</span></button>`,
176+
`<button class="plan-row ${id === selected ? "selected" : ""}" data-select="${esc(id)}" aria-current="${id === selected ? "true" : "false"}"><span class="warn">! ${esc(id)} · Retained draft</span></button>`,
177177
).join("");
178178
document
179179
.querySelectorAll("[data-select]")

0 commit comments

Comments
 (0)