From 92a3be1085359dfb60d4861670398ee3f496fe99 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 1 Jun 2026 23:43:46 -0500 Subject: feat(filter): multi-select states in the interactive builder I made the builder's State prompt a completing-read-multiple, the way the Labels prompt already is, so you can pick several workflow states for one filter. The selection maps the way the spec describes: pick one and :state stays a scalar string, pick several and it becomes a list (state.name.in), pick none and there's no state constraint. The "[ Any. ]" sentinel is filtered out of the result like it is for labels. Phase 2 of docs/multi-state-filter-spec.org. A stubbed-builder test covers the one/many/none mapping. Suite, compile, and lint green. --- pearl.el | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'pearl.el') diff --git a/pearl.el b/pearl.el index 9aebcef..6076c81 100644 --- a/pearl.el +++ b/pearl.el @@ -4168,15 +4168,24 @@ an id), or `pearl--filter-any' (any assignee, no scoping)." (team-id (and (not (pearl--filter-sentinel-value-p team-name)) (pearl--get-team-id-by-name team-name))) (open (pearl--read-yes-no "Open issues only? ")) + ;; Multi-select, like the Labels prompt: pick one or several states. + ;; One picked -> a string (`:state' scalar); several -> a list + ;; (`state.name.in'); none -> no state constraint. (state (and team-id - (let ((s (completing-read - "State: " - (pearl--completion-table-keep-order - (pearl--with-sentinel pearl--filter-any - (mapcar (lambda (st) (cdr (assoc 'name st))) - (pearl--team-states team-id)))) - nil t))) - (unless (pearl--filter-sentinel-value-p s) s)))) + (let ((picked + (cl-remove + pearl--filter-any + (completing-read-multiple + "States (comma-separated): " + (pearl--completion-table-keep-order + (pearl--with-sentinel pearl--filter-any + (mapcar (lambda (st) (cdr (assoc 'name st))) + (pearl--team-states team-id)))) + nil t) + :test #'string=))) + (cond ((null picked) nil) + ((= 1 (length picked)) (car picked)) + (t picked))))) (project (and team-id (let ((p (completing-read "Project: " -- cgit v1.2.3