Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
bump: patch
---

### Fixed

- The notes panel no longer drops a click on a note row when the list re-renders while the mouse button is down, for instance when the server pushes a state change. The row is selected and its Edit, Withdraw and Move or resize actions show, where before they stayed hidden. Only a primary-button press holds the re-render, and the hold ends when the pointer leaves the list, a context menu opens or the window loses focus, so the list never freezes after a right-click or a drag into the mockup.
14 changes: 14 additions & 0 deletions lib/ui-feedback/host.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,21 @@ function copyChosen(m) {
else manual();
}

/** A row rebuilt between a press and its release gets no click, so a render during a press in the list waits for the click. */
let pressed = false, stale = false;
const release = () => {
pressed = false;
if (stale) { stale = false; render(); }
};
$("notes").addEventListener("pointerdown", (e) => { if (e.button === 0) pressed = true; });
$("notes").addEventListener("pointerleave", release);
addEventListener("click", release);
addEventListener("pointerup", () => setTimeout(release));
addEventListener("pointercancel", release);
addEventListener("contextmenu", release);
addEventListener("blur", release);
function render() {
if (pressed) { stale = true; return; }
const listening = noSession
? "No session: the notes server is not answering. Your notes stay on this page; Copy all notes makes a block to paste to Claude."
: { listening: "Claude is listening.", reading: "Claude is reading your notes." }[last.listening]
Expand Down
14 changes: 14 additions & 0 deletions plugins/prototype/notes-bridge/host.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,21 @@ function copyChosen(m) {
else manual();
}

/** A row rebuilt between a press and its release gets no click, so a render during a press in the list waits for the click. */
let pressed = false, stale = false;
const release = () => {
pressed = false;
if (stale) { stale = false; render(); }
};
$("notes").addEventListener("pointerdown", (e) => { if (e.button === 0) pressed = true; });
$("notes").addEventListener("pointerleave", release);
addEventListener("click", release);
addEventListener("pointerup", () => setTimeout(release));
addEventListener("pointercancel", release);
addEventListener("contextmenu", release);
addEventListener("blur", release);
function render() {
if (pressed) { stale = true; return; }
const listening = noSession
? "No session: the notes server is not answering. Your notes stay on this page; Copy all notes makes a block to paste to Claude."
: { listening: "Claude is listening.", reading: "Claude is reading your notes." }[last.listening]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ async page => {
await until(() => rows.nth(0).getAttribute("aria-current"), (v) => v === "true");
ok("clicking marker 1 selects row 1, as clicking the row does", (await rows.nth(0).getAttribute("aria-current")) === "true");
ok("and keeps note 1's variant with its box drawn", (await shownVariant()) === "A" && (await box("selected", ROW)).on, await shownVariant());

await page.click("#view-sep");
const name = await rows.nth(1).locator(".name").boundingBox();
await page.mouse.move(name.x + 4, name.y + 4);
await page.mouse.down();
await frame.evaluate(() => parent.postMessage({ type: "named", names: [] }, "*"));
await page.waitForTimeout(200);
await page.mouse.up();
await until(() => rows.nth(1).getAttribute("aria-current"), (v) => v === "true");
ok("a click on row 2 selects it and shows its actions when the list re-renders mid-press",
(await rows.nth(1).getAttribute("aria-current")) === "true" && await rows.nth(1).locator('[data-key^="edit-"]').isVisible());
} catch (err) {
R.push("ERROR " + String(err && err.message || err).slice(0, 300));
}
Expand Down
Loading