Skip to content

Compact ActivityIndicator animation #175

@predragnikolic

Description

@predragnikolic

Currently the loading animation is a few characters long, [ = ]...

What do you think about a providing a way to have a more compact form like:

Kapture.2025-05-21.at.21.23.17.mp4

The implementation from the video looks like this:

class ActivityIndicator:
    width = 10  # type: int
    interval = 100  # type: int

    _frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']
    
    def render(self, ticks: int) -> str:
        frame = self._frames[ticks % len(self._frames)]

        return "{} {}".format(
            frame,
            self.label
        )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions