Skip to content

feat(ui-feedback): keep a pick drawn until its note is sent or cancelled - #17812

Merged
kyle-sexton merged 8 commits into
mainfrom
fix/ui-feedback-selection-stays-drawn
Nov 21, 2026
Merged

kyle-sexton merged 8 commits into
mainfrom
fix/ui-feedback-selection-stays-drawn

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Closes #17800.

Summary

On the notes host, a picked element, marked region or selected text vanished the moment the comment box opened. You wrote a note without seeing what it was about. Now the pick stays drawn until the note is sent, saved as a draft or cancelled, and the note then shows as its numbered marker (a draft as D1, D2 and so on).

Fix

  • The notes host sends hold: true with every mode message. The frame helper (lib/ui-feedback/proto-pin.js) then keeps the pick outlined after pick mode ends. That covers a text pick made first on a fresh page.
  • The host sends release whenever the composer closes, and whenever it refuses a pick. A refused pick therefore leaves no outline behind.
  • While a pick is held, the frame swallows page clicks and keys, so the page under the selection stays inert.
  • After every list change the notes host sends the frame a pins message with each sent note by its number and each draft as D1, D2 and so on, placed at the box the note recorded. The frame already draws pins for the planning shared page; the notes host never sent one before.
  • A host that never sends hold, such as the planning shared page that inlines the synced copy, keeps today's behavior.
  • Copies regenerated with scripts/sync-shared-copies.sh. Under the ownership split agreed with the Interview Skill Improvements session, the only planning file this PR touches is the synced plugins/planning/shared/web/proto-pin.js.

Verification

  • node --test lib/ui-feedback/note-model.test.mjs: 138 pass. Five new tests cover held region, element and fresh-page text picks, the page staying inert while held, and a host that does not ask to hold. The held and inert tests fail without the frame change.
  • New notes-hold-browser.test.sh drives the real notes host with playwright-cli. It checks a fresh-page text pick, an element pick and a region pick: each is outlined with the composer open, and gone on cancel, send or save. After send, note 1 shows as its marker; after save as draft, the draft shows as D1 beside it. It also checks that a click under a held pick changes nothing. It runs in CI's Test Bash lane. It cannot run on this Windows machine, where browser-test-helpers.sh's mkdir -m 700 fails for every browser test, this one included.
  • plugins/planning/shared/tests/test_server.py TestPrototypePage: OK. The inlined pin helper matches the synced copy.

Not covered by a browser test: a refused pick. The fixture has no element the note contract refuses. The host now sends release on each refusal branch.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits November 21, 2026 00:18
The notes host asks the frame to hold the picked element, marked region or
selected text, so its outline stays on the page while the note is written
and goes on send, save or cancel. A host that does not ask, such as the
planning shared page, keeps today's behavior.

Closes #17800

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 21, 2026 05:25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T05:27:26.601301Z 40a30e2 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 40a30e2eb6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/ui-feedback/proto-pin.js Resolved
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 6a8dc78ccb51901d0ce489ed9dc4170c0254cb5a: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Security review (incremental, blocking only): PR #17812

No security issues found. I read every hunk of all four files in scope:

  • .changes/prototype/fix-ui-feedback-selection-stays-drawn-9b71a90d.md
  • lib/ui-feedback/host.html
  • plugins/prototype/notes-bridge/host.html
  • plugins/prototype/skills/explore-directions/scripts/notes-hold-browser-take.js

What changed

  • Changelog. The entry gets back its sentence saying that a sent note shows as its numbered marker and a draft as D1, D2 and so on.
  • The two notes hosts. Both copies are identical. On each render they now send a { type: "pins", pins: [...] } message to the prototype frame. Each pin carries:
    • n: the note's seq number, or D<i> for a draft.
    • selector: always an empty string.
    • rect.x / rect.y: taken from the note's stored rect.
  • Browser test script. It now also collects the frame's marker text and checks for marker 1 after a send and markers 1,D1 after a draft is saved.

