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 nms;
7pub mod nms_eval;
8
9use crate::app::Tab;
10
11/// Short, one-line human description of what a tab will eventually do.
12/// Rendered as placeholder body text until per-tab views land.
13#[must_use]
14pub fn placeholder_body(tab: Tab) -> &'static str {
15    match tab {
16        Tab::Accounts => "Accounts — list, create, view hierarchy.",
17        Tab::Transactions => "Transactions — list, create multi-split entries.",
18        Tab::Commodities => "Commodities — list, create.",
19        Tab::Reports => "Reports — balance / activity / breakdown, with chart pane.",
20        Tab::Config => "Config — view and edit TUI / server configuration.",
21        Tab::Console => "Console — interactive nomiscript REPL.",
22    }
23}
24
25#[cfg(test)]
26mod tests {
27    use super::*;
28
29    #[test]
30    fn every_tab_has_placeholder_text() {
31        for tab in Tab::ALL {
32            let body = placeholder_body(tab);
33            assert!(!body.is_empty());
34        }
35    }
36}