From dea20dfc154a40987258236758687d27de8e0e90 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Sat, 14 Nov 2026 20:42:06 +0100 Subject: [PATCH] :paperclip: Clear the typography where the file holds no generated one A text style edit that applies the generated typography in a world whose file holds none named a typography that resolves to nothing, so the model wrote a dangling reference the copies then had to match. Without the typography, that edit clears the text's typography instead. Harness only; the benchmark is not run. AI-assisted-by: claude-opus-5-5 --- .../app/common/test_helpers/composable/gen.cljc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/common/src/app/common/test_helpers/composable/gen.cljc b/common/src/app/common/test_helpers/composable/gen.cljc index 0a8e7c0004..ff11f45fa6 100644 --- a/common/src/app/common/test_helpers/composable/gen.cljc +++ b/common/src/app/common/test_helpers/composable/gen.cljc @@ -878,12 +878,14 @@ (n/edit-text target :content text)) (:text-style :library-text-style) (let [file-id (or (:library-id selected) (:id (tm/file situation))) - ;; a typography applies only when the file holds it - typography? (and (= 8 (mod (or (nth tuple 2 nil) 0) (count text-style-edits))) - (odd? (or (nth tuple 3 nil) 0)) - (contains? (get-in (cf/all-files situation) [file-id :data :typographies]) - (thi/id :generated-typography))) - content (cond-> (edit-text-style (:shape selected) (nth tuple 2 nil) (nth tuple 3 nil)) + typography-edit? (= 8 (mod (or (nth tuple 2 nil) 0) (count text-style-edits))) + ;; a typography applies only when the file holds it; + ;; without one the edit clears the typography + held? (contains? (get-in (cf/all-files situation) [file-id :data :typographies]) + (thi/id :generated-typography)) + value (if (and typography-edit? (not held?)) 0 (nth tuple 3 nil)) + typography? (and typography-edit? held? (odd? (or value 0))) + content (cond-> (edit-text-style (:shape selected) (nth tuple 2 nil) value) (and typography? (:library-id selected)) (thtx/restyle :typography-ref-file file-id))] (n/edit-text target :content content