Skip to content

Preserve composer drafts during Refresh - #14

Merged
mchwang merged 2 commits into
mainfrom
codex/preserve-refresh-drafts
Sep 23, 2026
Merged

mchwang merged 2 commits into
mainfrom
codex/preserve-refresh-drafts

Conversation

@mchwang

@mchwang mchwang commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Refresh captured a draft before starting its request, so typing while it was in flight could be replaced with older text. It also hid drafts when a refreshed plan removed their item.

Capture the latest draft immediately before applying refreshed state and on failure. Preserve current mode, navigation, and valid attachments. Keep removed-item drafts accessible with submission disabled and instructions to copy the text to a current item; stale snippets retain their existing reselect warning. Drafts remain page-local.

Validation at final head 2def722: typecheck, 188 unit/integration tests, and 38 browser tests pass in CI; both push and PR workflows are green. The final local done-when check (npm run test:browser -- --grep 'during refresh') passes all six cases. Five held-refresh cases failed before the fix; failed-refresh recovery already passed. Working tree and diff checks are clean.

Review round 1: fixed the missing aria-current attribute on retained-draft rows. The browser assertion failed before the fix and passed afterward, checking selection, navigation away, and selection again. The thread is resolved; no findings were declined. Round 2 reviewed 2def722 and returned Findings: None, with approval recommended. No unresolved threads remain.

The implementation note records state ownership and regression evidence. Follow-ups #10, #12, and the human go/no-go experiment in #3 remain outside this change.

Closes #13.

Copilot AI lite review requested due to automatic review settings September 23, 2026 23:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Retained-draft rows must expose their selected state with aria-current for accessibility.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Preserves composer drafts, attachments, modes, and navigation across refreshes, including drafts for removed plan items.

Changes:

  • Captures drafts before applying refresh results and on failure.
  • Retains removed-item drafts with submission disabled.
  • Adds browser regression coverage and implementation documentation.
File Description
web/​public/​app.js Preserves drafts and renders retained drafts.
test/​browser/​review.spec.ts Adds refresh preservation regressions.
docs/​implementation/​read-only-review.md Records lifecycle ownership and validation evidence.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread web/public/app.js Outdated
Copilot AI review requested due to automatic review settings September 23, 2026 23:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved blocking issues were identified, and focused regressions cover the reviewed behavior.

Review effort: Lite
Findings: None

Resolved since last review (1)

@mchwang
mchwang merged commit 0cadca8 into main Sep 23, 2026
3 checks passed
@mchwang
mchwang deleted the codex/preserve-refresh-drafts branch September 23, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve composer edits during in-flight refresh

2 participants