Skip to content

Two clarifications on the progress bar implementation #1047

Closed
@DavisVaughan

Description

@DavisVaughan

In particular, this example has two quirks:

library(purrr)

x <- 1:5

map(x, .progress = TRUE, function(elt) {
  Sys.sleep(4)
})
  • The progress bar doesn't show up at all until after the first iteration (i.e. about 4 seconds in). I don't know if this is a consequence of show_after or the fact that we are setting i = 0 on the first iteration.
  • The progress bar never actually hits 100%. On the last iteration we set i = 4, which corresponds to 80% which does show up, but then we do the last iteration and exit the loop. I assume that calling cli_progress_done() will mark it as 100%, and that does seem to be the case if you set clear = FALSE, but I still wonder if we should be using i + 1 in the loop.

CC @gaborcsardi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions