From 459c257560b00a969cc4e8a15fe73377d6476683 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 3 Jun 2026 12:24:58 -0500 Subject: feat(views): add pearl-assignee-tag-short to trim the @-tag to first name The assignee @-tag slugs Linear's full @-mention handle, so a firstname.lastname handle still renders long (:@first_last:). For someone who wants a tighter tag line, I added pearl-assignee-tag-short (default off): when on, the tag keeps only the first segment of the handle (before the first dot or space), so :@first_last: becomes :@first: and a single-token handle like alice is unchanged. It's opt-in because first names collide across teammates, so the default stays the unambiguous full handle. --- tests/test-pearl-labels.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/test-pearl-labels.el') diff --git a/tests/test-pearl-labels.el b/tests/test-pearl-labels.el index 94211b1..febb906 100644 --- a/tests/test-pearl-labels.el +++ b/tests/test-pearl-labels.el @@ -95,6 +95,20 @@ field -- which is the full email for teammates who never set a display name." "With no displayName, the tag slugs the name." (should (string= "@eric_bell" (pearl--assignee-tag '(:name "Eric Bell"))))) +(ert-deftest test-pearl-assignee-tag-short-keeps-first-segment () + "With `pearl-assignee-tag-short' on, only the first name (before the first dot +or space) is kept, so a firstname.lastname handle shortens to just the first." + (let ((pearl-assignee-tag-short t)) + (should (string= "@vrezh" (pearl--assignee-tag '(:display-name "vrezh.mikayelyan")))) + (should (string= "@eric" (pearl--assignee-tag '(:name "Eric Bell")))) + ;; A single-token handle is unchanged. + (should (string= "@nerses" (pearl--assignee-tag '(:display-name "nerses")))))) + +(ert-deftest test-pearl-assignee-tag-short-off-keeps-full-handle () + "Off by default: the full slugified handle is kept." + (should (string= "@vrezh_mikayelyan" + (pearl--assignee-tag '(:display-name "vrezh.mikayelyan"))))) + (ert-deftest test-pearl-normalize-user-captures-display-name () "The normalized user carries Linear's displayName so the @-tag can use the short handle while the drawer keeps the fuller name." -- cgit v1.2.3