Skip to content

Redraw progress bar during requests and adapt layout to width - #150

Open
rundel wants to merge 3 commits into
mainfrom
progress-display
Open

rundel wants to merge 3 commits into
mainfrom
progress-display

Conversation

@rundel

@rundel rundel commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Progress mode's spinner only advanced when an item finished, and the cli progress bar could not use more than one line.

  • The progress display is now drawn by ghclass rather than cli::cli_progress_bar(). Frames are signaled as message conditions and written to cli's output connection, so suppressMessages() silences them and they interleave with cli alerts. The bar still waits for cli.progress_show_after.
  • curl's progress callback redraws the display while API requests wait (about once a second when idle, more often during transfers). For gh calls this goes through httr2's mock hook since httr2 has no global way to add curl options; GraphQL and raw downloads use httr::config(). Downloads via .destfile skip the hook because the mock cannot see the download path.
  • Layout follows cli::console_width(). When the console is too narrow for the bar and the latest message to share a line, ANSI terminals show the message on a second line; non-ANSI consoles such as RStudio keep one line and truncate the message.
  • ghclass_api_v3_req() now muffles gh's messages selectively instead of using suppressMessages(), so frames drawn mid-request still reach the terminal.
  • Adds httr2 to Imports, updates with_progress() docs, and replaces the terminal test helper with a small escape-sequence replay used by new layout and hook tests.

Local git operations via gert have no callback, so the spinner pauses during clones and pushes.

This branch has not been deployed

No deployments
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