aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-06 16:21:46 -0500
committerCraig Jennings <c@cjennings.net>2026-06-06 16:21:46 -0500
commit7fb4cf298a4e27813ce1137acf83f5cc52fba3be (patch)
treee29347a47a53d43e74c85890e6285146cec6f171
parent132496a6fbe5b1190d3b5cc585e940d12e3c92db (diff)
downloadpearl-7fb4cf298a4e27813ce1137acf83f5cc52fba3be.tar.gz
pearl-7fb4cf298a4e27813ce1137acf83f5cc52fba3be.zip
feat(keys): add sort and grouping to the transient menu
The view-shaping commands were keymap-only. Now they're in the menu's Views group too: 5 sorts, G groups, R reverses the order. The mnemonic letters were already taken menu-wide (s and S save, g and r refresh), so sort took the digit 5 and group/reverse took the free capitals. The menu coverage test now requires all three, and the README sort/grouping notes point at the menu keys.
-rw-r--r--README.org4
-rw-r--r--pearl.el5
-rw-r--r--tests/test-pearl-menu.el6
3 files changed, 11 insertions, 4 deletions
diff --git a/README.org b/README.org
index d2705db..45aea33 100644
--- a/README.org
+++ b/README.org
@@ -299,13 +299,13 @@ Sorting is local and deterministic. Query filters are AND-only; use a Linear Cus
=pearl-set-sort= reorders the active view without hand-editing a source. It asks for a key (=updated=, =created=, =priority=, =title=) and an order (=desc= / =asc=). =pearl-toggle-sort-order= flips the order on the current sort, defaulting to =updated= descending when nothing is set yet.
-Priority and title sort the fetched issues in place: whole subtrees move by id, so unsaved edits survive, and the order sticks across a refresh. Updated and created refetch with the new server ordering. A Custom View has no server-side order in Linear's API, so =updated= / =created= are refused on a view -- sort it by priority or title instead, which still reorders the issues it returned. Sorting a grouped view in place isn't supported yet. =pearl-set-sort= is on =C-; L v s= and =pearl-toggle-sort-order= on =C-; L v r=; both also run from =M-x=. They're not in the transient menu yet.
+Priority and title sort the fetched issues in place: whole subtrees move by id, so unsaved edits survive, and the order sticks across a refresh. Updated and created refetch with the new server ordering. A Custom View has no server-side order in Linear's API, so =updated= / =created= are refused on a view -- sort it by priority or title instead, which still reorders the issues it returned. Sorting a grouped view in place isn't supported yet. =pearl-set-sort= is on =C-; L v s= and =pearl-toggle-sort-order= on =C-; L v r=, in the menu's Views group under =5= and =R=, and from =M-x=.
*** Grouping the current view
=pearl-set-grouping= sections the active view on demand, without setting up grouping in Linear and re-fetching. It asks for a dimension: =status=, =project=, =assignee=, =priority=, or =none= to ungroup. The regroup is client-side over the issues already in the buffer, so it's instant and works offline. Each issue's group comes from its drawer, and an issue with no value for the dimension lands in a "No status" / "No project" / "No assignee" bucket. The choice sticks across a refresh.
-Like sorting, the regroup moves whole subtrees so unsaved edits survive. Only the heading levels shift, since a grouped issue sits one level deeper under its group heading. On a Custom View that already carries its own grouping from Linear, your choice takes over for display, and =none= restores the view's configured grouping on the next refresh. =cycle= isn't offered yet: it isn't stored in the issue drawer, so an offline regroup can't read it. =pearl-set-grouping= is on =C-; L v g=, and also runs from =M-x=. It's not in the transient menu yet.
+Like sorting, the regroup moves whole subtrees so unsaved edits survive. Only the heading levels shift, since a grouped issue sits one level deeper under its group heading. On a Custom View that already carries its own grouping from Linear, your choice takes over for display, and =none= restores the view's configured grouping on the next refresh. =cycle= isn't offered yet: it isn't stored in the issue drawer, so an offline regroup can't read it. =pearl-set-grouping= is on =C-; L v g=, in the menu's Views group under =G=, and from =M-x=.
*** Editing issues
diff --git a/pearl.el b/pearl.el
index 22c5ebe..4f85961 100644
--- a/pearl.el
+++ b/pearl.el
@@ -8102,7 +8102,10 @@ body stay."
("D" "save Linear view locally" pearl-save-linear-view-locally)
("U" "publish current view" pearl-publish-current-view)
("X" "delete local view" pearl-delete-local-view)
- ("." "set default view" pearl-set-default-view)]
+ ("." "set default view" pearl-set-default-view)
+ ("5" "sort view" pearl-set-sort)
+ ("G" "group view" pearl-set-grouping)
+ ("R" "reverse order" pearl-toggle-sort-order)]
["Buffer"
("g" "refresh view" pearl-refresh-current-view)
("r" "refresh issue" pearl-refresh-current-issue)
diff --git a/tests/test-pearl-menu.el b/tests/test-pearl-menu.el
index 825d6bc..d939a9e 100644
--- a/tests/test-pearl-menu.el
+++ b/tests/test-pearl-menu.el
@@ -78,7 +78,11 @@ menu entry that still points at it fails here."
;; set-default-view: the new Views-group entry
pearl-set-default-view
;; fetch the full comment thread for the issue at point
- pearl-fetch-all-comments))
+ pearl-fetch-all-comments
+ ;; view-shaping commands added to the Views group
+ pearl-set-sort
+ pearl-set-grouping
+ pearl-toggle-sort-order))
(should (memq expected cmds)))))
(provide 'test-pearl-menu)