feat: DWIM toggle for pi-coding-agent entry point#125
Open
conornash wants to merge 1 commit intodnouri:masterfrom
Open
feat: DWIM toggle for pi-coding-agent entry point#125conornash wants to merge 1 commit intodnouri:masterfrom
conornash wants to merge 1 commit intodnouri:masterfrom
Conversation
Add agent-shell-style DWIM behavior to the main `pi-coding-agent' command and a new `pi-coding-agent-toggle' command for toggling session window visibility. DWIM behavior for M-x pi-coding-agent (no prefix arg): - From a pi buffer: toggle visibility (hide windows) - From a non-pi buffer with existing project session: reuse it - No session for project: create a new one - C-u prefix or Lisp string arg: named session (unchanged) New command `pi-coding-agent-toggle': - Pi windows visible -> hide them - Pi windows hidden but session exists -> show them - No session -> user-error New functions in pi-coding-agent-ui.el: - `pi-coding-agent-project-buffers': find all pi chat buffers for the current project directory, ordered by buffer-list recency - `pi-coding-agent--hide-buffers': hide pi windows using a hybrid strategy: delete-window when the frame has other windows, bury-buffer for sole-window frames. Second pass handles the case where bury-buffer lands on the paired pi buffer. Bug fix in test-common.el: - Mock session cleanup called nonexistent functions `pi-coding-agent--chat-buffer-name' and `pi-coding-agent--input-buffer-name' (swallowed by ignore-errors, causing buffer leaks). Fixed to use `pi-coding-agent--buffer-name' with :chat/:input type argument. Tests: 5 new tests (502 total, all passing): - dwim-reuses-existing-session - new-session-with-prefix-arg - project-buffers-finds-session - project-buffers-excludes-other-projects - toggle-no-session-errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add agent-shell-style DWIM behavior to the main
pi-coding-agent' command and a newpi-coding-agent-toggle' command for toggling session window visibility.DWIM behavior for M-x pi-coding-agent (no prefix arg):
New command `pi-coding-agent-toggle':
New functions in pi-coding-agent-ui.el:
Bug fix in test-common.el:
pi-coding-agent--chat-buffer-name' andpi-coding-agent--input-buffer-name' (swallowed by ignore-errors, causing buffer leaks). Fixed to use `pi-coding-agent--buffer-name' with :chat/:input type argument.Tests: 5 new tests (502 total, all passing):