aboutsummaryrefslogtreecommitdiff
path: root/pearl.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-02 11:56:55 -0500
committerCraig Jennings <c@cjennings.net>2026-06-02 11:56:55 -0500
commit0dccaaee955c99d2affcf33c145feba2ef1fdcda (patch)
treed34273a2a01a5866d118daad1a84fe47ccb9fd1f /pearl.el
parent93c70b2b42174caa101d3de1fc46630dcdbcf941 (diff)
downloadpearl-0dccaaee955c99d2affcf33c145feba2ef1fdcda.tar.gz
pearl-0dccaaee955c99d2affcf33c145feba2ef1fdcda.zip
feat(keys): dedicated views group, de-overloaded fetch, account binding
The C-; L keymap and the transient menu had drifted into two different letter schemes for the same commands, the fetch sub-map carried both issue-fetching and view-movement, and pearl-switch-account was bound nowhere. Give views their own group under v: l/L run local/Linear, c/e/k create/edit/delete, u/U publish local/current, d save a Linear view locally. Fetch (f) is now issue sources only. A new workspace group (w) binds switch-account plus the setup commands, which previously lived only in the transient. v D is reserved, unbound, for the not-yet-built set-default-view. The transient already had an issue-only fetch group and a dedicated views group, so its changes are additive: switch-account and copy-issue-url were both missing from the menu and are added, and save/save-all/edit-description take s/S/d to match the keymap's hot keys. Matching those three cascades a few view and edit letters because the transient is a flat keyspace where every command needs a unique key. Suite 789 to 792, compile and lint clean.
Diffstat (limited to 'pearl.el')
-rw-r--r--pearl.el109
1 files changed, 73 insertions, 36 deletions
diff --git a/pearl.el b/pearl.el
index 6076c81..799a195 100644
--- a/pearl.el
+++ b/pearl.el
@@ -6584,20 +6584,25 @@ body stay."
;;;###autoload (autoload 'pearl-menu "pearl" nil t)
(transient-define-prefix pearl-menu ()
"Dispatch menu for pearl commands."
- ;; Grouped to mirror the `pearl-prefix-map' categories (save / edit / new /
- ;; delete); fetch / view / setup are the operational groups with no keymap
- ;; equivalent. The org-sync commands (enable / disable / push-file) are
- ;; deliberately not surfaced -- they are plumbing (see the todo).
+ ;; Grouped to mirror the `pearl-prefix-map' categories: Fetch is issue
+ ;; sources only, Views is its own group, Workspace holds account switching
+ ;; plus setup. The hot keys `s' / `S' / `d' (save / save-all /
+ ;; edit-description) match the keymap's direct keys. The transient is a
+ ;; flat keyspace -- every command needs a unique key on the screen -- so the
+ ;; remaining letters are read off the menu rather than matching the keymap's
+ ;; two-key chains. Set-default-view has no command yet, so it gets no slot
+ ;; here (the keymap reserves `v D' for it). The org-sync commands (enable /
+ ;; disable / push-file) are deliberately not surfaced -- they are plumbing.
["Issue"
["Save"
- ("e" "save issue" pearl-save-issue)
- ("E" "save all" pearl-save-all)]
+ ("s" "save issue" pearl-save-issue)
+ ("S" "save all" pearl-save-all)]
["Edit"
- ("D" "edit description" pearl-edit-description)
- ("M" "edit comment" pearl-edit-current-comment)
- ("s" "edit state" pearl-edit-state)
+ ("d" "edit description" pearl-edit-description)
+ ("t" "edit state" pearl-edit-state)
("a" "edit assignee" pearl-edit-assignee)
- ("L" "edit labels" pearl-edit-labels)]
+ ("L" "edit labels" pearl-edit-labels)
+ ("M" "edit comment" pearl-edit-current-comment)]
["Create"
("n" "create issue" pearl-create-issue)
("c" "create comment" pearl-create-comment)]
@@ -6612,19 +6617,21 @@ body stay."
("f" "build a filter" pearl-list-issues-filtered)]
["Views"
("V" "create local view" pearl-create-local-view)
- ("y" "edit local view" pearl-edit-local-view)
+ ("e" "edit local view" pearl-edit-local-view)
("Q" "run local view" pearl-run-local-view)
("v" "run Linear view" pearl-run-linear-view)
("u" "publish local view" pearl-publish-local-view)
- ("d" "save Linear view locally" pearl-save-linear-view-locally)
+ ("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)]
["Buffer"
("g" "refresh view" pearl-refresh-current-view)
("r" "refresh issue" pearl-refresh-current-issue)
("b" "open view in Linear" pearl-open-current-view-in-linear)
- ("o" "open issue in browser" pearl-open-current-issue)]
- ["Setup"
+ ("o" "open issue in browser" pearl-open-current-issue)
+ ("y" "copy issue URL" pearl-copy-issue-url)]
+ ["Workspace / setup"
+ ("A" "switch account" pearl-switch-account)
("T" "test connection" pearl-test-connection)
("C" "check setup" pearl-check-setup)
("!" "toggle debug" pearl-toggle-debug)
@@ -6634,9 +6641,10 @@ body stay."
;;
;; A prefix keymap that makes the whole command surface reachable from the
;; keyboard. The hot-path commands sit directly under the prefix (one key);
-;; the rest are grouped into category sub-maps (two keys). The most common
-;; commands appear in both places -- e.g. edit-description is the direct `d'
-;; and also `e d' under the edit group.
+;; the rest are grouped into category sub-maps (two keys): fetch (issue
+;; sources), views, edit, create, delete, open, copy, and workspace (account
+;; + setup). The most common commands appear in both places -- e.g.
+;; edit-description is the direct `d' and also `e d' under the edit group.
;;
;; Each binding is a (LABEL . COMMAND) menu item, so `which-key' shows the
;; verb-matched label without pearl depending on which-key. Lookups still
@@ -6658,18 +6666,31 @@ body stay."
(define-key map "o" (cons "my open issues" #'pearl-list-issues))
(define-key map "p" (cons "by project" #'pearl-list-issues-by-project))
(define-key map "f" (cons "build a filter" #'pearl-list-issues-filtered))
- (define-key map "v" (cons "run Linear view" #'pearl-run-linear-view))
+ map)
+ "Pearl issue-fetch commands; a sub-keymap of `pearl-prefix-map'.
+Issue sources only -- pick a source, your open issues, a project, or an
+ad-hoc filter. View-movement commands (run / publish / save-locally) live
+in `pearl-views-map' so this group stays one concern.")
+
+(defvar pearl-views-map
+ (let ((map (make-sparse-keymap)))
(define-key map "l" (cons "run local view" #'pearl-run-local-view))
+ (define-key map "L" (cons "run Linear view" #'pearl-run-linear-view))
+ (define-key map "c" (cons "create local view" #'pearl-create-local-view))
+ (define-key map "e" (cons "edit local view" #'pearl-edit-local-view))
+ (define-key map "k" (cons "delete local view" #'pearl-delete-local-view))
(define-key map "u" (cons "publish local view" #'pearl-publish-local-view))
+ (define-key map "U" (cons "publish current view" #'pearl-publish-current-view))
(define-key map "d" (cons "save Linear view locally" #'pearl-save-linear-view-locally))
- (define-key map "P" (cons "publish current view" #'pearl-publish-current-view))
+ ;; `D' (set default view) is reserved for the not-yet-built
+ ;; `pearl-set-default-view'. Left intentionally unbound so the slot is
+ ;; free when that command lands; do not bind another command to it.
map)
- "Pearl fetch commands; a sub-keymap of `pearl-prefix-map'.
-The view-movement keys are `l' run local view, `v' run Linear view, `u'
-publish a local view up to Linear, and `d' save a Linear view locally
-\(added with copy-down). `p' stays `by project', so publish takes `u'
-\(up) and save-locally takes `d' (down), mirroring the copy-up/copy-down
-lifecycle.")
+ "Pearl view commands; a sub-keymap of `pearl-prefix-map'.
+Lowercase `l' / capital `L' run a local / Linear view; `c' / `e' / `k'
+create / edit / delete a local view. `u' / `U' publish a named / the
+current local view up to Linear; `d' saves a Linear view down into a new
+local view. Capital `D' is reserved for set-default-view.")
(defvar pearl-edit-map
(let ((map (make-sparse-keymap)))
@@ -6678,25 +6699,37 @@ lifecycle.")
(define-key map "a" (cons "edit assignee" #'pearl-edit-assignee))
(define-key map "l" (cons "edit labels" #'pearl-edit-labels))
(define-key map "c" (cons "edit comment" #'pearl-edit-current-comment))
- (define-key map "v" (cons "edit local view" #'pearl-edit-local-view))
map)
- "Pearl edit commands; a sub-keymap of `pearl-prefix-map'.")
+ "Pearl issue-field edit commands; a sub-keymap of `pearl-prefix-map'.
+Editing a local view lives in `pearl-views-map' (`v e').")
(defvar pearl-create-map
(let ((map (make-sparse-keymap)))
(define-key map "t" (cons "create issue" #'pearl-create-issue))
(define-key map "c" (cons "create comment" #'pearl-create-comment))
- (define-key map "v" (cons "create local view" #'pearl-create-local-view))
map)
- "Pearl create commands; a sub-keymap of `pearl-prefix-map'.")
+ "Pearl create commands; a sub-keymap of `pearl-prefix-map'.
+Creating a local view lives in `pearl-views-map' (`v c').")
(defvar pearl-delete-map
(let ((map (make-sparse-keymap)))
(define-key map "t" (cons "delete issue" #'pearl-delete-current-issue))
(define-key map "c" (cons "delete comment" #'pearl-delete-current-comment))
- (define-key map "v" (cons "delete local view" #'pearl-delete-local-view))
map)
- "Pearl delete commands; a sub-keymap of `pearl-prefix-map'.")
+ "Pearl delete commands; a sub-keymap of `pearl-prefix-map'.
+Deleting a local view lives in `pearl-views-map' (`v k').")
+
+(defvar pearl-workspace-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "a" (cons "switch account" #'pearl-switch-account))
+ (define-key map "t" (cons "test connection" #'pearl-test-connection))
+ (define-key map "c" (cons "check setup" #'pearl-check-setup))
+ (define-key map "!" (cons "toggle debug" #'pearl-toggle-debug))
+ (define-key map "x" (cons "clear cache" #'pearl-clear-cache))
+ map)
+ "Pearl workspace and setup commands; a sub-keymap of `pearl-prefix-map'.
+`a' switches the active Linear account; the rest are connection / setup
+diagnostics.")
(defvar pearl-open-map
(let ((map (make-sparse-keymap)))
@@ -6721,19 +6754,23 @@ lifecycle.")
(define-key map "S" (cons "save all" #'pearl-save-all))
(define-key map "d" (cons "edit description" #'pearl-edit-description))
(define-key map "m" (cons "menu" #'pearl-menu))
- ;; Category sub-maps -- two keys; each prefix names an action verb.
+ ;; Category sub-maps -- two keys; each prefix names an action verb or noun.
(define-key map "f" (cons "+fetch" pearl-fetch-map))
+ (define-key map "v" (cons "+views" pearl-views-map))
(define-key map "e" (cons "+edit" pearl-edit-map))
(define-key map "c" (cons "+create" pearl-create-map))
(define-key map "k" (cons "+delete" pearl-delete-map))
(define-key map "o" (cons "+open" pearl-open-map))
(define-key map "y" (cons "+copy" pearl-copy-map))
+ (define-key map "w" (cons "+workspace" pearl-workspace-map))
map)
"Pearl command prefix keymap.
-Hot-path commands are bound directly; the rest live under verb sub-maps
-\(fetch / edit / create / delete / open / copy). `pearl-mode' binds this under
-`pearl-keymap-prefix' inside Pearl buffers; you can also bind it globally
-\(see the Commentary above).")
+Hot-path commands are bound directly; the rest live under sub-maps
+\(fetch / views / edit / create / delete / open / copy / workspace). Fetch is
+issue sources only; views have their own group; workspace holds account
+switching and setup. `pearl-mode' binds this under `pearl-keymap-prefix'
+inside Pearl buffers; you can also bind it globally (see the Commentary
+above).")
(defcustom pearl-keymap-prefix "C-; L"
"Prefix key that `pearl-mode' binds to `pearl-prefix-map'.