feat: page list command output and show all entries by default - #286
Open
Ruari-Phipps wants to merge 10 commits into
Open
feat: page list command output and show all entries by default#286Ruari-Phipps wants to merge 10 commits into
Ruari-Phipps wants to merge 10 commits into
Conversation
…add_pager_to_list_commands
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Rich's default pager routes through pydoc, which hardcodes LESS without F (quit-if-one-screen) or X (stay out of the alternate screen), and overwrites any LESS the user has set. Short listings opened less, demanded q, and then vanished on quit. Decide in Python instead of delegating to less flags, so the behaviour holds for whichever pager is configured, and default LESS to git's FRX rather than clobbering it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Coverage Report
Changed file coverage
|
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.
Summary
Pages long CLI listings through the system pager, removes the default 10-entry cap on
deployments listandbranch history, and shows the column headers those two tables were already defining but never rendering.Motivation
Listings longer than the terminal scrolled past the top, with no way back to the earliest rows short of re-running with
--offset. The 10-entry cap that made that bearable also truncated--json, so a script could not tell a project with 10 deployments from one with 500.Changes
paged_output()inpoly/output/console.py. Output taller than the terminal goes to the system pager; anything shorter prints inline as before. Paging is skipped entirely when stdout is not a TTY, so pipes, redirects, and--jsonare unaffected.deployments list,deployments ab-test list,branch history,conversations list, andtesting list.--limitondeployments listandbranch historynow defaults to showing everything instead of 10. Both slice already-fetched data, so this costs no extra API calls. The commands where--limitis an API request parameter —conversations list,testing list,ab-test list— are unchanged.print_deploymentsandprint_branch_history, which defined named columns and aheader_stylebut passedshow_header=False.Test strategy
poly <command>)console_test.pycovers the paging decision and the TTY/enabled guards;cli_test.pycovers the no-limit and--limittruncation behaviour in both rich and JSON modes.Checklist
ruff check .andruff format --check .passpytestpasses (1319 passed, 101 subtests)polyCLI interface (or migration path documented)Screenshots / Logs
poly deployments list --jsonandpoly branch history --jsonnow return every entry rather than the most recent 10. Pass--limitexplicitly for a bound.🤖 Generated with Claude Code