aboutsummaryrefslogtreecommitdiff
path: root/pearl.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-25 19:39:11 -0500
committerCraig Jennings <c@cjennings.net>2026-05-25 19:39:11 -0500
commitc5ff668aa2666e70ce423cf382b9871ed069a527 (patch)
treeb8dc5be3d2affdb2667c967350bda0c471844825 /pearl.el
parent2568f25d069ecf242d5288db8f3bda968d6f8868 (diff)
downloadpearl-c5ff668aa2666e70ce423cf382b9871ed069a527.tar.gz
pearl-c5ff668aa2666e70ce423cf382b9871ed069a527.zip
feat(save): write synced baselines for structured fields
Save-model v2 reconciles a field by diffing its live value against a baseline last synced from Linear, but the structured fields (priority, state, assignee, labels) only stored their current value — there was nothing to diff against. The renderer now writes a synced baseline beside each: LINEAR-PRIORITY (the numeric priority), LINEAR-STATE-ID-SYNCED, LINEAR-ASSIGNEE-ID-SYNCED, and LINEAR-LABEL-IDS / LINEAR-LABEL-IDS-SYNCED (the live and baseline id sets, with LINEAR-LABELS staying display-only names). At fetch, live equals baseline, so nothing reads dirty on a fresh issue. The merge refresh re-renders changed subtrees through the same renderer, so baselines advance there too, and a retained dirty subtree is left untouched.
Diffstat (limited to 'pearl.el')
-rw-r--r--pearl.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/pearl.el b/pearl.el
index 4111557..b0c48ca 100644
--- a/pearl.el
+++ b/pearl.el
@@ -1894,6 +1894,8 @@ identifier prefix -- so an unedited heading is a no-op on title sync)."
display-title (plist-get issue :identifier)))
(label-names (mapconcat (lambda (l) (or (plist-get l :name) ""))
(plist-get issue :labels) ", "))
+ (label-ids (mapconcat (lambda (l) (or (plist-get l :id) ""))
+ (plist-get issue :labels) " "))
(body-org (pearl--md-to-org description)))
(concat
(format "** %s %s %s\n" todo priority heading-title)
@@ -1907,11 +1909,16 @@ identifier prefix -- so an unedited heading is a no-op on title sync)."
(format ":LINEAR-TEAM-NAME: %s\n" (or (plist-get team :name) ""))
(format ":LINEAR-PROJECT-ID: %s\n" (or (plist-get project :id) ""))
(format ":LINEAR-PROJECT-NAME: %s\n" (or (plist-get project :name) ""))
+ (format ":LINEAR-PRIORITY: %s\n" (or (plist-get issue :priority) ""))
(format ":LINEAR-STATE-ID: %s\n" (or (plist-get state :id) ""))
+ (format ":LINEAR-STATE-ID-SYNCED: %s\n" (or (plist-get state :id) ""))
(format ":LINEAR-STATE-NAME: %s\n" (or (plist-get state :name) ""))
(format ":LINEAR-ASSIGNEE-ID: %s\n" (or (plist-get assignee :id) ""))
+ (format ":LINEAR-ASSIGNEE-ID-SYNCED: %s\n" (or (plist-get assignee :id) ""))
(format ":LINEAR-ASSIGNEE-NAME: %s\n" (or (plist-get assignee :name) ""))
(format ":LINEAR-LABELS: [%s]\n" label-names)
+ (format ":LINEAR-LABEL-IDS: %s\n" label-ids)
+ (format ":LINEAR-LABEL-IDS-SYNCED: %s\n" label-ids)
(format ":LINEAR-DESC-SHA256: %s\n" (secure-hash 'sha256 description))
(format ":LINEAR-DESC-ORG-SHA256: %s\n" (secure-hash 'sha256 (string-trim body-org)))
(format ":LINEAR-DESC-UPDATED-AT: %s\n" (or (plist-get issue :updated-at) ""))