Skip to content

viewport pin page#478

Open
zackattackz wants to merge 1 commit intoxenodium:mainfrom
zackattackz:viewport-pin-page
Open

viewport pin page#478
zackattackz wants to merge 1 commit intoxenodium:mainfrom
zackattackz:viewport-pin-page

Conversation

@zackattackz
Copy link
Copy Markdown
Contributor

Introduce the following:

  1. New command agent-shell-viewport-pin-page for use in agent-shell-viewport-view-mode. This command will open the currently viewed page in a read-only mode in some other window (in special-mode so you can quit with "q"). This is useful for referencing previous turns without the constant need to switch between pages or manually copy/pasting output.

  2. Custom variable agent-shell-viewport-pin-page-switch-buffer-function. The function used to display the pinned page. Defaults to #'display-buffer.

  3. Map agent-shell-viewport-pin-page to "d" in agent-shell-viewport-view-mode-map.

  4. Display this binding in the help page of viewport view mode.


I understand if you don't wish to merge this, it could be implemented in another package. But it is a really small amount of code for something I think is essential for any serious usage of viewport mode (Unless there is some alternative workflow I am missing). Thank you for considering!

Demo

pin-demo.webm

Thank you for contributing to agent-shell!

Checklist

  • I agree to communicate (PR description and comments) with the author myself (not AI-generated).
  • I've reviewed all code in PR myself and will vouch for its quality.
  • I've read and followed the Contributing guidelines.
  • I've filed a feature request/discussion for a new feature.
  • I've added tests where applicable.
  • I've updated documentation where necessary.
  • I've run M-x checkdoc and M-x byte-compile-file.

Introduce the following:

1. New command `agent-shell-viewport-pin-page` for use in
`agent-shell-viewport-view-mode`. This command will open the currently viewed
page in a read-only mode in some other window (in `special-mode` so you can quit
with "q"). This is useful for referencing previous turns without the constant
need to switch between pages or manually copy/pasting output.

2. Custom variable `agent-shell-viewport-pin-page-switch-buffer-function`. The
function used to display the pinned page. Defaults to `#'display-buffer`.

3. Map `agent-shell-viewport-pin-page` to `"d"` in
`agent-shell-viewport-view-mode-map`.

4. Display this binding in the help page of viewport view mode.
@zackattackz
Copy link
Copy Markdown
Contributor Author

Also to note: I regenerated the README's "Customizations" and "Commands" by running the source blocks in there. I glanced at the output to make sure it looks good (it does) but I did not do a deep comparison of those changes - so there may be more commands/variables added in those blocks than just the new ones if the README was stale.

@xenodium
Copy link
Copy Markdown
Owner

Thanks for the PR.

We have something somewhat similar by pressing C-c C-p to go to the previous page. You can select any region and press r to reply and that region is automatically copied over. Does that cover your use case?

@zackattackz
Copy link
Copy Markdown
Contributor Author

Heyo, thank you for checking this out.

Does that cover your use case?

Is the text copied this way included in the actual reply to the agent or is it automatically excluded? If not excluded it seems inefficient if my purpose is just to reference prior pages.

Also, the fonts + markdown rendering is not done through this method. Collapse-able sections are expanded.

Either way I still prefer it to be copied to another buffer in another window for ease of reference. The UX is a bit nicer if you are pinning multiple windows though, it allows the user to quickly pin several pages and organize them to their liking (through display buffer alist or through the custom variable). Perhaps this could be better integrated with the method you suggest though?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants