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

Multi-Widget Communication Dashboard { .spec }

Build a terminal dashboard that demonstrates inter-widget communication through a custom event system. The dashboard should contain three widgets that communicate with each other when specific user interactions occur.

Requirements { .requirements }

  1. Create a main application with three custom widgets arranged vertically:

    • A StatusPanel widget that displays a status message
    • A ControlPanel widget with a button labeled "Trigger Event"
    • A LogPanel widget that displays a scrollable log of events
  2. Implement custom message passing between widgets:

    • When the button in ControlPanel is clicked, it should send a custom message
    • The StatusPanel should receive this message and update its displayed status
    • The LogPanel should also receive the message and append a timestamped log entry
  3. Add mouse hover interaction:

    • When the mouse enters the ControlPanel widget, it should send a different custom message
    • The StatusPanel should update to show "Control panel focused"
    • When the mouse leaves the ControlPanel, update StatusPanel to show "Control panel inactive"
  4. Implement event bubbling control:

    • Add a key binding to the LogPanel (key 'c') that clears the log
    • Stop this key event from bubbling up to the app level
    • Add an app-level key binding (key 'q') to quit the application

Technical Specifications { .technical-specifications }

  • The application should have a title displayed in the header
  • Each widget should have a visible border with a title
  • The StatusPanel should display text centered
  • The LogPanel should auto-scroll to show the latest log entry
  • Include at least one timestamp in log entries showing when events occurred

Dependencies { .dependencies }

textual { .dependency }

Modern Text User Interface (TUI) framework for building terminal applications with Python.

Test Cases { .test-cases }

Test 1: Button Click Communication { .test-case @test }

Input:

  • Start the application
  • Click the "Trigger Event" button

Expected Output:

  • StatusPanel updates to show a status message indicating the button was clicked
  • LogPanel appends a new log entry with timestamp showing the event was received

Test 2: Mouse Hover Interaction { .test-case @test }

Input:

  • Start the application
  • Move mouse over the ControlPanel widget area
  • Move mouse away from the ControlPanel widget area

Expected Output:

  • StatusPanel shows "Control panel focused" when mouse enters
  • StatusPanel shows "Control panel inactive" when mouse leaves
  • LogPanel records both enter and leave events

Test 3: Event Bubbling Control { .test-case @test }

Input:

  • Start the application
  • Generate some log entries by clicking the button
  • Focus on LogPanel and press 'c' key
  • Press 'q' key

Expected Output:

  • Pressing 'c' clears the log in LogPanel but does not affect the app
  • Pressing 'q' quits the application
  • The 'c' key press does not propagate to the app level

Submission Format { .submission-format }

Submit a Python file named dashboard.py containing:

  • The main App class
  • Three custom widget classes (StatusPanel, ControlPanel, LogPanel)
  • At least two custom message classes
  • Event handlers using appropriate patterns

Include a test file named test_dashboard.py that tests the message passing functionality.