Skip to content

Feature/indeterminate progress with elapsed #3710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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