Skip to content

Add EventSource trait abstraction for testable event injection #543

@bug-ops

Description

@bug-ops

Parent: #542

Problem

EventReader is hardwired to crossterm, making it impossible to inject synthetic events in tests. The tui_loop cannot be exercised without a real terminal.

Requirements

  • Extract EventSource trait from EventReader
  • Implement CrosstermEventSource for production use
  • Implement MockEventSource accepting Vec<AppEvent> or mpsc::Receiver<AppEvent>
  • Make tui_loop generic over EventSource

Acceptance criteria

  • tui_loop can run in tests with synthetic events without a real terminal
  • No behavioral changes to production code path
  • All existing tests pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttestingTests and qualitytuiTUI dashboard

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions