Repository navigation
feat(prototype): edit and withdraw a sent note on the notes host - #18042
kyle-sexton wants to merge 10 commits into
Conversation
A sent note could only be corrected or taken back by sending a second,
contradicting note. Its row now has Edit and Withdraw.
- POST /api/note/edit takes {"edit": seq, "text"} ($defs/edit): the text
replaces the note's own in the log under the same seq, and the edit is
logged as an event of its own naming the note, so the watcher wakes and
the session reads it as that note edited, not a new note.
- POST /api/note/withdraw takes {"withdraw": seq} ($defs/withdraw): the
note stays in the log and that event alone marks it withdrawn. Storing a
withdrawn flag on the note record would fail note.schema.json
(additionalProperties false), which the host page's reload, relocation and
import all re-check, and old logs carry no such event, so they load
unchanged.
- One is_note predicate replaces the "change" not in e checks, so an edit
or withdraw event is never listed as a note. A withdrawn note, and the
events changing it, leave status and the watcher's unhandled set; its
withdraw stays. The bridge refuses an edit, move or second withdraw of a
withdrawn note. record_change, record_edit and record_withdraw share one
record_naming.
- The note text limit moves to $defs/text so the note and the edit share
it; x-version 8.
- Host page: Edit opens the editor on the sent note (no Save draft, no
composer reshape, which would demote or only reshape the copy), Send
posts the edit; Withdraw lists the note as Withdrawn with no actions or
marker and leaves it out of Copy all notes. sendDrafts closes the editor
only when the entry it edits was in the batch.
Closes #17956
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
… test-scope The suite reads plugins/prototype/.claude-plugin/plugin.json through the browser test helpers, so a change to it must select the suite (scripts/affected-tests.sh R8). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lane run report
Run 44948312492, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
|
claude-security-review reviewed Security review: PR #18042 at
|
|
claude-review reviewed Code review: blocking issues onlyThis lane already reviewed earlier heads of this pull request, so this review reports only blocking findings. It is incremental: it covers the one file that changed since No blocking findings. What changed since the last review
Not verified by meThis run had no shell, so I did not run Earlier threadsBoth settled threads, on Other checks
Verifier dropped 0 of 0 candidates. |
…owser suite
A row's actions show only on the selected row (host.html .note:not([aria-current="true"]) .acts
{ display: none }), so the take timed out clicking a hidden Edit. It now clicks the row's text
first, as a person does. The suite's session prefix becomes edx, which typos accepts, and
numberOf's doc comment moves back onto numberOf.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The prefix rename joined edx and playwright-cli into one argument, so browser_setup took edxplaywright-cli as the session prefix and never checked for playwright-cli. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…aw-sent-note # Conflicts: # lib/ui-feedback/host.mjs # plugins/prototype/notes-bridge/host.mjs
Lane run report
Run 44951038552, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
Lane run report
Run 44951038552, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
…wn file TestEditAndWithdraw pushed test_notes_bridge.py across the 1000-line size reference. It is one concern, editing and withdrawing a sent note, so it moves whole to test_notes_edit.py and imports the shared case and fixtures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…import It imports test_notes_bridge, so it reads the session bridge, the controls and notes fixtures and schemas, and proto-pin.js; a change to any of them must select it (scripts/affected-tests.sh R8). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
A sent note on the notes host page could only be edited or deleted while it was a draft. A sent note's row now has Edit and Withdraw. An edit reaches the session as a change to the same note (same seq). A withdraw marks the note withdrawn in the list and tells the session, and a withdrawn note is not shown as pending.
Fix
$defs/changeinnote.schema.json(x-version 8):POST /api/note/edittakes{"edit": <seq>, "text": ...}($defs/edit). The text replaces the note's own in the log, under the same seq.POST /api/note/withdrawtakes{"withdraw": <seq>}($defs/withdraw).$defs/text, so the note and the edit share one definition.notes_bridge.py):is_notepredicate replaces the"change" not in echecks.record_change,record_editandrecord_withdrawsharerecord_naming. It validates the message against its schema definition and refuses a missing note, an event in place of a note, or a withdrawn note.read_statereportswithdrawn: true.statusand the watcher's unhandled set leave out a withdrawn note and the events that change it. They keep the withdraw event itself.docs/contracts/ui-feedback/README.md, the explore-directionsreference/feedback.md(what the session does with aneditorwithdrawevent), the host page header and the changelog fragment.Verification
python lib/ui-feedback/test_notes_bridge.py TestEditAndWithdraw: the 7 new tests fail on main (3 failures, 4 errors) and pass with the change.node --test lib/ui-feedback/*.test.mjs: 288 pass. The new edit and withdraw fixture cases fail on main, where$defs/editdoes not exist.python lib/ui-feedback/test_notes_bridge.pywith every class exceptTestLoop: 55 tests OK after merging origin/main.TestLoopfails on this Windows host on main too, because bash gets a backslash-stripped temp path. CI's Linux lane runs it.node --checkpasses on both copies of host.mjs.plugins/prototype/skills/explore-directions/scripts/notes-edit-browser.test.sh. It covers Edit and Withdraw in the list, both surviving a reload, the logged events, andstatus. It cannot run on Windows, so it has not been run; CI's Linux lane runs it.scripts/sync-shared-copies.shregenerated the plugin copies. A changelog fragment was added for prototype.Related
/api/note/change) uses the same "event naming a note" pattern, and this change extends it.Closes #17956
🤖 Generated with Claude Code