Skip to content

Drafts stay with their document; Library restore/quote; deterministic popup tests - #85

Merged
changl merged 4 commits into
changl/fixesfrom
changl/fix-drafts
Nov 1, 2026
Merged

changl merged 4 commits into
changl/fixesfrom
changl/fix-drafts

Conversation

@changl

@changl changl commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Bug fixes for the page in the browser: drafts, Library, flaky popup tests.

agent-annotate-hnc: drafts filed under the wrong document

  • Reproduced on 2.28.0. Three Chrome tests fail there. On an FLD copy in WebKit (iPad Pro 11), switching from Review to Plans copied a Review card's typed text into plan:ask-nicole-live's drafts.
  • Cause: setDraft wrote to draftsKey(DOC) at the moment of writing. DOC changes while another document loads, and PLAN_ID changes when a plan is withdrawn. The rail's redraw also collected the boxes still on screen into the drafts of the document being drawn.
  • Fix (shell.js):
    • each drafts object keeps the key it was loaded from;
    • card boxes write to the drafts the cards were drawn from, and general feedback and the composer to those of the document on screen;
    • a plan switch parks the view until the next plan shows.
  • Tests: tests/browser/test_draft_document_keys.py

agent-annotate-5uy: typed answer lost when a card is withdrawn

  • Does not reproduce on 2.28.0. When the agent withdraws, rewords or resolves the card, the typed text stays visible with the "card changed" note, Send counts it and the Send dialog lists it.
  • Checked in Chrome (7 tests on 064b1d5) and on the FLD copy in WebKit iPad.
  • Proof test added: test_withdrawn_question_keeps_typed_answer_and_its_send_count (rail and document box, focus held).

agent-annotate-b0f: Library

  • Restore over unsaved edits now asks with confirm(), as the page already does before deleting unsent work.
  • A comment started on a selected phrase keeps its quote, per item, across a reload or an item switch, and Save posts it as selected_quote.
  • Both reproduced on 2.28.0. Tests: tests/browser/test_library_drafts.py

agent-annotate-srw: flaky ticket-link test

  • Cause: headless Chrome, not the Send dialog. Once another tab is in front, Chrome holds every answer the tab behind it owes Playwright (mouse-up ack, hit-target check, evaluate) until that tab's own next timer, 0.2 s to over 30 s. CDP logs and LoAF timings showed this.
  • Fix: the link tests still check the link is clickable and takes focus, then click it from a timer inside the page, and still require the new tab to open on the ticket with the draft kept.
  • The two-tab draft test failed on 2.28.0 for the same reason; it now reads from the first tab after bringing it to the front.
  • Proof: 40 runs in a row of the ticket-link case and 20 of the two-tab case passed, part of it under load.

Test runs

  • Non-browser: A-F 705 passed (2 skipped), G-P 614, Q-Z 364, monitor 16.
  • Browser: A-F 106, G-P 49, Q-Z 94.
  • ruff check clean.

🤖 Generated with Claude Code

changl and others added 4 commits October 31, 2026 22:42
A draft typed while another plan loaded, or in a plan that was withdrawn,
was filed under the other plan's drafts key. Each drafts object now keeps
its own key, typing writes to the drafts the visible boxes came from, and a
plan switch parks the view while the next plan loads. Adds a proof test for
agent-annotate-5uy (does not reproduce on 2.28.0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s keep their quote (agent-annotate-b0f)

Restore over unsaved editor text now asks with confirm(), the page's pattern
for losing unsent work. The quoted phrase of an unsaved Library comment is
kept per item in this browser, so a reload or item switch keeps it and Save
posts it as selected_quote.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…iting on the throttled opener (agent-annotate-hnc, agent-annotate-srw)

hnc: the rail's redraw harvested the boxes on screen into the drafts of the
document being drawn, so a tab switch copied Review card text into the plan's
drafts. Card boxes now write to the drafts the cards were drawn from; the
general feedback box and composer to those of the document on screen.

srw: the new tab takes the foreground and headless Chrome throttles the opener
behind it, which answered Playwright's after-click checks (hit-target stop,
Page.enable) only when its own next timer fired, 0.2 s to over 30 s. The two
popup tests click with no_wait_after and still require the tab to open on the
expected URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t-annotate-srw)

Once another tab is in front, headless Chrome holds every answer the tab
behind it owes Playwright (mouse-up ack, hit-target check, evaluate) until
that tab's own next timer, 0.2 s to over 30 s. The link tests check the link
is clickable and takes focus, then click it from a timer inside the page;
the two-tab draft test reads from the first tab after bringing it to front.
40 consecutive runs of the ticket-link case and 20 of the two-tab case pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changl
changl merged commit bee9817 into changl/fixes Nov 1, 2026
1 check passed
@changl changl mentioned this pull request Nov 2, 2026
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.

1 participant