aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-03 07:07:52 -0500
committerCraig Jennings <c@cjennings.net>2026-06-03 07:07:52 -0500
commit6ef196e306320804b80a502dab29dbafd12285bc (patch)
treebcd067d1b7bc629ca049ba6c7a42cc87b57e8e0b
parentf4cf700efd8bb44ca50f555e2ee04596fc690b91 (diff)
downloadpearl-6ef196e306320804b80a502dab29dbafd12285bc.tar.gz
pearl-6ef196e306320804b80a502dab29dbafd12285bc.zip
feat(render): open a fetched view folded to the issue headings
The header set #+STARTUP: show3levels, which opened a fresh view with each issue's Comments heading already unfolded. That's a level of detail past what you want when scanning a list. Drop to show2levels so a view opens at the parent plus the issue headings, with comments and bodies folded under each issue. pearl--restore-page-visibility re-reads #+STARTUP from the buffer after a repopulation, so the in-place rebuild path follows the new depth without any other change.
-rw-r--r--README.org2
-rw-r--r--pearl.el4
-rw-r--r--tests/test-pearl-format.el8
-rw-r--r--tests/test-pearl-todo-keywords.el4
4 files changed, 10 insertions, 8 deletions
diff --git a/README.org b/README.org
index fef38b9..c79ecc9 100644
--- a/README.org
+++ b/README.org
@@ -341,7 +341,7 @@ A fetched Pearl file is intentionally readable. The header records the source, r
#+begin_src org
#+title: Linear - My open issues
- #+STARTUP: show3levels
+ #+STARTUP: show2levels
#+TODO: TODO IN-PROGRESS IN-REVIEW BACKLOG BLOCKED | DONE
#+LINEAR-SOURCE: (:type filter :name "My open issues" :filter (:assignee :me :open t))
#+LINEAR-RUN-AT: 2026-05-23 19:30
diff --git a/pearl.el b/pearl.el
index ca9d0b1..a5fa205 100644
--- a/pearl.el
+++ b/pearl.el
@@ -3815,7 +3815,7 @@ no side effects."
;; The view name renders verbatim, matching Linear's own capitalization;
;; `pearl-title-case-headings' governs issue headings only.
(insert (format "#+title: Linear — %s\n" name))
- (insert "#+STARTUP: show3levels\n")
+ (insert "#+STARTUP: show2levels\n")
(insert (format "#+TODO: %s\n" (pearl--derive-todo-line states)))
;; Source-tracking metadata: the serialized source drives refresh; the
;; rest is human-readable provenance.
@@ -3835,7 +3835,7 @@ no side effects."
;; Single top-level parent so the issues are sortable as a group
;; (org-sort on this heading) instead of orphan headings, and so a
- ;; show3levels fold has a level-1 root. Named after the view.
+ ;; show2levels fold has a level-1 root. Named after the view.
(insert (format "* %s\n" name))
(dolist (issue issues)
diff --git a/tests/test-pearl-format.el b/tests/test-pearl-format.el
index ec0e1e0..ee15a2a 100644
--- a/tests/test-pearl-format.el
+++ b/tests/test-pearl-format.el
@@ -149,11 +149,13 @@ sort together (org-sort on the parent) instead of being orphan headings."
(should (< (string-match "^\\* My open issues$" out)
(string-match "^\\*\\* IN-PROGRESS" out))))))
-(ert-deftest test-pearl-build-org-content-startup-show3levels ()
- "The page opens folded to headings (parent, issues, Comments), bodies hidden."
+(ert-deftest test-pearl-build-org-content-startup-show2levels ()
+ "The page opens folded to the parent and issue headings; Comments (level 3)
+and all bodies stay folded, so a fresh view isn't a wall of open issues."
(test-pearl--with-default-mapping
(let ((out (pearl--build-org-content '())))
- (should (string-match-p "^#\\+STARTUP: show3levels$" out))
+ (should (string-match-p "^#\\+STARTUP: show2levels$" out))
+ (should-not (string-match-p "^#\\+STARTUP: show3levels$" out))
(should-not (string-match-p "^#\\+STARTUP: overview$" out)))))
(ert-deftest test-pearl-build-org-content-no-shared-file-id ()
diff --git a/tests/test-pearl-todo-keywords.el b/tests/test-pearl-todo-keywords.el
index 0555a4e..e8250dc 100644
--- a/tests/test-pearl-todo-keywords.el
+++ b/tests/test-pearl-todo-keywords.el
@@ -127,7 +127,7 @@
"The header rebuild scans the final buffer so every visible heading is declared."
(let ((org-todo-keywords '((sequence "TODO" "IN-PROGRESS" "|" "DONE"))))
(with-temp-buffer
- (insert "#+STARTUP: show3levels\n#+TODO: TODO | DONE\n\n"
+ (insert "#+STARTUP: show2levels\n#+TODO: TODO | DONE\n\n"
"* View\n"
"** IN-PROGRESS Issue A\n:PROPERTIES:\n:LINEAR-ID: a\n:LINEAR-STATE-TYPE: started\n:END:\n"
"** DONE Issue B\n:PROPERTIES:\n:LINEAR-ID: b\n:LINEAR-STATE-TYPE: completed\n:END:\n")
@@ -141,7 +141,7 @@
"A retained heading with no STATE-TYPE drawer is classified by org-done-keywords."
(let ((org-todo-keywords '((sequence "TODO" "|" "SHIPPED"))))
(with-temp-buffer
- (insert "#+STARTUP: show3levels\n#+TODO: TODO | SHIPPED\n\n"
+ (insert "#+STARTUP: show2levels\n#+TODO: TODO | SHIPPED\n\n"
"* View\n"
"** SHIPPED Old Issue\n:PROPERTIES:\n:LINEAR-ID: a\n:END:\n") ; no STATE-TYPE
(org-mode)