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