• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jzombie / term-wm / 20885255367

10 Jan 2026 10:20PM UTC coverage: 57.056% (+10.0%) from 47.071%
20885255367

Pull #20

github

web-flow
Merge 123a43984 into bfecf0f75
Pull Request #20: Initial clipboard and offscreen buffer support

2045 of 3183 new or added lines in 26 files covered. (64.25%)

76 existing lines in 15 files now uncovered.

6788 of 11897 relevant lines covered (57.06%)

9.62 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

61.9
/src/components/mod.rs
1
use crossterm::event::Event;
2
use ratatui::layout::Rect;
3

4
use crate::ui::UiFrame;
5

6
pub mod ascii_image;
7
pub mod confirm_overlay;
8
pub mod dialog_overlay;
9
pub mod list;
10
pub mod markdown_viewer;
11
pub mod scroll_view;
12
pub mod selectable_text;
13
pub mod svg_image;
14
pub mod sys;
15
pub mod terminal;
16
pub mod text_renderer;
17
pub mod toggle_list;
18

19
pub use ascii_image::AsciiImageComponent;
20
pub use confirm_overlay::{ConfirmAction, ConfirmOverlayComponent};
21
pub use dialog_overlay::DialogOverlayComponent;
22
pub use list::ListComponent;
23
pub use markdown_viewer::MarkdownViewerComponent;
24
pub use scroll_view::{
25
    ScrollViewComponent, ScrollbarAxis, ScrollbarDrag, render_scrollbar, render_scrollbar_oriented,
26
};
27
pub use selectable_text::{
28
    LogicalPosition, SelectableSurface, SelectionController, SelectionHost, SelectionRange,
29
    SelectionViewport, handle_selection_mouse, maintain_selection_drag,
30
};
31
pub use svg_image::SvgImageComponent;
32
pub use sys::*;
33
pub use terminal::{TerminalComponent, default_shell, default_shell_command};
34
pub use text_renderer::TextRendererComponent;
35
pub use toggle_list::{ToggleItem, ToggleListComponent};
36

37
use std::any::Any;
38

39
pub use crate::component_context::ComponentContext;
40

41
pub trait Component {
NEW
42
    fn resize(&mut self, _area: Rect, _ctx: &ComponentContext) {}
×
43

44
    fn render(&mut self, frame: &mut UiFrame<'_>, area: Rect, ctx: &ComponentContext);
45

46
    fn handle_event(&mut self, _event: &Event, _ctx: &ComponentContext) -> bool {
1✔
47
        false
1✔
48
    }
1✔
49
}
50

51
pub trait Overlay: Component + std::fmt::Debug + Any {
52
    fn as_any(&self) -> &dyn Any;
53
    fn as_any_mut(&mut self) -> &mut dyn Any;
54
}
55

56
impl<T: Component + std::fmt::Debug + Any> Overlay for T {
57
    fn as_any(&self) -> &dyn Any {
×
58
        self
×
59
    }
×
60
    fn as_any_mut(&mut self) -> &mut dyn Any {
×
61
        self
×
62
    }
×
63
}
64

65
#[cfg(test)]
66
mod tests {
67
    use super::*;
68
    use crate::ui::UiFrame;
69
    use crossterm::event::Event;
70
    use ratatui::prelude::Rect;
71

72
    struct DummyComp;
73
    impl Component for DummyComp {
NEW
74
        fn render(&mut self, _frame: &mut UiFrame<'_>, _area: Rect, _ctx: &ComponentContext) {}
×
75
    }
76

77
    #[test]
78
    fn default_handle_event_returns_false() {
1✔
79
        let mut d = DummyComp;
1✔
80
        assert!(!d.handle_event(
1✔
81
            &Event::Key(crossterm::event::KeyEvent::new(
1✔
82
                crossterm::event::KeyCode::Char('a'),
1✔
83
                crossterm::event::KeyModifiers::NONE
1✔
84
            )),
1✔
85
            &ComponentContext::default()
1✔
86
        ));
1✔
87
    }
1✔
88
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc