diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-01 17:33:09 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-01 17:33:09 -0500 |
| commit | c2ba1d8f25463bf6342ac635850500a9738b31e9 (patch) | |
| tree | 69518c846bc2e9b11559dc637b6ee81d9d3511c0 /pearl.el | |
| parent | 4eab7a048ca18eeef31e4f8d0823182fc6e2368f (diff) | |
| download | pearl-c2ba1d8f25463bf6342ac635850500a9738b31e9.tar.gz pearl-c2ba1d8f25463bf6342ac635850500a9738b31e9.zip | |
refactor: rename saved-query surface to local-view vocabulary
I renamed Pearl's "saved query" surface to the local/Linear view vocabulary, with no obsolete aliases, since Pearl has no users to protect. The defcustom pearl-saved-queries is now pearl-local-views. The commands pearl-run-saved-query, pearl-delete-saved-query, pearl-sync-saved-query-to-linear, pearl-run-view, and pearl-publish-current-source become pearl-run-local-view, pearl-delete-local-view, pearl-publish-local-view, pearl-run-linear-view, and pearl-publish-current-view.
User-facing prompts, messages, and docstrings drop "saved query" for "local view", and the publish command reads "publish" instead of "sync". Internal GraphQL and helper names keep their "query" terms, which a user never sees. A naming-regression test asserts the new symbols exist, the old ones are gone rather than aliased, and no public command exposes "query".
Phase 1 of docs/local-and-linear-views-spec.org. No behavior change. Suite, compile, and lint are green.
Diffstat (limited to 'pearl.el')
| -rw-r--r-- | pearl.el | 228 |
1 files changed, 114 insertions, 114 deletions
@@ -27,7 +27,7 @@ ;; pearl integrates Linear.app issue tracking with Emacs and org-mode. ;; Fetch your issues -- open issues, a project, an ad-hoc filter, a Linear -;; Custom View, or a named saved query -- into a single self-describing org +;; Custom View, or a named local view -- into a single self-describing org ;; file: each issue is a heading, its description and comments render in the ;; body, and its structured fields live in a namespaced LINEAR-* drawer. ;; @@ -1067,7 +1067,7 @@ dashboard / other)." "Fetch the viewer's favorites and call CALLBACK with a list of normalized favorite plists (Linear sort-order preserved). Paged via first/after; on a transport/GraphQL error, CALLBACK receives whatever was collected so far so the -picker can fall back to local saved queries rather than hanging." +picker can fall back to local views rather than hanging." (let (acc) (cl-labels ((collect (data) @@ -1087,8 +1087,8 @@ picker can fall back to local saved queries rather than hanging." pearl--favorites-query nil #'collect (lambda (&rest _) ;; HP5: a fetch error is not "no favorites" -- message it so the - ;; picker's fallback to saved queries doesn't masquerade as success. - (message "Pearl: favorites fetch failed; showing saved queries only") + ;; picker's fallback to local views doesn't masquerade as success. + (message "Pearl: favorites fetch failed; showing local views only") (funcall callback (nreverse acc))))))) (defun pearl--normalize-comment (raw) @@ -3539,8 +3539,8 @@ just writing the file and leaving it off-screen." (file-name-nondirectory org-file-path)) (pearl--surface-buffer existing-buf))))))) -(defcustom pearl-saved-queries nil - "Named local issue queries, run with `pearl-run-saved-query'. +(defcustom pearl-local-views nil + "Named local views, run with `pearl-run-local-view'. Each entry is (NAME . SPEC) where SPEC is a plist with `:filter' (an authoring filter plist), and optional `:sort' (`updated', `created', `priority', or `title') and `:order' (`asc' or `desc', default `desc'). AND-only in v1; use a @@ -3575,9 +3575,9 @@ produces the same heading order rather than reshuffling into noise." ;;; Sentinel infrastructure for filter / pick-one prompts ;; ;; These sentinel constants and helpers back the prompt UX shared by -;; `pearl-run-saved-query', `pearl-delete-saved-query', +;; `pearl-run-local-view', `pearl-delete-local-view', ;; `pearl-list-issues-filtered', `pearl-pick-source', and -;; `pearl-sync-saved-query-to-linear'. Defined ahead of those commands so +;; `pearl-publish-local-view'. Defined ahead of those commands so ;; the byte-compiler resolves the references in order. (defconst pearl--filter-any "[ Any. ]" @@ -3590,7 +3590,7 @@ than a hidden empty-input idiom.") (defconst pearl--filter-cancel "[ Cancel. ]" "Sentinel candidate shown at the top of pick-an-existing-thing prompts -(delete a saved query, run a saved query) where the opt-out reads as +(delete a local view, run a local view) where the opt-out reads as \"don't do this\" rather than \"no constraint.\" Cancelling these prompts is a real choice, not a missing one.") @@ -3638,25 +3638,25 @@ prompts (delete, overwrite) where typing \"yes\" is a safety affordance." (string= "yes" choice))) ;;;###autoload -(defun pearl-run-saved-query (name) - "Run the saved query NAME from `pearl-saved-queries'. +(defun pearl-run-local-view (name) + "Run the local view NAME from `pearl-local-views'. Interactively, completes over the configured query names. Compiles the stored filter, fetches, sorts per the query's `:sort'/`:order', and renders into the active file with the query recorded as the source." (interactive - (list (if (null pearl-saved-queries) - (user-error "No saved queries configured") + (list (if (null pearl-local-views) + (user-error "No local views configured") (completing-read - "Saved query: " + "Local view: " (pearl--completion-table-keep-order (pearl--with-sentinel pearl--filter-cancel - (mapcar #'car pearl-saved-queries))) + (mapcar #'car pearl-local-views))) nil t)))) (when (pearl--filter-sentinel-value-p name) - (user-error "Cancelled; no saved query run")) - (let ((entry (assoc name pearl-saved-queries))) + (user-error "Cancelled; no local view run")) + (let ((entry (assoc name pearl-local-views))) (unless entry - (user-error "No saved query named %s" name)) + (user-error "No local view named %s" name)) (let* ((spec (cdr entry)) (filter-plist (plist-get spec :filter)) (sort (plist-get spec :sort)) @@ -3671,19 +3671,19 @@ active file with the query recorded as the source." (when (and pearl-accounts q-account) (let ((active (plist-get (pearl--current-account-context) :name))) (unless (string-equal q-account active) - (user-error "Saved query '%s' belongs to %s; switch accounts first" + (user-error "Local view '%s' belongs to %s; switch accounts first" name q-account))))) - ;; Validate the saved query's authoring plist at the command boundary so + ;; Validate the local view's authoring plist at the command boundary so ;; a typo'd key or bad value surfaces as a clear user-error instead of ;; being silently dropped or failing deeper in the compiler. (pearl--validate-issue-filter filter-plist) - (pearl--progress "Running saved query %s..." name) + (pearl--progress "Running local view %s..." name) (pearl--query-issues-async (pearl--build-issue-filter filter-plist) (lambda (result) (pearl--render-query-result result source)) (pearl--sort->order-by sort))))) -;;; pearl-pick-source -- the unified source picker (favorites + saved queries) +;;; pearl-pick-source -- the unified source picker (favorites + local views) (defun pearl--saved-query-scope-label (spec teams) "Return the scope display label for SPEC (a saved-query plist). @@ -3707,15 +3707,15 @@ user rather than silently mis-labelling)." (defun pearl--pick-source-candidates (favorites saved-queries &optional teams) "Build the picker's candidate alist `((DISPLAY . SOURCE-OR-ACTION) ...)'. FAVORITES is a list of normalized favorite plists; SAVED-QUERIES is the -`pearl-saved-queries' alist; TEAMS is the team alist list (see +`pearl-local-views' alist; TEAMS is the team alist list (see `pearl--all-teams') used to resolve the scope name of any saved-query entry carrying `:linear-view-id'. Favorites come first in ascending -`:sort-order'; saved queries follow alphabetically. +`:sort-order'; local views follow alphabetically. Each DISPLAY is one of: `[KIND] TITLE' for favorites - `[saved] NAME' for a local-only saved query - `[saved \\u2192 SCOPE] NAME' for a synced saved query + `[saved] NAME' for a local-only local view + `[saved \\u2192 SCOPE] NAME' for a synced local view where SCOPE is the team name resolved from `:linear-view-team-id' against TEAMS, or \"Personal\" when there's no team scope, or \"?\" when the team id is stale (no longer in TEAMS) or TEAMS is nil. @@ -3790,19 +3790,19 @@ on success so the user sees what happened." ;;;###autoload (defun pearl-pick-source () - "Pick a Linear favorite or local saved query and fetch it into the active file. -Favorites are listed first in Linear's sort order, then local saved queries + "Pick a Linear favorite or local view and fetch it into the active file. +Favorites are listed first in Linear's sort order, then local views alphabetically. Non-list favorites (issue, document, ...) open in the browser instead. On a favorites-fetch failure the picker still offers any local saved queries -- favorites-failure is not the same user state as \"no favorites\". -With neither favorites nor saved queries, signals a `user-error' naming the +With neither favorites nor local views, signals a `user-error' naming the missing setup." (interactive) (pearl--progress "Fetching favorites...") - (let ((saved pearl-saved-queries)) + (let ((saved pearl-local-views)) (pearl--favorites-async (lambda (favorites) - ;; Only fetch teams when at least one saved query is synced -- scope + ;; Only fetch teams when at least one local view is synced -- scope ;; resolution is the only thing teams data feeds, and an all-local ;; configuration has no scopes to resolve. (let* ((teams (and (cl-some (lambda (sq) @@ -3812,7 +3812,7 @@ missing setup." (cands (pearl--pick-source-candidates favorites saved teams))) (unless cands (user-error - "No favorites or saved queries -- star views in Linear, or set `pearl-saved-queries'")) + "No favorites or local views -- star views in Linear, or set `pearl-local-views'")) (let* ((display (completing-read "Source: " (mapcar #'car cands) nil t)) (source (cdr (assoc display cands)))) (cond @@ -3922,16 +3922,16 @@ an id), or `pearl--filter-any' (any assignee, no scoping)." open state project labels assignee))) (defun pearl--delete-saved-query-local (name) - "Remove NAME from `pearl-saved-queries' and persist via Customize. + "Remove NAME from `pearl-local-views' and persist via Customize. The unconditional persistence path shared by the local-only delete and the synced-entry unlink branch." - (setq pearl-saved-queries - (cl-remove name pearl-saved-queries :key #'car :test #'string=)) - (customize-save-variable 'pearl-saved-queries pearl-saved-queries)) + (setq pearl-local-views + (cl-remove name pearl-local-views :key #'car :test #'string=)) + (customize-save-variable 'pearl-local-views pearl-local-views)) ;;;###autoload -(defun pearl-delete-saved-query (name) - "Delete the saved query NAME from `pearl-saved-queries' after confirmation. +(defun pearl-delete-local-view (name) + "Delete the local view NAME from `pearl-local-views' after confirmation. Interactively, completes over the configured query names with `pearl--filter-cancel' at the top. Local-only entries are removed from the customized list and persisted via `customize-save-variable'; entries @@ -3943,29 +3943,29 @@ entry but leaves the Linear view in place; picking YES calls entry anyway (which leaves the Linear view orphaned -- the message names the id so it can be deleted by hand)." (interactive - (list (if (null pearl-saved-queries) - (user-error "No saved queries to delete") + (list (if (null pearl-local-views) + (user-error "No local views to delete") (completing-read - "Delete saved query: " + "Delete local view: " (pearl--completion-table-keep-order (pearl--with-sentinel pearl--filter-cancel - (mapcar #'car pearl-saved-queries))) + (mapcar #'car pearl-local-views))) nil t)))) (cond ((pearl--filter-sentinel-value-p name) - (message "Cancelled; no saved query deleted")) - ((not (assoc name pearl-saved-queries)) - (user-error "No saved query named %s" name)) - ((not (yes-or-no-p (format "Delete saved query %s? " name))) - (message "Kept saved query %s" name)) + (message "Cancelled; no local view deleted")) + ((not (assoc name pearl-local-views)) + (user-error "No local view named %s" name)) + ((not (yes-or-no-p (format "Delete local view %s? " name))) + (message "Kept local view %s" name)) (t - (let ((view-id (plist-get (cdr (assoc name pearl-saved-queries)) + (let ((view-id (plist-get (cdr (assoc name pearl-local-views)) :linear-view-id))) (cond ;; Local-only entry: unchanged behavior. ((null view-id) (pearl--delete-saved-query-local name) - (message "Deleted saved query %s" name)) + (message "Deleted local view %s" name)) ;; Synced entry: ask whether to also drop the Linear view. ((yes-or-no-p (format "Also delete the linked Linear view (\"%s\")? " name)) @@ -3973,7 +3973,7 @@ the id so it can be deleted by hand)." (t ;; Unlink only: drop the local entry, leave the Linear view alone. (pearl--delete-saved-query-local name) - (message "Deleted saved query %s; Linear view kept (id %s)" + (message "Deleted local view %s; Linear view kept (id %s)" name view-id))))))) (defun pearl--delete-saved-query-do-linear-delete (name view-id) @@ -3988,10 +3988,10 @@ by hand." (cond (success (pearl--delete-saved-query-local name) - (message "Deleted saved query %s and removed view from Linear" name)) + (message "Deleted local view %s and removed view from Linear" name)) ((plist-get result :timeout) (message - "Delete of Linear view for %s timed out after %ds; saved query left in place -- the delete may still have completed (view id %s) -- re-run after the network recovers." + "Delete of Linear view for %s timed out after %ds; local view left in place -- the delete may still have completed (view id %s) -- re-run after the network recovers." name pearl-request-timeout view-id)) ((yes-or-no-p (format @@ -3999,22 +3999,22 @@ by hand." (or (plist-get result :error) "unknown error"))) (pearl--delete-saved-query-local name) (message - "Deleted saved query %s; Linear view is orphaned (id %s, delete manually)" + "Deleted local view %s; Linear view is orphaned (id %s, delete manually)" name view-id)) (t - (message "Kept saved query %s; Linear view also untouched" name))))) + (message "Kept local view %s; Linear view also untouched" name))))) (defun pearl--save-query (name filter-plist &optional sort order) - "Save FILTER-PLIST as the saved query NAME, replacing any entry of that NAME. -Persists `pearl-saved-queries' via Customize. SORT and ORDER are + "Save FILTER-PLIST as the local view NAME, replacing any entry of that NAME. +Persists `pearl-local-views' via Customize. SORT and ORDER are stored when given." (let ((entry (cons name (append (list :filter filter-plist) (when sort (list :sort sort)) (when order (list :order order)))))) - (setq pearl-saved-queries - (cons entry (assoc-delete-all name (copy-sequence pearl-saved-queries)))) + (setq pearl-local-views + (cons entry (assoc-delete-all name (copy-sequence pearl-local-views)))) (ignore-errors - (customize-save-variable 'pearl-saved-queries pearl-saved-queries)))) + (customize-save-variable 'pearl-local-views pearl-local-views)))) ;;; Saved-query -> Linear view sync (see docs/saved-query-sync-spec.org) @@ -4033,7 +4033,7 @@ agree byte-for-byte." (defun pearl--sync-scope-candidates (teams filter-team-key) "Build the (DISPLAY . PLIST) candidate list for the scope-and-visibility prompt. TEAMS is the team alist list returned by `pearl--all-teams' (each carries -`id', `key', `name'). FILTER-TEAM-KEY is the saved query's filter `:team' +`id', `key', `name'). FILTER-TEAM-KEY is the local view's filter `:team' value (a team key string) or nil. Each candidate's PLIST is `(:team-id ID-OR-NIL :team-name NAME :shared @@ -4095,7 +4095,7 @@ Returns the matching view alist or nil." views))) (defun pearl--save-query-mark-synced (name team-id shared view-id &optional view-url) - "Persist the sync metadata for saved query NAME. + "Persist the sync metadata for local view NAME. TEAM-ID is the team UUID or nil (personal scope). SHARED is t or nil. VIEW-ID is the Linear custom view UUID returned by the API. VIEW-URL, when provided, is the view's Linear web URL so @@ -4106,11 +4106,11 @@ unavailable to leave the prior `:linear-view-url' untouched. Adds or overwrites `:linear-view-id', `:linear-view-team-id', `:linear-view-shared', `:linear-view-synced-at', and (when VIEW-URL is non-nil) `:linear-view-url' on the entry, then persists -`pearl-saved-queries' via Customize. Signals `user-error' when NAME -isn't in `pearl-saved-queries'." - (let ((entry (assoc name pearl-saved-queries))) +`pearl-local-views' via Customize. Signals `user-error' when NAME +isn't in `pearl-local-views'." + (let ((entry (assoc name pearl-local-views))) (unless entry - (user-error "No saved query named %s" name)) + (user-error "No local view named %s" name)) ;; Copy the existing spec and plist-put each sync key on top. Earlier ;; versions rebuilt the spec from `:filter', `:sort', `:order' + the four ;; sync keys, which silently dropped any other key on the entry -- a @@ -4127,10 +4127,10 @@ isn't in `pearl-saved-queries'." ;; whose API response somehow lacks the URL must not erase the prior. (when view-url (setq new-spec (plist-put new-spec :linear-view-url view-url))) - (setq pearl-saved-queries + (setq pearl-local-views (cons (cons name new-spec) - (assoc-delete-all name (copy-sequence pearl-saved-queries)))) - (customize-save-variable 'pearl-saved-queries pearl-saved-queries)))) + (assoc-delete-all name (copy-sequence pearl-local-views)))) + (customize-save-variable 'pearl-local-views pearl-local-views)))) (defun pearl--sync-record-or-orphan-error (name team-id shared view-id verb &optional scope-label view-url) @@ -4156,14 +4156,14 @@ local link couldn't be saved." t) (error (message - "View %s on Linear as %s but local link couldn't be saved (%s). Re-run `pearl-sync-saved-query-to-linear' and pick Replace to reconcile." + "View %s on Linear as %s but local link couldn't be saved (%s). Re-run `pearl-publish-local-view' and pick Replace to reconcile." (if (string= verb "Updated") "updated" "created") view-id (error-message-string err)) nil))) (defun pearl--sync-saved-query-pick-scope (filter-plist) "Prompt the user for the destination scope of a sync-up. -FILTER-PLIST is the saved query's authoring filter (used to derive the +FILTER-PLIST is the local view's authoring filter (used to derive the default candidate). Returns `(DISPLAY . PLIST)', or nil when the user cancels via the cancel sentinel. DISPLAY is the candidate string the user picked; PLIST is `(:team-id ID-OR-NIL :team-name NAME :shared @@ -4210,32 +4210,32 @@ so the user isn't told the API refused something that never reached it." (if done result (list :success nil :timeout t)))) ;;;###autoload -(defun pearl-sync-saved-query-to-linear (name) - "Sync the local saved query NAME up to Linear as a Custom View. -First-time sync prompts for the destination scope (team and visibility), -then calls `customViewCreate'. Re-syncing an already-synced entry calls +(defun pearl-publish-local-view (name) + "Publish the local view NAME to Linear as a Custom View. +First publish prompts for the destination scope (team and visibility), +then calls `customViewCreate'. Re-publishing an already-published entry calls `customViewUpdate' against the stored view id -- the stored team and shared flag stay (use Replace/Rename below to reset them). A same-name collision in the chosen scope prompts Replace / Rename / Cancel. On success the entry is extended with the four `:linear-view-*' keys via `customize-save-variable'. On a successful API call followed by a persist failure, the message names the orphan view's id explicitly so -the user can re-sync with Replace to reconcile." +the user can re-publish with Replace to reconcile." (interactive - (list (if (null pearl-saved-queries) - (user-error "No saved queries to sync") + (list (if (null pearl-local-views) + (user-error "No local views to publish") (completing-read - "Sync saved query: " + "Publish local view: " (pearl--completion-table-keep-order (pearl--with-sentinel pearl--filter-cancel - (mapcar #'car pearl-saved-queries))) + (mapcar #'car pearl-local-views))) nil t)))) (when (pearl--filter-sentinel-value-p name) - (user-error "Cancelled; no saved query synced")) + (user-error "Cancelled; no local view published")) (pearl--require-account-context t) - (let ((entry (assoc name pearl-saved-queries))) + (let ((entry (assoc name pearl-local-views))) (unless entry - (user-error "No saved query named %s" name)) + (user-error "No local view named %s" name)) (let* ((spec (cdr entry)) (filter-plist (plist-get spec :filter)) (existing-view-id (plist-get spec :linear-view-id)) @@ -4255,7 +4255,7 @@ the user can re-sync with Replace to reconcile." ;; clicking through the scope picker only to hit "Linear refused". (unless filter-data (user-error - "Saved query %s has no filter constraints; Linear views need at least one constraint -- add one and re-sync" + "Local view %s has no filter constraints; Linear views need at least one constraint -- add one and re-sync" name)) (let ((scope-pair (if existing-view-id @@ -4281,7 +4281,7 @@ the user can re-sync with Replace to reconcile." ;; nil (cancel). (pearl--sync-saved-query-pick-scope filter-plist)))) (unless scope-pair - (user-error "Cancelled; no saved query synced")) + (user-error "Cancelled; no local view published")) ;; Validate the filter at the boundary so a malformed entry surfaces ;; before the API call. (pearl--validate-issue-filter filter-plist) @@ -4302,7 +4302,7 @@ the user can re-sync with Replace to reconcile." target-name)))) (pcase action ('cancel - (message "Cancelled; %s left unsynced" target-name)) + (message "Cancelled; %s left unpublished" target-name)) ('rename (setq target-name (read-string (format "New view name (was %s): " name))) @@ -4326,7 +4326,7 @@ the user can re-sync with Replace to reconcile." (defun pearl--sync-saved-query-do-create (name target-name team-id shared filter-data scope-label) - "Create a Linear view from saved query NAME, persisting the link on success. + "Create a Linear view from local view NAME, persisting the link on success. TARGET-NAME is the view name to send to Linear (usually NAME, but may differ when the user picked Rename to dodge a collision). TEAM-ID, SHARED, FILTER-DATA are the Linear API inputs. SCOPE-LABEL is the @@ -4342,24 +4342,24 @@ scope-and-visibility display string for the success message." (cond ((and success view-id) (pearl--sync-record-or-orphan-error - name team-id shared view-id "Synced" scope-label view-url)) + name team-id shared view-id "Published" scope-label view-url)) ((plist-get result :timeout) (message - "Sync of %s timed out after %ds; the create may still complete on Linear -- re-run and pick Replace to reconcile if a duplicate appears." + "Publish of %s timed out after %ds; the create may still complete on Linear -- re-run and pick Replace to reconcile if a duplicate appears." name pearl-request-timeout)) (t - (message "Failed to sync %s: %s" name + (message "Failed to publish %s: %s" name (or (plist-get result :error) "Linear refused the create")))))) ;;;###autoload -(defun pearl-publish-current-source () - "Publish the active buffer's local saved query to Linear as a Custom View. +(defun pearl-publish-current-view () + "Publish the active buffer's local view to Linear as a Custom View. Convenience wrapper. Reads `#+LINEAR-SOURCE' from the current buffer. -When it's a `:type filter' source whose `:name' matches a local saved -query, dispatches to `pearl-sync-saved-query-to-linear' with that name -pre-filled. Otherwise refuses with a clear message: the source is -already a Linear view (no publish needed), the filter is transient (no -name to sync under), or no local saved query matches the recorded name. +When it's a `:type filter' source whose `:name' matches a local view, +dispatches to `pearl-publish-local-view' with that name pre-filled. +Otherwise refuses with a clear message: the source is already a Linear +view (no publish needed), the filter is transient (no name to publish +under), or no local view matches the recorded name. Bound under \\='C-; L f P\\=' inside `pearl-mode' buffers; reachable through the transient as the `U' (upload) entry in the Fetch group." @@ -4379,15 +4379,15 @@ through the transient as the `U' (upload) entry in the Fetch group." type)) ((or (null name) (and (stringp name) (string-blank-p name))) (user-error "Source has no name; save it first via pearl-list-issues-filtered then re-publish")) - ((not (assoc name pearl-saved-queries)) - (user-error "No local saved query named %s; save it first via pearl-list-issues-filtered" + ((not (assoc name pearl-local-views)) + (user-error "No local view named %s; save it first via pearl-list-issues-filtered" name)) (t - (pearl-sync-saved-query-to-linear name))))) + (pearl-publish-local-view name))))) (defun pearl--sync-saved-query-do-update (name view-id team-id shared filter-data scope-label) - "Update an existing Linear view from saved query NAME by VIEW-ID. + "Update an existing Linear view from local view NAME by VIEW-ID. TEAM-ID, SHARED, FILTER-DATA are the Linear API inputs. SCOPE-LABEL is the scope-and-visibility display string for the success message." (pearl--progress "Updating Linear view %s..." name) @@ -4423,7 +4423,7 @@ filter; SAVE-NAME, when given, persists it via `pearl--save-query'." (interactive (list (pearl--read-filter-interactively) (when (pearl--read-yes-no "Save this filter locally so you can re-run it (not pushed to Linear)? ") - (read-string "Name for this saved query: ")))) + (read-string "Name for this local view: ")))) ;; Validate before saving or running, so a bad filter never gets persisted ;; or run -- the command boundary is where the clear error belongs. (pearl--validate-issue-filter filter-plist) @@ -4463,7 +4463,7 @@ no Comments subtree." "Render a query RESULT into the active file, tagged with SOURCE. Normalizes the raw nodes, writes them via `pearl--update-org-from-issues' with SOURCE and the truncation flag, and reports the outcome. The one render -boundary shared by list-issues, the ad-hoc filter, saved queries, views, and +boundary shared by list-issues, the ad-hoc filter, local views, views, and refresh." (pcase (pearl--query-result-status result) ('ok @@ -5613,7 +5613,7 @@ commands. Errors if no source is recorded." (_ (user-error "Unknown Linear source type: %s" (plist-get source :type))))))) ;;;###autoload -(defun pearl-run-view (view-name) +(defun pearl-run-linear-view (view-name) "Run a Linear Custom View by VIEW-NAME and render it into the active file. Interactively, completes over the workspace's Custom Views. The view's own filter runs server-side; the result replaces the active file (behind the @@ -6155,17 +6155,17 @@ body stay." ["Delete" ("k" "delete issue" pearl-delete-current-issue) ("K" "delete comment" pearl-delete-current-comment) - ("q" "delete saved query" pearl-delete-saved-query)]] + ("q" "delete local view" pearl-delete-local-view)]] ["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-view) - ("Q" "saved query" pearl-run-saved-query) - ("S" "sync saved query" pearl-sync-saved-query-to-linear) - ("U" "upload current source" pearl-publish-current-source)] + ("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" ("g" "refresh view" pearl-refresh-current-view) ("r" "refresh issue" pearl-refresh-current-issue) @@ -6205,12 +6205,12 @@ 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-view)) - (define-key map "q" (cons "saved query" #'pearl-run-saved-query)) - (define-key map "S" (cons "sync saved query to Linear" - #'pearl-sync-saved-query-to-linear)) + (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-source)) + #'pearl-publish-current-view)) map) "Pearl fetch commands; a sub-keymap of `pearl-prefix-map'.") @@ -6235,7 +6235,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 saved query" #'pearl-delete-saved-query)) + (define-key map "q" (cons "delete local view" #'pearl-delete-local-view)) map) "Pearl delete commands; a sub-keymap of `pearl-prefix-map'.") |
