From 8061ec3d83fdd9896f84e4d8590eb878277e4949 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 16 Jun 2026 23:02:13 -0500 Subject: fix(views): accept Linear's open filter when copying a view down The copy-down reverse-compiler only treated state.type nin [completed, canceled, duplicate] (Pearl's own :open predicate) as open. Linear's UI authors open as nin [completed, canceled], without duplicate, so copying down any standard open-issues view refused with "state.type uses a nin that isn't Pearl's open predicate" and never reached the save. A nin now maps to :open when every excluded type is a closed type and the set excludes both completed and canceled. That covers Linear's two-type form and Pearl's three-type form. A nin missing one of the two, or one that also excludes an open type like backlog, still refuses. --- pearl.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'pearl.el') diff --git a/pearl.el b/pearl.el index 41abab6..e4958e9 100644 --- a/pearl.el +++ b/pearl.el @@ -1137,10 +1137,17 @@ multi-value filter would change which issues match." (let ((op (cdr (assq 'type node)))) (cond ((assq 'nin op) + ;; Linear's UI authors "open" as `state.type nin [completed, + ;; canceled]', omitting duplicate; Pearl's own `:open' adds it. + ;; Accept any nin whose excluded types are all closed types and that + ;; excludes both completed and canceled -- the canonical open filter, + ;; with or without duplicate. A nin missing one of the two, or one + ;; that also excludes an open type (e.g. backlog), is a different + ;; filter and still refuses. (let ((vals (append (cdr (assq 'nin op)) nil))) - (if (and (= (length vals) (length pearl--open-state-types)) - (cl-subsetp vals pearl--open-state-types :test #'string=) - (cl-subsetp pearl--open-state-types vals :test #'string=)) + (if (and (cl-subsetp vals pearl--open-state-types :test #'string=) + (member "completed" vals) + (member "canceled" vals)) (cons 'ok (list :open t)) (pearl--rc-refuse "state.type uses a `nin' that isn't Pearl's open predicate")))) -- cgit v1.2.3