Skip to content

show: Add non-advancing previews#114

Merged
halfline merged 3 commits into
mainfrom
show-no-advance-preview
Jun 16, 2026
Merged

show: Add non-advancing previews#114
halfline merged 3 commits into
mainfrom
show-no-advance-preview

Conversation

@halfline

Copy link
Copy Markdown
Owner

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:

  • PYTHONPATH=src uv run pytest tests/commands/test_show.py tests/commands/test_file_review.py tests/cli/test_argument_parser.py
  • PYTHONPATH=src uv run ruff check src/git_stage_batch/commands/show.py src/git_stage_batch/cli/argument_parser.py tests/commands/test_show.py tests/commands/test_file_review.py tests/cli/test_argument_parser.py

halfline added 3 commits June 15, 2026 20:41
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.
@halfline halfline merged commit 6ef759d into main Jun 16, 2026
3 checks passed
@halfline halfline deleted the show-no-advance-preview branch June 16, 2026 00:50
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