aboutsummaryrefslogtreecommitdiff
path: root/tests/test-pearl-issues.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-28 09:28:53 -0500
committerCraig Jennings <c@cjennings.net>2026-05-28 09:28:53 -0500
commitfd94237903c15883173e438a5af4ba4e6bfdbd46 (patch)
tree05bd91e8c66f0332c8acb174aa64257e262367ac /tests/test-pearl-issues.el
parentc8b9ad1b72c60f87c15e942f17f7ff1066a41cb2 (diff)
downloadpearl-fd94237903c15883173e438a5af4ba4e6bfdbd46.tar.gz
pearl-fd94237903c15883173e438a5af4ba4e6bfdbd46.zip
feat(view-sync): pearl-pick-source distinguishes [saved] / [saved → scope] / [view]
This is Phase 4 of docs/saved-query-sync-spec.org (§ Extended pearl-pick-source candidate label). The picker now reads where each saved query lives at a glance: - `[saved] Name`: local-only saved query, dispatches as :type filter (unchanged) - `[saved → Engineering] Name`: synced to a team-scoped Linear view - `[saved → Personal] Name`: synced as a personal Linear view - `[saved → ?] Name`: synced, but the team id no longer resolves (deleted/renamed on Linear) or the teams cache wasn't loaded - `[view] Name`: Linear-authored view favorite (unchanged) A synced entry's source plist gets :type view, so the existing view-dispatch branch in pearl-pick-source routes through pearl--query-view-async against the linked Linear view. Refresh and pagination honor whatever the view's filter is on Linear now, not the local authoring filter pearl built it from. I added pearl--saved-query-scope-label to resolve the scope string from (spec, teams) and extended pearl--pick-source-candidates with an optional teams argument. pearl-pick-source fetches pearl--all-teams lazily, only when at least one saved query carries :linear-view-id, and feeds the result in. An all-local configuration pays no extra network cost. While in the picker code I also closed a latent gap the review surfaced: pearl-open-current-view-in-linear was about to break on synced-saved-query sources because the source plist had no :url. I extended pearl--customview-create-async and -update-async to fetch `url` in the response, pearl--save-query-mark-synced to take an optional VIEW-URL arg and store it as :linear-view-url, and the picker source plist to surface :url when the entry has one. Entries synced before this commit have no stored URL. A re-sync repopulates it. Mark-synced preserves a prior URL when VIEW-URL is omitted, so a re-sync whose API response somehow lacks the URL doesn't erase the working one. 15 new tests across test-pearl-favorites.el (the picker labels for team-scope, Personal, unknown-team, no-teams-arg, URL surfaced + URL absent, mixed local/synced) and test-pearl-saved-query-sync.el (mark-synced stores URL when given, preserves prior URL on re-sync omission). The existing 4 pick-source tests stay green. They pass either no teams arg or nil, so the scope-resolution branch is dead in their cases. 653 ert tests total green. make compile and make lint clean. Lower-severity findings from the review filed as follow-ups: the `?` label conflates "unknown team" and "no teams data" (could be split). pearl--all-teams cache has no TTL so stale team names persist across renames. The lazy teams fetch reuses the "Fetching favorites..." progress message during its own roundtrip. Synced entries silently drop the local :sort/:order because Linear's view doesn't carry them in v1.
Diffstat (limited to 'tests/test-pearl-issues.el')
0 files changed, 0 insertions, 0 deletions