diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-02 13:04:01 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-02 13:04:01 -0500 |
| commit | c11592ed56b895dc3ec4cfae7e9df8e77d641c2c (patch) | |
| tree | 53b24a6abfcdc120b1fcad710a6bea5f6f77e810 /tests/test-pearl-keymap.el | |
| parent | 1a34cb26cbaec7af31a0d93a8f1c563eb5e45be5 (diff) | |
| download | pearl-c11592ed56b895dc3ec4cfae7e9df8e77d641c2c.tar.gz pearl-c11592ed56b895dc3ec4cfae7e9df8e77d641c2c.zip | |
feat(views): wire the default view into the keymap, transient, and docs
Phase 3, the last of the default-view spec: surface the phase 1-2 commands and flip the hot key over.
Top-level l now runs pearl-open-default-view instead of pearl-list-issues, so it opens your default. The literal my-open-issues fetch stays reachable at f o, and l is unchanged until you set a default. v D binds pearl-set-default-view (the slot the keybinding reconciliation reserved), and the transient Views group gets a . suffix for it. D there stays save-locally.
README documents the default view: what l does, how to set and clear it, the Customize persistence, and the per-account scoping under multiple accounts.
Keymap and menu tests updated for the l rebind, the v D binding, and the transient suffix. Suite holds at 809, compile and lint clean.
Diffstat (limited to 'tests/test-pearl-keymap.el')
| -rw-r--r-- | tests/test-pearl-keymap.el | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/tests/test-pearl-keymap.el b/tests/test-pearl-keymap.el index 643005b..9650652 100644 --- a/tests/test-pearl-keymap.el +++ b/tests/test-pearl-keymap.el @@ -48,8 +48,9 @@ Walks MAP looking for a labeled binding (\"label\" . COMMAND)." (ert-deftest test-pearl-prefix-map-direct-hot-keys () "The hot-path commands resolve in one key under the prefix. -The lowercase `c' is no longer a direct command -- it is the create prefix." - (should (eq 'pearl-list-issues (lookup-key pearl-prefix-map (kbd "l")))) +The lowercase `c' is no longer a direct command -- it is the create prefix. +`l' opens the configurable default view, not the literal my-open-issues fetch." + (should (eq 'pearl-open-default-view (lookup-key pearl-prefix-map (kbd "l")))) (should (eq 'pearl-refresh-current-view (lookup-key pearl-prefix-map (kbd "g")))) (should (eq 'pearl-refresh-current-issue (lookup-key pearl-prefix-map (kbd "r")))) (should (eq 'pearl-save-issue (lookup-key pearl-prefix-map (kbd "s")))) @@ -97,9 +98,9 @@ local view; `u'/`U' publish (copy up); `d' saves a Linear view locally (should (eq 'pearl-publish-current-view (lookup-key pearl-prefix-map (kbd "v U")))) (should (eq 'pearl-save-linear-view-locally (lookup-key pearl-prefix-map (kbd "v d"))))) -(ert-deftest test-pearl-prefix-map-views-default-slot-reserved () - "`v D' is reserved for the not-yet-built set-default-view; it stays unbound." - (should-not (lookup-key pearl-prefix-map (kbd "v D")))) +(ert-deftest test-pearl-prefix-map-views-set-default () + "`v D' binds set-default-view -- the slot the keybinding reservation held." + (should (eq 'pearl-set-default-view (lookup-key pearl-prefix-map (kbd "v D"))))) (ert-deftest test-pearl-prefix-map-edit-group () "The edit group resolves field-edit commands only -- no view edit anymore." @@ -138,14 +139,17 @@ local view; `u'/`U' publish (copy up); `d' saves a Linear view locally (should (eq 'pearl-toggle-debug (lookup-key pearl-prefix-map (kbd "w !")))) (should (eq 'pearl-clear-cache (lookup-key pearl-prefix-map (kbd "w x"))))) -(ert-deftest test-pearl-prefix-map-common-commands-bound-twice () - "The most common commands resolve both directly and inside their group." - ;; edit-description: direct d and e d +(ert-deftest test-pearl-prefix-map-hot-keys-vs-groups () + "edit-description is dual-bound; the l hot key opens the default while the +literal my-open-issues fetch stays at f o (they are no longer the same command)." + ;; edit-description: direct d and e d resolve to the same command (should (eq (lookup-key pearl-prefix-map (kbd "d")) (lookup-key pearl-prefix-map (kbd "e d")))) - ;; list issues: direct l and f o - (should (eq (lookup-key pearl-prefix-map (kbd "l")) - (lookup-key pearl-prefix-map (kbd "f o"))))) + ;; l opens the configurable default; f o is the literal fetch -- distinct now + (should (eq 'pearl-open-default-view (lookup-key pearl-prefix-map (kbd "l")))) + (should (eq 'pearl-list-issues (lookup-key pearl-prefix-map (kbd "f o")))) + (should-not (eq (lookup-key pearl-prefix-map (kbd "l")) + (lookup-key pearl-prefix-map (kbd "f o"))))) (ert-deftest test-pearl-prefix-map-which-key-labels () "Leaf bindings carry verb labels; sub-prefixes carry +labels." @@ -159,6 +163,8 @@ local view; `u'/`U' publish (copy up); `d' saves a Linear view locally (test-pearl-keymap--label-of pearl-copy-map 'pearl-copy-issue-url))) (should (string= "run local view" (test-pearl-keymap--label-of pearl-views-map 'pearl-run-local-view))) + (should (string= "set default view" + (test-pearl-keymap--label-of pearl-views-map 'pearl-set-default-view))) (should (string= "switch account" (test-pearl-keymap--label-of pearl-workspace-map 'pearl-switch-account))) (should (string= "+edit" (test-pearl-keymap--label-of pearl-prefix-map pearl-edit-map))) |
