Repository navigation
fix(ui-feedback): list the run's notes after a reload, with hover and click to show each box - #17863
Conversation
… click to show each box The notes host fetches the run's sent notes from a new token-checked GET /api/notes and lists them again, numbered as their markers. Hovering a row draws its note's box; clicking a row or its marker restores the note's variant, state and content set and keeps the box drawn until a click elsewhere. Marker clicks are opt-in for the host, so the planning shared page keeps today's behavior. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… box Selecting a row re-rendered the list, so the click that selected it then reached the document listener from a detached row and cleared it. Selection now marks the rows in place, and leaving the list clears the hover box even when a re-render replaced the hovered row. The history browser test waits for each held pick to be released. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ssionStorage Drafts never reach the bridge, so a reload lost them. The host now keeps them in sessionStorage under one entry naming the run's token, reads them back as untrusted (malformed entries and notes the schema refuses are dropped, another run's entry reads as none) and saves the list on every change, so a sent or deleted draft leaves the store. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a026a1ad9
ℹ️ 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".
|
claude-security-review reviewed Security review (blocking only): no security issues foundThis lane already reviewed an earlier head of this pull request, so this review reports only CRITICAL and IMPORTANT findings. I read every hunk of all 18 files on the to-read list. What I checked
Scope notes
critical-findings: 0 |
|
claude-review reviewed Code review (blocking only): no findingsThis lane already reviewed earlier heads of this pull request, so it reports only blocking findings. This head ( The earlier blocking finding stays fixed. The
Checked against #17801:
The settled scroll-redraw thread on Loosened checks would be marked: fail. That is the default, because the prompt has no No plugin manifest changed. The changelog fragments use Verifier dropped 0 of 0 candidates. |
The layer redrew on resize only. An outline on a fixed or sticky element is placed in document coordinates, so a selected note's outline drifted off its element during the smooth scroll that selecting it starts, and stayed misplaced afterwards. A scroll now redraws the layer, at most once per animation frame. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane run report
Run 44887113039, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
Lane run report
Run 44887113039, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
…parses Merging main brought `const target` (the frame's post origin) into the host module, where this branch already declared `function target(m)`. The redeclaration is a SyntaxError, so the host page ran none of its script. The helper is now noteTarget. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Post-merge mutation testingKilled 4, survived 1, timeout 0, no coverage 0, invalid 0, not run 2.
Surviving mutants
The run's summary has the full report. |
Closes #17801
Summary
A reload of the notes host used to empty its Notes list, though every sent note was still in the run's
actions.json. The host now lists the run's sent notes and its unsent drafts again, oldest first, numbered as their markers are. Hovering a row draws its note's box on the mockup, and moving off clears it. Clicking a row restores the note's variant, screen state and content set, scrolls to it, and keeps its box drawn until a click elsewhere (on the mockup or the host page) or on another row. Clicking a marker selects its row, the same as clicking the row (the scope added in this comment).Fix
lib/ui-feedback/notes_bridge.py: newGET /api/notes. It needs the page token inX-Notes-Token(the existingtoken_okcheck), and do_GET's Host/Origin check still applies. It reads only the server's own data dir (hub.read_log()), and no part of the request picks the directory. It returns each event'sseq,atand note fields, withoutdeliveredAt.lib/ui-feedback/host.html: on load, after the token, it fetches/api/notesand keeps each note only ifnote.schema.jsonadmits it. Rows get hover/focus (draw the box) and click/Enter (select). Every note text, label and reply still reaches the screen throughtextContent. The frame gets contract keys, an anchor path and a box, never note text. Selection marks rows in place, so the selecting click is not undone by the document listener.lib/ui-feedback/proto-pin.js: newshow(hover) andselectmessages. A note's box is its element's live box while the anchor path still finds a visible element in the note's scope, else the storedrect.selectrestores the view through the switcher'svs:show, scrolls, and postsshownwith whether a box was found. The data log is not replayed, because data-control presses are not idempotent on a live page. A click anywhere but a marker clears the selection and still reaches the page.lib/ui-feedback/note-model.mjsgainsdraftStore(storage, run, schema), and the host keeps this run's drafts in the tab'ssessionStorage. Nothing goes to the server. It writes one entry,{run, drafts}, keyed by the run's page token, so another run's drafts read back as none and the next save overwrites them. The host saves the draft list on every render, so a draft drops out of the store once it is sent or deleted. What storage returns is treated as untrusted. A malformed entry reads as no drafts, and a draftnote.schema.jsonrefuses is dropped. A restored draft's text renders throughtextContent, like every other row. This follows feat(ui-feedback): toggle that shows or hides every note marker #17847, which already keeps the marker toggle insessionStorage. A bridge restart issues a new token, so drafts from before the restart are not listed.pointer-events: none. The frame hit-tests a trusted pointer click against each marker's own box, only outside a pick mode and a held pick, and only for a host that sendsmarkerswithclicks: true. Only the notes host sends it, so the planning shared page's markers still take no click. A script'sel.click()and a key-made click (no pointer position) are never marker clicks, so data-log replays reach the page.lib/ui-feedback/relocate-note.mjs: its fresh host page now lists the run's notes with their markers, so the screenshot style also hides[data-ui-feedback-layer]. That keeps the relocate pixel checks' "all green" shot clean.notes-markers-browser-take.js: after its reload, the run's earlier note 1 is now listed and drawn, so the expected markers are1,2instead of2.scripts/sync-shared-copies.sh. The only planning file touched is the syncedplugins/planning/shared/web/proto-pin.js.Verification
Run locally (Windows):
lib/ui-feedback/test_notes_bridge.py: 49 run, 44 pass. The 5 failures are the known local-onlyTestLoopones (/bin/bashpath mangling). The newTestNoteHistory(4 tests) passes on three consecutive runs and was red before the route existed. It covers the run's notes coming back oldest first, a missing, wrong or watcher token refused with no note text in the body, another run's notes never returned (a second bridge on a second data dir,?dir=ignored, and the other run's token refused), and a foreign Host refused.TestGuardsthrew WinError 10053 on some local runs, as expected on this machine; no test was added there.node --test lib/ui-feedback/note-model.test.mjs: 151 pass, 0 fail. Five draft-store tests failed beforedraftStoreexisted: save then restore, sent or discarded drafts leave the store, another run's drafts are ignored, malformed entries and refused notes are dropped, and a throwing storage keeps nothing without breaking the page. Five new frame tests failed before theproto-pin.jschange: hover box from the stored rect, element's live box, select restores the view and a page click clears it and still reaches the page, not-found reported, and marker clicks (opt-in only, only on the marker's box, never in a pick mode, never for a script click).lib/ui-feedback/relocate-note.test.sh: 34 pass, 0 fail.plugins/planning/shared/tests/test_server.py TestPrototypePage: 8 OK.scripts/sync-shared-copies.sh --check: all copies match.scripts/check-html-assets.sh: clean.node --checkon proto-pin.js and host.html's module script, a parse of the new take script, andbash -non the new test script.Only CI's Linux Test Bash lane can run (browser tests cannot run on this machine):
notes-history-browser.test.sh: two notes sent on variants A and B and one draft left unsent, then a reload. Both notes are listed, and the draft is listed as D1 with statusdraftand its marker, with markup shown as text; hover draws note 1's box on its row and clears on leaving; clicking row 2 switches to variant B with its box drawn; a mockup click and a host-page click each clear it; clicking marker 1 selects row 1 and restores variant A.notes-markers-browser.test.sh, and the relocate pixel checks, which now rely on hiding[data-ui-feedback-layer]in the shot.Related
/architecture:improvereport prototype review this is needed before)🤖 Generated with Claude Code