diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-03 09:12:04 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-03 09:12:04 -0500 |
| commit | 1f729465d2247fb6882185e426860de869fe9b71 (patch) | |
| tree | 09902839c64633a583cdf696c7422ecc6cfd331d /tests/test-pearl-refresh.el | |
| parent | 580309bb65a5e529c7aab5e58d3983a37c471023 (diff) | |
| download | pearl-1f729465d2247fb6882185e426860de869fe9b71.tar.gz pearl-1f729465d2247fb6882185e426860de869fe9b71.zip | |
feat(views): render a Linear view's grouping as Org sections
A Linear view can group its issues (by status, project, assignee, priority, cycle), and until now pearl ignored that: a "by status" or "by project" view came back as one flat list and didn't look like itself. The sort half of matching the view UI shipped earlier. This is the grouping half.
I read issueGrouping off the view preferences (next to the ordering pearl already fetches) and stamp it on the source as :group. When it's a single-valued dimension, the builder partitions issues into groups in first-appearance order and renders each as a level-2 section heading with its issues at level 3. An issue with no value for the dimension lands in a "No project" / "No assignee" bucket, mirroring Linear. The fold depth tracks where issues render (show3levels grouped, show2levels flat), so the buffer always opens unfolded to the issue level. issueGrouping "none", label-grouping (an issue carries several labels, deferred), and sub-grouping render the flat list.
The group headings carry no LINEAR-ID, so save and merge skip them like the help header. Two merge points needed grouping-awareness: an in-place update now re-renders at the issue's existing heading level rather than flattening to level 2, and a new issue on refresh is placed under its group section (creating the section if it doesn't exist yet) instead of appended at the end. Both entry points share the resolver, so run-linear-view and a favorited view picked in pearl-pick-source group the same way.
Verified live against the workspace: a by-project view renders one section per project plus a "No project" bucket, issues at level 3, opened to show3levels.
Diffstat (limited to 'tests/test-pearl-refresh.el')
| -rw-r--r-- | tests/test-pearl-refresh.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test-pearl-refresh.el b/tests/test-pearl-refresh.el index d09c96c..199b346 100644 --- a/tests/test-pearl-refresh.el +++ b/tests/test-pearl-refresh.el @@ -93,7 +93,9 @@ (re-search-forward "Stale Title") (pearl-refresh-current-issue) (goto-char (point-min)) - (re-search-forward "^\\*\\* ") + ;; refresh preserves the issue's heading level (here level 3) rather than + ;; flattening it -- a grouped view's issues stay at level 3 on refresh + (re-search-forward "^\\*\\*\\* ") ;; heading + drawer reflect the remote (should (string-match-p "Refreshed Title" (thing-at-point 'line t))) (should (string= "In Progress" (org-entry-get nil "LINEAR-STATE-NAME"))) |
