From 648893bd6ff5f4c403733d03258dbf3e91f2394b Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 25 May 2026 19:48:39 -0500 Subject: feat(save): detect dirty structured fields against synced baselines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The save scan now flags priority, state, assignee, and labels as dirty when their live value differs from the synced baseline, so structured fields ride the same reconcile-at-save path as title and description. Each check is id/scalar-only and runs with no network: the priority cookie's number against LINEAR-PRIORITY, the explicit state id against LINEAR-STATE-ID-SYNCED (the picker arm — keyword cycling lands later), the assignee id against its baseline, and the label id set against its baseline (order-insensitive, since Linear label order isn't meaningful). A missing baseline on a legacy file reads as not-dirty; the saver's missing-property guard covers that edge. This also makes the priority cookie faithful. The renderer mapped both None and Medium to [#C], so a None issue couldn't be told apart from a Medium one and would have read dirty the moment its baseline said 0. None now renders with no cookie, 1:1 with the four cookie levels — matching what the priority setter already did. --- tests/test-pearl-format.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test-pearl-format.el') diff --git a/tests/test-pearl-format.el b/tests/test-pearl-format.el index a642b53..ece64d3 100644 --- a/tests/test-pearl-format.el +++ b/tests/test-pearl-format.el @@ -105,7 +105,7 @@ "Null/missing optional fields render as empty values, and the body is empty." (test-pearl--with-default-mapping (let ((out (pearl--format-issue-as-org-entry (test-pearl--norm-bare)))) - (should (string-match-p "^\\*\\* TODO \\[#C\\] ENG-7: Bare Issue$" out)) + (should (string-match-p "^\\*\\* TODO ENG-7: Bare Issue$" out)) (should (string-match-p "^:LINEAR-PROJECT-NAME: +$" out)) (should (string-match-p "^:LINEAR-ASSIGNEE-NAME: +$" out)) (should (string-match-p "^:LINEAR-LABELS: +\\[\\]$" out)) @@ -174,7 +174,7 @@ sort together (org-sort on the parent) instead of being orphan headings." (let ((out (pearl--build-org-content (list (test-pearl--norm-full) (test-pearl--norm-bare))))) (should (string-match-p "^\\*\\* IN-PROGRESS \\[#B\\] ENG-42: Fix the Thing$" out)) - (should (string-match-p "^\\*\\* TODO \\[#C\\] ENG-7: Bare Issue$" out))))) + (should (string-match-p "^\\*\\* TODO ENG-7: Bare Issue$" out))))) ;;; --restore-page-visibility -- cgit v1.2.3