]> git.kaiwu.me - haproxy.git/commit
DEV: patchbot: let the page edit and delete whole notes
authorWilly Tarreau <w@1wt.eu>
Mon, 6 Jul 2026 16:53:41 +0000 (18:53 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 Jul 2026 12:45:32 +0000 (14:45 +0200)
commita6906d799f5cd0698368d39cc323a21e17adff09
tree1f48e48bbbaea06ee191e7488452f15261a370dd
parent0ed6d1f840cf74da5ad9e7650a395a7256c7f23a
DEV: patchbot: let the page edit and delete whole notes

An "[edit note]" link now appears next to "[add note]" whenever a line
has shared notes: it presents the whole note blob in the input box for
edition, and the save sends it as a replacement (the "setnotes"
directive, carrying the hash of the blob the edit was based on).
Emptying the box deletes the note. Clicking "add note" first and then
"edit note" merges the reference notes with the pending addition so
nothing typed so far is lost, and a "[cancel]" link aborts an edition
opened by mistake without touching anything.

An open input only disappears once its content is synchronized with the
reference: a successful save, an update proving an exact match, or an
explicit cancel. To that end, "Get updates" first silently closes the
no-op boxes (opened but nothing changed), then after applying the
fetched state it closes the boxes it made redundant (an addition
someone already pushed, an edition matching the current notes), and
re-bases an edition whose base moved, turning it red: red uniformly
means "the reference changed under your edit, review the notes above
against your text before saving". A save refused by the server (the
"conflict <cid>" response lines) turns the input red the same way,
keeping it in edition; states and additions from the same save are
unaffected. After a reload, a browser-restored pending note reopens in
append mode, the only safe assumption since a lost replacement base
cannot be recovered.
dev/patchbot/scripts/post-ai.sh