Skip to content

Commit a790a7c

Browse files
committed
feat: session and tree browsers
Browse sessions and conversation trees in dedicated Emacs buffers, replacing the old completing-read session picker. Both buffers stay open alongside chat — no modal overlays. Requires the dnouri/rpc-browsing-surface branch in pi-mono (not yet on main). Adds magit-section as a package dependency. Session browser (C-c C-r): Find and switch sessions. Sort modes: threaded (shows fork lineage with tree connectors), recent, relevance. Filter to named-only, toggle current/all project scope, search with /. Rename the active session with r (upstream only supports renaming the current session). Right margin shows message count and age. Tree browser (C-c C-p then w): See the full branch structure of the current conversation. The active path is highlighted; abandoned branches are dimmed. Five filter modes cycle with f: no-tools (default), default, user-only, labeled-only, all. RET navigates without summarizing; S prompts for summary instructions then navigates with summarization. C-c C-k aborts an in-flight summarization (sends abort_branch_summary to the server). Label nodes with l, search with /. Right margin shows labels. Both buffers use magit-section for point-centric navigation and action dispatch. ?/h opens a transient help menu in each buffer. g refreshes from the server. q buries the buffer. Other changes: - render.el: display branchSummary messages in session history (separator + full markdown, same pattern as compactionSummary); scroll all chat windows to end after history reload. - menu.el: remove resume-session and its disk-based helpers (session-dir-name, list-sessions, format-session-choice). - core.el: normalize-string-or-null now treats empty strings as nil. - ui.el: C-c C-r rebound to session-browser; startup header updated. - Tests moved from menu/input to browse-test.el where they belong. 119 browse-specific tests; 779 total, all green.
1 parent 46677ca commit a790a7c

16 files changed

+3581
-339
lines changed

Makefile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ SELECTOR ?=
1818
# Example: make test VERBOSE=1
1919
VERBOSE ?=
2020

21-
.PHONY: test test-unit test-core test-ui test-render test-input test-menu
21+
.PHONY: test test-unit test-core test-ui test-render test-input test-menu test-browse
2222
.PHONY: test-integration test-integration-ci test-gui test-gui-ci test-all
2323
.PHONY: check check-parens compile lint lint-checkdoc lint-package clean clean-cache help
2424
.PHONY: ollama-start ollama-stop ollama-status setup-pi setup-models install-hooks
@@ -61,6 +61,8 @@ help:
6161
--eval "(unless (package-installed-p 'markdown-mode) \
6262
(package-install 'markdown-mode))" \
6363
--eval "(package-install (cadr (assq 'transient package-archive-contents)))" \
64+
--eval "(unless (package-installed-p 'magit-section) \
65+
(package-install 'magit-section))" \
6466
--eval "(message \"Dependencies installed\")" 2>&1 \
6567
| grep -E "^Dependencies installed$$|^Error:" || true
6668
@touch $@
@@ -88,6 +90,7 @@ test: .deps-stamp
8890
-l pi-coding-agent-render-test \
8991
-l pi-coding-agent-input-test \
9092
-l pi-coding-agent-menu-test \
93+
-l pi-coding-agent-browse-test \
9194
-l pi-coding-agent-test \
9295
$(if $(SELECTOR),--eval '(ert-run-tests-batch-and-exit "$(SELECTOR)")',-f ert-run-tests-batch-and-exit) \
9396
>$$OUTPUT 2>&1; \
@@ -117,6 +120,8 @@ test-input: .deps-stamp
117120
@$(BATCH_TEST) -l pi-coding-agent-input-test -f ert-run-tests-batch-and-exit
118121
test-menu: .deps-stamp
119122
@$(BATCH_TEST) -l pi-coding-agent-menu-test -f ert-run-tests-batch-and-exit
123+
test-browse: .deps-stamp
124+
@$(BATCH_TEST) -l pi-coding-agent-browse-test -f ert-run-tests-batch-and-exit
120125

121126
test-unit: compile test
122127

@@ -229,7 +234,7 @@ ollama-status:
229234

230235
check-parens:
231236
@echo "=== Check Parens ==="
232-
@OUTPUT=$$($(BATCH) --eval '(condition-case err (dolist (f (list "pi-coding-agent-core.el" "pi-coding-agent-ui.el" "pi-coding-agent-render.el" "pi-coding-agent-input.el" "pi-coding-agent-menu.el" "pi-coding-agent.el")) (with-current-buffer (find-file-noselect f) (check-parens) (message "%s OK" f))) (user-error (message "FAIL: %s" (error-message-string err)) (kill-emacs 1)))' 2>&1); \
237+
@OUTPUT=$$($(BATCH) --eval '(condition-case err (dolist (f (list "pi-coding-agent-core.el" "pi-coding-agent-ui.el" "pi-coding-agent-render.el" "pi-coding-agent-input.el" "pi-coding-agent-menu.el" "pi-coding-agent-browse.el" "pi-coding-agent.el")) (with-current-buffer (find-file-noselect f) (check-parens) (message "%s OK" f))) (user-error (message "FAIL: %s" (error-message-string err)) (kill-emacs 1)))' 2>&1); \
233238
echo "$$OUTPUT" | grep -E "OK$$|FAIL:"; \
234239
echo "$$OUTPUT" | grep -q "FAIL:" && exit 1 || true
235240

@@ -241,7 +246,7 @@ compile: .deps-stamp
241246
--eval "(package-initialize)" \
242247
$(LOCAL_LOAD_PATH) \
243248
--eval "(setq byte-compile-error-on-warn t)" \
244-
-f batch-byte-compile pi-coding-agent-core.el pi-coding-agent-ui.el pi-coding-agent-render.el pi-coding-agent-input.el pi-coding-agent-menu.el pi-coding-agent.el
249+
-f batch-byte-compile pi-coding-agent-core.el pi-coding-agent-ui.el pi-coding-agent-render.el pi-coding-agent-input.el pi-coding-agent-menu.el pi-coding-agent-browse.el pi-coding-agent.el
245250

246251
lint: lint-checkdoc lint-package
247252

@@ -255,6 +260,7 @@ lint-checkdoc:
255260
--eval "(checkdoc-file \"pi-coding-agent-render.el\")" \
256261
--eval "(checkdoc-file \"pi-coding-agent-input.el\")" \
257262
--eval "(checkdoc-file \"pi-coding-agent-menu.el\")" \
263+
--eval "(checkdoc-file \"pi-coding-agent-browse.el\")" \
258264
--eval "(checkdoc-file \"pi-coding-agent.el\")" 2>&1); \
259265
WARNINGS=$$(echo "$$OUTPUT" | grep -A1 "^Warning" | grep -v "^Warning\|^--$$"); \
260266
if [ -n "$$WARNINGS" ]; then echo "$$WARNINGS"; exit 1; else echo "OK"; fi
@@ -270,7 +276,7 @@ lint-package:
270276
(package-install 'package-lint))" \
271277
--eval "(require 'package-lint)" \
272278
--eval "(setq package-lint-main-file \"pi-coding-agent.el\")" \
273-
-f package-lint-batch-and-exit pi-coding-agent.el pi-coding-agent-ui.el pi-coding-agent-render.el pi-coding-agent-input.el pi-coding-agent-menu.el pi-coding-agent-core.el
279+
-f package-lint-batch-and-exit pi-coding-agent.el pi-coding-agent-ui.el pi-coding-agent-render.el pi-coding-agent-input.el pi-coding-agent-menu.el pi-coding-agent-browse.el pi-coding-agent-core.el
274280

275281
check: compile lint test
276282

0 commit comments

Comments
 (0)