What I checked

  • What crosses to the frame. The message goes through the existing toFrame helper (lib/ui-feedback/host.html:110). The new message carries only the note's sequence label and the x/y position the frame itself reported when the person picked the element. No token, note body or other host-only state goes with it. The host's statement that it alone holds the token and the network (host.html:6) still holds.
  • How the frame draws the pins. Nothing here can inject markup or script:
    • The frame's pins handler caps the list at 500 entries (proto-pin.js#L358).
    • badge() writes n through textContent and sets the position only through style properties (proto-pin.js#L210-L218).
    • placeOf() wraps querySelector in a try block and gets an empty selector here, so it falls back to the stored rect (proto-pin.js#L221-L227).
    • The data flows from the host into the sandboxed frame, so no new untrusted input reaches the host.
  • Test script. It runs in Playwright against the local fixture page and reads only DOM text. Nothing it reads goes to a shell or to eval.
  • Trust controls and instructions. None of the four files matches a trusted path. The push touches no trust control, merge hold, workflow, plugin manifest or standing instruction.
  • Earlier threads. This lane's only earlier post was a summary with no findings, and there are no settled threads, so nothing carries forward.

This review reported only CRITICAL and IMPORTANT findings, because the lane already reviewed an earlier head of this PR.

Spend: none.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-review: 4 inline finding(s) on 40a30e2eb60cd48b6b903439feb524bfcd4c0bae; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread lib/ui-feedback/proto-pin.js Resolved
Comment thread lib/ui-feedback/proto-pin.js Resolved
Comment thread lib/ui-feedback/host.html Resolved
Comment thread lib/ui-feedback/note-model.test.mjs Resolved
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 6a8dc78ccb51901d0ce489ed9dc4170c0254cb5a: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, blocking only): 609034d → 6a8dc78

This lane has already reviewed an earlier head of this pull request, so this review reports blocking findings only. I found none.

What this push changes

  • lib/ui-feedback/host.html and plugins/prototype/notes-bridge/host.html: both get the same change. render() now sends the frame a pins message. It carries one pin for each sent note, labelled with the note's seq, and one for each draft, labelled D1, D2 and so on. Each pin has selector: "" and the note's stored rect.x and rect.y.
  • notes-hold-browser-take.js: drawn() counts markers again. The region-send step now expects marker 1, and a new element-pick → save-as-draft step expects 1,D1.
  • The changelog fragment again says that sent notes and drafts show as markers.

What I checked in the head source

  • Units match. placeOf() in proto-pin.js (lines 221–226) reads p.rect as page percentages. That is what pct() / rectOf() (lines 110–118) produce for element, region and text notes. So a marker lands at the top-left of the note's stored box.
  • The empty selector is safe. document.querySelector("") throws. placeOf() catches that and falls back to the stored box. As a result, a marker does not follow its element on reflow, but nothing breaks.
  • The frame accepts the message. It takes pins as pins = m.pins.slice(0, 500); draw(); (line 358). toFrame drops the message until the frame is ready. mine is per page load, so no note exists before the frame is ready.
  • Ordering and the test filter work. send() and save() call render() and then closeComposer(), which sends release. So the frame draws the marker and then drops the held outline. In the test, the markers filter (!e.style.outline && e.textContent) skips the solid held outline and the dashed hover outline. Pins are sent with sent notes first and drafts after, so "1,D1" matches the order the host sends.

Closing issue #17800. This push now meets the criterion "after send it is replaced by the numbered marker", and the browser take tests it. The settled threads on lib/ui-feedback/note-model.test.mjs had deferred this to #17801. That deferral no longer applies, and there is nothing to raise again.

Not verified by me. This lane has no shell, so I did not run the browser test or the unit tests. Whether they pass in CI is the author's claim and is unverified.

Loosened checks. Loosened checks would be marked: fail. That is the default, because the prompt has no loosened_check_verdict: or loosened_check_patterns: lines; patterns: 0. This push makes the test's assertions stricter, not looser. The prompt has no loosened_check_decision_record: line, so I did not check the citation requirement.

Rules and manifests. This push changes no plugin manifest, and no path-scoped rule applies.

I used no verifier subagents and checked every hunk by hand.

Verifier dropped 0 of 0 candidates.

The frame took the host's hold request only when pick mode turned on, so a
text note made before any element or region pick was never held. Read the
request on every mode message, and cover the fresh-page text flow in a test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

PR body contract — issue linkage

This PR body conforms to the issue-linkage contract. Nothing to do.

@github-actions github-actions Bot added the needs-issue-linkage Pull request body has no issue linkage line; set by the check-contract step, advisory. label Nov 21, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-review: 1 inline finding(s) on cd8c384b8cadcde12661f7626f76812c85593d4e; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread lib/ui-feedback/note-model.test.mjs Resolved
… pick is held

A pick the host refuses now gets a release, so no stale outline is left on
the mockup. While a pick is held the frame swallows page clicks and keys,
as the issue's "stays inert" criterion asks. A browser test drives the
notes host through a fresh-page text pick, an element pick and a region
pick: each stays drawn with the composer open, goes on cancel or send, and
a sent note shows as its numbered marker.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot removed the needs-issue-linkage Pull request body has no issue linkage line; set by the check-contract step, advisory. label Nov 21, 2026
kyle-sexton and others added 3 commits November 21, 2026 00:43
…rker check

The notes host sends the frame no pins message, so a sent note draws no numbered marker; the test and the changelog no longer claim one. run-code already JSON-encodes the result, so the script returns plain text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

The pr-verify verifier failed head 609034d5deaf42267832a8872cdb539294fac03d. What it wrote, as data:

What it wrote (25 lines)
Summary: Issue #17800 is only partly delivered. The PR keeps a picked region, element or text drawn
  while the note is written, and clears it when the note is sent, saved as a draft, cancelled or
  refused. It keeps the page inert while a pick is held, and it syncs the shared copies. The new
  unit tests and notes-hold-browser.test.sh cover this, and every CI test job passed (for example
  Test Bash (0):
  https://github.com/melodic-software/claude-code-plugins/actions/runs/44874152002/job/136755192212).
  One required part is missing. The issue's Change and Done-when sections, and the refinement's
  criteria, say that on send or save the kept selection is replaced by the note's numbered marker,
  and that the browser test checks the marker after send. The PR draws no marker and its test checks
  only that the outline is gone. The PR body and the author's review replies say marker drawing
  belongs to #17801. That is not an allowed excuse: the issue lists no person_checks or
  credited_siblings, so the item still counts. No safety problem, takeover-set change or binary file
  was found.
- plugins/prototype/notes-bridge/host.html: on send and on save as draft, replace the held pick with
  the note's numbered marker, as #17800 requires. For example, send the frame a `pins` message with
  the saved notes after `release`, so marker N is drawn where the outline was. Make the same change
  in lib/ui-feedback/host.html and re-sync it with scripts/sync-shared-copies.sh.
- plugins/prototype/skills/explore-directions/scripts/notes-hold-browser-take.js:242: after send,
  also check that the note's numbered marker (marker 1) is drawn in the frame. Today the test only
  checks that the outline is gone. The issue's done-when asks for a test showing the marker replaces
  the outline after send.
- plugins/prototype/skills/explore-directions/scripts/notes-hold-browser-take.js: add a
  save-as-draft step that checks the held outline is replaced by the marker. The refinement's
  criteria cover save as draft as well as send, and the test exercises neither save as draft nor any
  marker.

This pull request leaves the merge queue, and ci-status holds it out while it carries pr-verify-failed. A pr-verify pass removes the label, at a new commit or at this same head: once a trusted person edits the body, and only trusted people have edited it since the fail, this head is judged again, so a fail on the body or the issues it links needs only the body fixed, no new commit.

@github-actions github-actions Bot added the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 21, 2026
…otes host

The notes host now sends the frame a pins message after every list change, so a held pick is replaced by the note's number on send and by D1, D2 on save as draft, as #17800's done-when asks. The browser test checks both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot removed the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 21, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit b9c7315 Nov 21, 2026
68 checks passed
@kyle-sexton
kyle-sexton deleted the fix/ui-feedback-selection-stays-drawn branch November 21, 2026 06:45
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui-feedback: keep a picked element or marked region drawn until its note is sent or cancelled

1 participant