From 504133e600a197b50f05d3916264433ee9e4cb12 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 25 May 2026 22:30:49 -0500 Subject: feat(render): derive the #+TODO line and keywords from team workflow states The renderer wrote a fixed #+TODO line and mapped state names through a static defcustom, so a workspace's real states (Dev Review, PM Acceptance, ...) never showed up. Now the displayed issues' teams drive both. pearl--gather-header-states collects each team's full state set (cached via pearl--team-states, teams in first-seen order, states by position) plus every displayed issue's own state, so a failed team fetch still leaves its issues' states declared. pearl--build-org-content takes that list and derives the #+TODO via pearl--derive-todo-line. pearl--format-issue-as-org-entry renders each keyword with pearl--state-name-to-keyword instead of the static map -- slugify reproduces the old defaults, so standard states are unchanged -- and writes a :LINEAR-STATE-TYPE: drawer so a later merge scan can classify a retained heading. The team-states query gains type and position. The integration test stubs pearl--team-states so the render stays network-free. The merge-refresh header rebuild is the next commit. Until then a same-source refresh keeps the previous header. --- tests/test-integration-acceptance.el | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/test-integration-acceptance.el') diff --git a/tests/test-integration-acceptance.el b/tests/test-integration-acceptance.el index de5f0e7..11b88b2 100644 --- a/tests/test-integration-acceptance.el +++ b/tests/test-integration-acceptance.el @@ -109,6 +109,10 @@ because the description-update mutation contains both `IssueDescription' and (when (find-buffer-visiting tmp) (kill-buffer (find-buffer-visiting tmp))) (cl-letf (((symbol-function 'pearl--graphql-request-async) #'test-integration--dispatch) + ;; the header-state gather fetches team states synchronously; + ;; stub it so the render stays network-free (the derived #+TODO + ;; then comes from the displayed issues' own states) + ((symbol-function 'pearl--team-states) (lambda (_team-id) nil)) ;; no windows in batch; keep the surface step a no-op ((symbol-function 'pearl--surface-buffer) (lambda (b) b))) (unwind-protect -- cgit v1.2.3