From 9b9a264edb0c208892fcfe5101912d00858de766 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 1 Jun 2026 18:21:47 -0500 Subject: feat(views): save a Linear view locally via the reverse-compile (copy down) I implemented copy-down, the one direction that needed real engine work. A live probe showed CustomView.filterData is readable but stored as Linear's and/or view-filter tree, not the flat IssueFilter Pearl emits, so pearl--reverse-compile-issue-filter is a normalize-then-match: it flattens the top-level and, unwraps single-branch and/or, reads a one-element in as a scalar, then matches each conjunct to one authoring key. Every helper returns (ok . plist) or (refuse . reason). The contract follows the spec's dimension table: distinct :state and :state-type, canonical numeric :priority, :open t mapped from the exact open-state nin while generic nin refuses, and a multi-value in on any singular key refuses rather than silently narrow the view. Anything outside Pearl's AND-only model refuses with a structured reason that names the construct. pearl-save-linear-view-locally lists favorited Linear views, fetches the chosen view's filterData through a small async helper, reverse-compiles it, and saves a forked local view through pearl--save-local-view: no tracking link, :copied-from-view-id provenance only, active account stamped. On a refusal it points the user at pearl-run-linear-view; on success it states the fork's independence. Bound at f d (down) and the transient Views column. Phase 6 of the views spec. 30 tests cover per-dimension round-trips (build->encode->read bridge), normalize-from-real-JSON trees, the full refusal set, and the command-side. Suite, compile, and lint are green. --- tests/test-pearl-keymap.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/test-pearl-keymap.el') diff --git a/tests/test-pearl-keymap.el b/tests/test-pearl-keymap.el index a02dd47..89fe349 100644 --- a/tests/test-pearl-keymap.el +++ b/tests/test-pearl-keymap.el @@ -75,6 +75,8 @@ The lowercase `c' is no longer a direct command -- it is the create prefix." (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 u")))) + (should (eq 'pearl-save-linear-view-locally + (lookup-key pearl-prefix-map (kbd "f d")))) (should (eq 'pearl-publish-current-view (lookup-key pearl-prefix-map (kbd "f P"))))) -- cgit v1.2.3