Skip to content

Comments

Feature/indeterminate progress with elapsed#3710

Closed
IAdityaKaushal wants to merge 2 commits intoTextualize:masterfrom
IAdityaKaushal:feature/indeterminate-progress-with-elapsed
Closed

Feature/indeterminate progress with elapsed#3710
IAdityaKaushal wants to merge 2 commits intoTextualize:masterfrom
IAdityaKaushal:feature/indeterminate-progress-with-elapsed

Conversation

@IAdityaKaushal
Copy link

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @willmcgugan may be pedantic in the code review.

Description

This PR adds support for indeterminate progress bars that show elapsed time and expected total, addressing issue #3572. Linked here #3572

Problem

Users requested a way to display progress bars in an indeterminate state (animated pulse) while still showing elapsed time and an indicator like ?/total. Currently, using start=False or total=None either doesn't show elapsed time or doesn't allow for the desired display format.

Solution

  • Added indeterminate and expected_total parameters to tasks
  • Created new rendering logic for indeterminate progress bars with animated pulsing effect
  • Added IndeterminateTaskProgressColumn to display ?/total for indeterminate tasks
  • Preserved elapsed time display during indeterminate state
  • Enabled smooth transition from indeterminate to determinate state

Features Added

  • Indeterminate progress bars show animated pulse with elapsed time
  • Tasks can be created with indeterminate=True and optional expected_total
  • New IndeterminateTaskProgressColumn displays ?/total for indeterminate tasks
  • Seamless transition from indeterminate to determinate (green 100%) completion
  • Comprehensive test coverage for new functionality

Example Usage

with Progress() as progress:
    # Create an indeterminate task with expected total
    task_id = progress.add_task(
        "Indexing",
        indeterminate=True,
        expected_total=10
    )
    
    # Later, convert to determinate
    progress.update(
        task_id,
        indeterminate=False,
        total=10,
        completed=10
    )

- Add MathRenderer class for converting Latex math to Unicode
- Integrate math rendering into markdown processing
- Supports inline ($..$) and block (94329...94329) math expressions
- Add tests for math rendering functionality

Addreses Textualize#3159
- Add indeterminate mode to progress bars that shows animated pulse
- Display elapsed time during indeterminate state
- Show ?/total indicator for indeterminate tasks
- Support transition from indeterminate to determinate state
- Add comprehensive tests and examples

Addresses feature request Textualize#3572
@willmcgugan
Copy link
Member

There is way too much going on in this PR. There seems to be code unrelated to progress bars.

At this point, I can't accept new features. Especially if those features could be implemented outside of the core library.

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.

2 participants