From fcac22fe83a180958da0fa19eb220d078861a680 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 29 Jun 2026 02:20:24 -0400 Subject: [PATCH] Give new annotations unique ids (gensym reset clobbered old ones) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit open-draft used (gensym "ann-"), whose counter resets on every page load, so the first annotation added after a refresh reused a prior gid (ann-2, …) and the per-id merge overwrote the existing annotation. Use a uuid-based gid instead. Co-Authored-By: Claude Opus 4.8 --- tl/src/tl/events.cljs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tl/src/tl/events.cljs b/tl/src/tl/events.cljs index 1390cea..9a63411 100644 --- a/tl/src/tl/events.cljs +++ b/tl/src/tl/events.cljs @@ -90,7 +90,9 @@ (rf/reg-event-db ::open-draft (fn [db _] (-> db - (assoc-in [:scene :groups (keyword (gensym "ann-"))] + ;; uuid, not gensym: gensym's counter resets each page load, so a + ;; fresh annotation would reuse a prior gid and clobber it on merge. + (assoc-in [:scene :groups (keyword (str "ann-" (random-uuid)))] {:type :annotation :parent (peek (get-in db [:view :stack])) :draft :new :name "" :color "#4e8fc2" :marks []}) (assoc-in [:view :pt] :new))))