Skip to content

Quiet progress bars - #840

Merged
gaborcsardi merged 4 commits into
r-lib:mainfrom
jacciz:quiet-progress-bars
Oct 5, 2026
Merged

gaborcsardi merged 4 commits into
r-lib:mainfrom
jacciz:quiet-progress-bars

Conversation

@jacciz

@jacciz jacciz commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Fix issue #645 by adding an argument quiet to suppress progress bar when quiet = FALSE.

Comment thread R/progress-client.R
Comment thread R/progress-client.R
Comment thread R/progress-client.R Outdated
Comment thread R/progress-client.R Outdated
@thomasp85

Copy link
Copy Markdown
Member

The CI is failing because you need to regenerate the documentation (devtools::document())

@jacciz

jacciz commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

The CI is failing because you need to regenerate the documentation (devtools::document())
It's a roxygen issue - I showed it to @hadley and I believe he may fix it

@hadley

hadley commented Sep 21, 2026

Copy link
Copy Markdown
Member

Fix in #839 pending @gaborcsardi approval.

Comment thread R/progress-client.R
#' bar of the calling function. See more at 'The current progress bar'
#' below.
#' @param quiet if `TRUE` suppresses output from this function. Defaults to the `cli.disable_progress` option, or
#' `TRUE` if unset.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs still say 'TRUE' or am I missing something here?

Comment thread R/progress-client.R
clienv$progress[[id]] <- bar
if (current) {
if (!is.null(clienv$progress_ids[[envkey]])) {
if (!is.null(clienv$progress_ids[[envkey]]) && !quiet) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem correct to me. If we are creating a new progress bar, then that should be the current progress bar, whether it is quiet or not.

@gaborcsardi gaborcsardi closed this Oct 5, 2026
@gaborcsardi gaborcsardi reopened this Oct 5, 2026
@gaborcsardi

Copy link
Copy Markdown
Member

I guess we can merge it and improve it later

@gaborcsardi
gaborcsardi merged commit a718b70 into r-lib:main Oct 5, 2026
0 of 11 checks passed
@gaborcsardi

Copy link
Copy Markdown
Member

Thanks!

@gaborcsardi gaborcsardi mentioned this pull request Oct 5, 2026
Comment thread R/progress-client.R
envir = .envir
)
}
if(!quiet){

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[air] reported by reviewdog 🐶

Suggested change
if(!quiet){
if (!quiet) {

Comment on lines +221 to +230

fun <- function() {
bar <- cli_progress_bar(
name = "name",
quiet = TRUE
)
for (i in 1:100) {
Sys.sleep(5/100)
cli_progress_update(id = bar)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[air] reported by reviewdog 🐶

Suggested change
fun <- function() {
bar <- cli_progress_bar(
name = "name",
quiet = TRUE
)
for (i in 1:100) {
Sys.sleep(5/100)
cli_progress_update(id = bar)
}
fun <- function() {
bar <- cli_progress_bar(
name = "name",
quiet = TRUE
)
for (i in 1:100) {
Sys.sleep(5 / 100)
cli_progress_update(id = bar)

cli_progress_update(id = bar)
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[air] reported by reviewdog 🐶

Suggested change
}

Comment on lines +233 to +236
# No messages to display
expect_snapshot(capture_cli_messages(fun()))
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[air] reported by reviewdog 🐶

Suggested change
# No messages to display
expect_snapshot(capture_cli_messages(fun()))
})
# No messages to display
expect_snapshot(capture_cli_messages(fun()))
})

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.

4 participants