diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-01 17:53:53 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-01 17:53:53 -0500 |
| commit | ad1e0b8c33f909814b69458eb34cc792f032e844 (patch) | |
| tree | 0db98b0d5ef8f50eb71b132d2928f0583b270176 | |
| parent | 6206fde5acfd48f9eba2ab231c1fe1d32717c98e (diff) | |
| download | pearl-ad1e0b8c33f909814b69458eb34cc792f032e844.tar.gz pearl-ad1e0b8c33f909814b69458eb34cc792f032e844.zip | |
feat(views): reshape the keymap and transient around the view noun
I put the view operations under the verb a user would reach for. Create, edit, and delete local views are c v, e v, and k v. The fetch group gains run-local-view at f l and keeps run-linear-view at f v, with publish at f u and save-locally reserved at f d. Since f p already runs issues by project, publish and save-locally take u and d, which read as up and down and mirror the copy-up and copy-down lifecycle.
The transient now has a Views column grouping create, edit, run-local, run-linear, publish, and delete, separate from the source-fetching commands. I updated the spec's keymap to the implemented letters so the two stay in sync.
Phase 3 of the views spec. Keymap tests assert the new bindings. Suite, compile, and lint are green.
| -rw-r--r-- | docs/local-and-linear-views-spec.org | 8 | ||||
| -rw-r--r-- | pearl.el | 40 | ||||
| -rw-r--r-- | tests/test-pearl-keymap.el | 12 |
3 files changed, 36 insertions, 24 deletions
diff --git a/docs/local-and-linear-views-spec.org b/docs/local-and-linear-views-spec.org index 721908f..4ff9035 100644 --- a/docs/local-and-linear-views-spec.org +++ b/docs/local-and-linear-views-spec.org @@ -140,9 +140,11 @@ The =view= noun is reachable under the verb a user would look for. The view-move | =C-; L f s= | =pearl-pick-source= (run any view) | | =C-; L f l= | =pearl-run-local-view= | | =C-; L f v= | =pearl-run-linear-view= | -| =C-; L f p= | =pearl-publish-local-view= (copy up) | +| =C-; L f u= | =pearl-publish-local-view= (copy up; =u= = up) | | =C-; L f P= | =pearl-publish-current-view= | -| =C-; L f d= | =pearl-save-linear-view-locally= (copy down) | +| =C-; L f d= | =pearl-save-linear-view-locally= (copy down; =d= = down) | + +(=f p= stays "by project", so publish/save-locally take =u=/=d= = up/down, which also reads as the copy-up/copy-down lifecycle. The transient groups the view commands under a "Views" column.) The old =q= (saved query) bindings are removed outright in the same change, not deprecated — there are no users to ease through a transition, and Craig's own config is updated alongside the rename. @@ -291,7 +293,7 @@ All settled with Craig on 2026-06-01, across the first open-question pass and th 4. *Intent-first command names.* Copy-up's command is =pearl-publish-local-view= (publish is the discoverable word, not "copy to Linear"). Copy-down's command is =pearl-save-linear-view-locally=. "Copy up / copy down" stays as lifecycle prose only. 5. *Unified runner stays =pearl-pick-source=* — it runs favorites, local views, by-dimension filters, and browser-only favorites, so "source" is accurate and it's the word =issue-sources-spec= already established. Not renamed to a view-only word. 6. *Ad-hoc builder* — =pearl-list-issues-filtered= keeps its inline save offer, reworded to "save this local view?". A dedicated =pearl-create-local-view= is the other door. -7. *Keymap* — view-movement commands (run / publish / save-locally) sit in the fetch group (=f l= / =f v= / =f p= / =f d=); create/edit/delete under =c v= / =e v= / =k v=. The copy prefix =C-; L y= keeps its clipboard meaning only. +7. *Keymap* — view-movement commands (run / publish / save-locally) sit in the fetch group (=f l= run local, =f v= run Linear, =f u= publish, =f d= save-locally; =f p= stays "by project"); create/edit/delete under =c v= / =e v= / =k v=. The copy prefix =C-; L y= keeps its clipboard meaning only. 8. *Copy-down representability* — refuse with a structured, named reason; never a lossy or opaque copy. 9. *Copy-down tracking* — fork: no =:linear-view-id=, only optional =:copied-from-view-id= provenance. 10. *Edit semantics* — pre-seeded builder re-run that preserves all non-edited metadata (via =pearl--save-local-view=). @@ -6277,19 +6277,22 @@ body stay." ("c" "create comment" pearl-create-comment)] ["Delete" ("k" "delete issue" pearl-delete-current-issue) - ("K" "delete comment" pearl-delete-current-comment) - ("q" "delete local view" pearl-delete-local-view)]] + ("K" "delete comment" pearl-delete-current-comment)]] ["Workspace" ["Fetch" ("P" "pick source" pearl-pick-source) ("l" "my open issues" pearl-list-issues) ("p" "by project" pearl-list-issues-by-project) - ("f" "build a filter" pearl-list-issues-filtered) - ("v" "custom view" pearl-run-linear-view) - ("Q" "local view" pearl-run-local-view) - ("S" "sync local view" pearl-publish-local-view) - ("U" "upload current source" pearl-publish-current-view)] - ["View" + ("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) + ("Q" "run local view" pearl-run-local-view) + ("v" "run Linear view" pearl-run-linear-view) + ("u" "publish local view" pearl-publish-local-view) + ("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) @@ -6328,14 +6331,17 @@ 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 "custom view" #'pearl-run-linear-view)) - (define-key map "q" (cons "local view" #'pearl-run-local-view)) - (define-key map "S" (cons "sync local view to Linear" - #'pearl-publish-local-view)) - (define-key map "P" (cons "publish current source to Linear" - #'pearl-publish-current-view)) + (define-key map "v" (cons "run Linear view" #'pearl-run-linear-view)) + (define-key map "l" (cons "run local view" #'pearl-run-local-view)) + (define-key map "u" (cons "publish local view" #'pearl-publish-local-view)) + (define-key map "P" (cons "publish current view" #'pearl-publish-current-view)) map) - "Pearl fetch commands; a sub-keymap of `pearl-prefix-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.") (defvar pearl-edit-map (let ((map (make-sparse-keymap))) @@ -6344,6 +6350,7 @@ body stay." (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'.") @@ -6351,6 +6358,7 @@ body stay." (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'.") @@ -6358,7 +6366,7 @@ body stay." (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 "q" (cons "delete local view" #'pearl-delete-local-view)) + (define-key map "v" (cons "delete local view" #'pearl-delete-local-view)) map) "Pearl delete commands; a sub-keymap of `pearl-prefix-map'.") diff --git a/tests/test-pearl-keymap.el b/tests/test-pearl-keymap.el index f80a002..a02dd47 100644 --- a/tests/test-pearl-keymap.el +++ b/tests/test-pearl-keymap.el @@ -66,15 +66,15 @@ The lowercase `c' is no longer a direct command -- it is the create prefix." (should (keymapp (lookup-key pearl-prefix-map (kbd "y"))))) ; copy (ert-deftest test-pearl-prefix-map-fetch-group () - "The fetch group resolves each source command, including the unified pick-source." + "The fetch group resolves each source and view-run command." (should (eq 'pearl-pick-source (lookup-key pearl-prefix-map (kbd "f s")))) (should (eq 'pearl-list-issues (lookup-key pearl-prefix-map (kbd "f o")))) (should (eq 'pearl-list-issues-by-project (lookup-key pearl-prefix-map (kbd "f p")))) (should (eq 'pearl-list-issues-filtered (lookup-key pearl-prefix-map (kbd "f f")))) (should (eq 'pearl-run-linear-view (lookup-key pearl-prefix-map (kbd "f v")))) - (should (eq 'pearl-run-local-view (lookup-key pearl-prefix-map (kbd "f q")))) + (should (eq 'pearl-run-local-view (lookup-key pearl-prefix-map (kbd "f l")))) (should (eq 'pearl-publish-local-view - (lookup-key pearl-prefix-map (kbd "f S")))) + (lookup-key pearl-prefix-map (kbd "f u")))) (should (eq 'pearl-publish-current-view (lookup-key pearl-prefix-map (kbd "f P"))))) @@ -85,16 +85,18 @@ The lowercase `c' is no longer a direct command -- it is the create prefix." (should (eq 'pearl-edit-assignee (lookup-key pearl-prefix-map (kbd "e a")))) (should (eq 'pearl-edit-labels (lookup-key pearl-prefix-map (kbd "e l")))) (should (eq 'pearl-edit-current-comment (lookup-key pearl-prefix-map (kbd "e c")))) + (should (eq 'pearl-edit-local-view (lookup-key pearl-prefix-map (kbd "e v")))) ;; priority has no edit command (org-native cookie); e p is unbound (should-not (lookup-key pearl-prefix-map (kbd "e p")))) (ert-deftest test-pearl-prefix-map-create-and-delete-groups () - "Create and delete groups resolve issue/comment under c and k." + "Create and delete groups resolve issue/comment plus the local-view slot." (should (eq 'pearl-create-issue (lookup-key pearl-prefix-map (kbd "c t")))) (should (eq 'pearl-create-comment (lookup-key pearl-prefix-map (kbd "c c")))) + (should (eq 'pearl-create-local-view (lookup-key pearl-prefix-map (kbd "c v")))) (should (eq 'pearl-delete-current-issue (lookup-key pearl-prefix-map (kbd "k t")))) (should (eq 'pearl-delete-current-comment (lookup-key pearl-prefix-map (kbd "k c")))) - (should (eq 'pearl-delete-local-view (lookup-key pearl-prefix-map (kbd "k q"))))) + (should (eq 'pearl-delete-local-view (lookup-key pearl-prefix-map (kbd "k v"))))) (ert-deftest test-pearl-prefix-map-open-and-copy-groups () "The open group resolves the two open actions; copy resolves copy-url." |
