or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/textual@6.1.x
tile.json

tessl/pypi-textual

tessl install tessl/pypi-textual@6.1.0

Modern Text User Interface framework for building cross-platform terminal and web applications with Python

Agent Success

Agent success rate when using this tile

93%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.18x

Baseline

Agent success rate without this tile

79%

task.mdevals/scenario-1/

Task Counter Application

Build a simple task counter TUI application that tracks completed and pending tasks using reactive programming.

Requirements

Create a terminal application that displays:

  • A count of completed tasks
  • A count of pending tasks
  • The total number of tasks
  • A label showing the completion percentage

The application should update all displays automatically when task counts change. When a user presses the 'c' key, it should increment the completed count. When a user presses the 'p' key, it should increment the pending count. Pressing 'q' should quit the application.

The completion percentage should be calculated automatically based on the completed and pending counts, formatted as "X.X%" (one decimal place). If there are no tasks, display "0.0%".

Implement this using reactive attributes that automatically update dependent values and trigger UI refreshes when changed.

@generates

API

"""Task counter application using reactive programming."""

from textual.app import App


class TaskCounterApp(App):
    """A TUI app that tracks task counts with reactive updates."""

    def compose(self):
        """Compose the UI widgets."""
        pass

Test Cases

  • When completed is 0 and pending is 0, the total should be 0 and percentage should be "0.0%" @test
  • When completed is 3 and pending is 2, the total should be 5 and percentage should be "60.0%" @test
  • When the 'c' key is pressed, the completed count should increment by 1 @test
  • When the 'p' key is pressed, the pending count should increment by 1 @test

Dependencies { .dependencies }

textual { .dependency }

Provides the TUI framework with reactive programming support.

@satisfied-by