Skip to main content

tui/tabs/
mod.rs

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
6pub mod config;
7pub mod fetch;
8pub mod list;
9pub mod nms;
10pub mod nms_eval;
11pub mod reports;
12
13use 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]
18pub fn placeholder_body(tab: Tab) -> &'static str {
19    match tab {
20        Tab::Accounts => "Accounts — list, create, view hierarchy.",
21        Tab::Transactions => "Transactions — list, create multi-split entries.",
22        Tab::Commodities => "Commodities — list, create.",
23        Tab::Reports => "Reports — balance / activity / breakdown, with chart pane.",
24        Tab::Config => "Config — view and edit TUI / server configuration.",
25        Tab::Console => "Console — interactive nomiscript REPL.",
26    }
27}
28
29#[cfg(test)]
30mod tests {
31    use super::*;
32
33    #[test]
34    fn every_tab_has_placeholder_text() {
35        for tab in Tab::ALL {
36            let body = placeholder_body(tab);
37            assert!(!body.is_empty());
38        }
39    }
40}