Skip to content

feat: Support viewport history navigation while streaming#464

Open
liaowang11 wants to merge 1 commit intoxenodium:mainfrom
liaowang11:viewport-history-while-streaming
Open

feat: Support viewport history navigation while streaming#464
liaowang11 wants to merge 1 commit intoxenodium:mainfrom
liaowang11:viewport-history-while-streaming

Conversation

@liaowang11
Copy link
Copy Markdown
Contributor

@liaowang11 liaowang11 commented Mar 26, 2026

When a user switches the viewport to view previous interactions while a response is actively streaming, we should support navigating the history without interrupting the stream.

I find this is most useful when preparing for followup questions while the agents are busy working.

This change implements the following:

  1. Adds agent-shell-viewport--showing-latest-p to check if the viewport is on the latest interaction.
  2. Skips echoing stream updates (text, fragments) to the viewport buffer if it is currently viewing a historical interaction.
  3. Allows agent-shell-viewport-next-page to be used while the agent is busy.

Related: #433

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.

Verification Notes

  • The viewport-history tests added in this branch pass.
  • checkdoc reports one existing warning at agent-shell.el:2373.
  • A full batch ERT run in this environment still has two unrelated failures: agent-shell--build-content-blocks-binary-file-test and agent-shell-restart-preserves-default-directory.

When a user switches the viewport to view previous interactions while a response is actively streaming, we should support navigating the history without interrupting the stream.

This change implements the following:
1. Adds `agent-shell-viewport--showing-latest-p` to check if the viewport is on the latest interaction.
2. Skips echoing stream updates (text, fragments) to the viewport buffer if it is currently viewing a historical interaction.
3. Allows `agent-shell-viewport-edit-mode` (and `agent-shell-viewport-next-page`) to be used while the agent is busy.
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.

1 participant