diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-03 11:53:12 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-03 11:53:50 -0500 |
| commit | cb73a13c85c9818979f21e5ca0fd6aee631fb61e (patch) | |
| tree | b69074438512112571d9e677785163f59aadfed7 /tests/test-pearl-assignee-labels.el | |
| parent | 1f729465d2247fb6882185e426860de869fe9b71 (diff) | |
| download | pearl-cb73a13c85c9818979f21e5ca0fd6aee631fb61e.tar.gz pearl-cb73a13c85c9818979f21e5ca0fd6aee631fb61e.zip | |
feat(views): surface the issue assignee as an @-tag on the heading
On a team or "by person" view you couldn't tell who owned an issue at a glance: the assignee was captured but folded inside the :LINEAR-ASSIGNEE-NAME: drawer, with nothing in the heading.
I render the assignee as a leading @-tag (:@eric:bug:backend:), behind a pearl-show-assignee defcustom (default on). I picked a tag over a heading suffix because Org strips tags before it hashes the title for sync, so the tag can't corrupt title-sync the way a suffix would. The @ prefix keeps it in its own namespace, separate from label tags: labels are tracked in their drawer, not read back from the heading, so the tag never gets mistaken for a label. The label-edit path preserves any @-tag when it rewrites the heading's tags, and edit-assignee refreshes the @-tag so a reassign doesn't leave a stale name until the next fetch.
Verified live against a by-person view: assigned issues carry their @-tag, unassigned ones stay bare.
Diffstat (limited to 'tests/test-pearl-assignee-labels.el')
| -rw-r--r-- | tests/test-pearl-assignee-labels.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test-pearl-assignee-labels.el b/tests/test-pearl-assignee-labels.el index e7be619..09d0fbd 100644 --- a/tests/test-pearl-assignee-labels.el +++ b/tests/test-pearl-assignee-labels.el @@ -55,6 +55,19 @@ (should (string= "Craig" (org-entry-get nil "LINEAR-ASSIGNEE-NAME"))) (should (string= "u9" (org-entry-get nil "LINEAR-ASSIGNEE-ID"))))))) +(ert-deftest test-pearl-edit-assignee-updates-heading-tag-preserving-labels () + "edit-assignee refreshes the @-assignee tag on the heading (so it isn't stale +until the next fetch) while leaving the label tags in place." + (test-pearl--in-org + "*** TODO Title :@someone:bug:\n:PROPERTIES:\n:LINEAR-ID: a\n:LINEAR-TEAM-ID: team-1\n:LINEAR-ASSIGNEE-ID: old\n:LINEAR-ASSIGNEE-NAME: Someone\n:END:\n" + (cl-letf (((symbol-function 'pearl--resolve-team-id) + (lambda (_kind _name _team &optional _force) "u9"))) + (pearl-edit-assignee "Eric") + (goto-char (point-min)) + (should (re-search-forward "^\\*\\*\\* TODO Title[ \t]+:@eric:bug:$" nil t)) + (should-not (save-excursion (goto-char (point-min)) + (re-search-forward ":@someone:" nil t)))))) + (ert-deftest test-pearl-edit-assignee-unresolvable-errors () "An unresolvable assignee name signals a user error and writes nothing." (test-pearl--in-org |
