show: Add non-advancing previews#114
Merged
Merged
Conversation
The show command selects a live change whenever it displays the next hunk, and file-scoped previews can replace the selected change for later actions. The command also exposes the same file-review and batch-preview surfaces as mutating follow-up workflows. Users who want to inspect the next change without changing the selected session state have no command-level way to do so. Reusing the automatic advance wording would also make the preview behavior look tied to the session preference that action commands read. This commit addresses that by adding a show-local --no-advance flag that renders live hunk, file, file-list, and batch previews without caching them as the selected change. It keeps --no-auto-advance as a hidden parser alias, while advertising only --no-advance in completion and the show man page. Subsequent commits will cover the parser and state behavior, then document the public flag in the command reference.
The show command now has a non-advancing preview mode that can render live hunks, file reviews, matched-file lists, and batch previews without replacing the selected change. The test suite does not yet prove that those previews preserve session state, keep page rendering usable, or keep the compatibility alias out of generated help. Regressions in those paths would make the new command surface look like an action-oriented auto-advance setting. This commit addresses that by adding parser and command tests for the visible --no-advance flag, the hidden --no-auto-advance alias, non-selecting hunk state restoration, and page-aware file previews without selectable gutters. The final commit will add the user-facing command reference entry for the public flag.
The command reference describes how show opens the selected hunk, file reviews, matched-file lists, and batch views. It already explains that start's automatic-selection preference controls later action commands. Users reading the reference would not know that show now has a preview mode that leaves the current selection untouched. The reference also needs to avoid presenting the compatibility alias as another public spelling. This commit addresses that by documenting the public --no-advance spelling in the show section and by stating that the behavior is independent of the start --no-auto-advance default. This commit completes the non-advancing show preview series by matching the public command reference to the advertised CLI surface.
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.
The show command can display selected hunks, file reviews, matched-file lists, and batch previews. Those displays also serve as the selected change for later pathless actions.
Users who want to inspect a change without changing session state have no public preview mode. Reusing the action-oriented auto-advance spelling as the advertised form would make the behavior look connected to the session preference.
This pull request addresses that by adding a show-local --no-advance flag, keeping --no-auto-advance as a hidden compatibility alias, and preserving non-selecting hunk and file-review state. It also updates the man page, completion, command reference, and focused coverage.
Verification: