Skip to main content

Module traits

Module traits 

Source
Expand description

Shared trait definitions for par-term components.

These traits document the contracts between major components and enable mock implementations for unit testing the app/ module without needing a live PTY session or GPU context.

§Status

TerminalAccess is fully implemented on par_term_terminal::TerminalManager. See crate::traits_impl for the concrete impl and a MockTerminal test helper.

UIElement is fully implemented on crate::tab_bar_ui::TabBarUI and crate::status_bar::StatusBarUI. See crate::traits_impl for the concrete impls and a compile-time test.

EventHandler is still deferred — see the comment block at the end of this file.

§Migration Path for EventHandler

When the WindowState decomposition is further advanced:

  1. Define EventHandler<E> where E = winit::event::WindowEvent and implement it on each sub-handler struct extracted from WindowState.
  2. Add mock implementations in #[cfg(test)] blocks.

Traits§

OverlayComponent
Common interface for egui overlay UI components that follow the show(&mut self, ctx: &egui::Context) -> Self::Action pattern.
TerminalAccess
Provides read-only access to terminal mode and state for input/mouse handlers.
UIElement
Common interface for UI bar/panel components whose height and visibility depend on per-frame context (configuration, window state).