1
//! Per-tab state holders. Kept intentionally thin right now — the TUI
2
//! scaffolding ships with placeholder views for each tab and the
3
//! individual tab implementations grow in follow-up work as the server
4
//! commands needed by each view get promoted out of the web crate.
5

            
6
pub mod config;
7
pub mod fetch;
8
pub mod list;
9
pub mod nms;
10
pub mod nms_eval;
11
pub mod reports;
12

            
13
use crate::view::Tab;
14

            
15
/// Short, one-line human description of what a tab will eventually do.
16
/// Rendered as placeholder body text until per-tab views land.
17
#[must_use]
18
6
pub fn placeholder_body(tab: Tab) -> &'static str {
19
6
    match tab {
20
1
        Tab::Accounts => "Accounts — list, create, view hierarchy.",
21
1
        Tab::Transactions => "Transactions — list, create multi-split entries.",
22
1
        Tab::Commodities => "Commodities — list, create.",
23
1
        Tab::Reports => "Reports — balance / activity / breakdown, with chart pane.",
24
1
        Tab::Config => "Config — view and edit TUI / server configuration.",
25
1
        Tab::Console => "Console — interactive nomiscript REPL.",
26
    }
27
6
}
28

            
29
#[cfg(test)]
30
mod tests {
31
    use super::*;
32

            
33
    #[test]
34
1
    fn every_tab_has_placeholder_text() {
35
6
        for tab in Tab::ALL {
36
6
            let body = placeholder_body(tab);
37
6
            assert!(!body.is_empty());
38
        }
39
1
    }
40
}