Skip to main content

mach/
banner.rs

1//! The mach wordmark and the text shown in the help overlay.
2
3pub const BANNER: [&str; 6] = [
4    r"███╗   ███╗ █████╗  ██████╗██╗  ██╗",
5    r"████╗ ████║██╔══██╗██╔════╝██║  ██║",
6    r"██╔████╔██║███████║██║     ███████║",
7    r"██║╚██╔╝██║██╔══██║██║     ██╔══██║",
8    r"██║ ╚═╝ ██║██║  ██║╚██████╗██║  ██║",
9    r"╚═╝     ╚═╝╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝",
10];
11
12pub const BANNER_WIDTH: u16 = 35;
13
14/// Fallback wordmark for terminals too narrow for the full banner.
15pub const BANNER_SMALL: [&str; 3] = [r"┏┳┓┏━┓┏━╸╻ ╻", r"┃┃┃┣━┫┃  ┣━┫", r"╹ ╹╹ ╹┗━╸╹ ╹"];
16
17pub const BANNER_SMALL_WIDTH: u16 = 12;
18
19/// One row of the two-column key reference. Section headings are marked
20/// rather than guessed from their casing — "COMMANDS (press /)" has
21/// lowercase in it and would not read as a heading otherwise.
22pub struct HelpRow {
23    pub left: &'static str,
24    pub right: &'static str,
25    pub heading: bool,
26}
27
28const fn row(left: &'static str, right: &'static str) -> HelpRow {
29    HelpRow {
30        left,
31        right,
32        heading: false,
33    }
34}
35
36const fn heading(left: &'static str, right: &'static str) -> HelpRow {
37    HelpRow {
38        left,
39        right,
40        heading: true,
41    }
42}
43
44/// Two-column key reference. Empty strings are gaps.
45pub const HELP_COLUMNS: [HelpRow; 16] = [
46    heading("MOVING AROUND", "TASKS & CATEGORIES"),
47    row(
48        "← →          between the two panels",
49        "Ctrl+A       new task / category",
50    ),
51    row(
52        "↑ ↓          within a panel",
53        "Enter        edit in the preview",
54    ),
55    row("⌥↑ ⌥↓       reorder in manual view", ""),
56    row("PgUp PgDn    top / bottom", "Space        tick a task off"),
57    row(
58        "Tab          the other panel",
59        "Ctrl+F       importance, 0 to 3 flags",
60    ),
61    row("type         jump to matching row", "Backspace ×2 delete"),
62    row("Esc          back out", "Ctrl+C ×2    quit"),
63    row("Mouse        click, double-click, scroll", ""),
64    row("", ""),
65    heading(
66        "COMMANDS  (press /)",
67        "PREVIEW  (Enter · when space allows)",
68    ),
69    row(
70        "/search  /settings  /help",
71        "Tab ⇧Tab     next / previous field",
72    ),
73    row("", "← → Space    choose category / flags"),
74    row(
75        "/copy  /copytitle · /done",
76        "Enter        calendar · new line · open",
77    ),
78    row("/purge  /update  /quit", "Ctrl+Z / ⇧Z  undo · redo"),
79    row("? this page", "Esc          back to the task list"),
80];
81
82pub const HELP_FOOTER: &str = "Press Esc to close · github.com/Q1CHENL/mach";
83
84pub const EMPTY_TASKS: &str = "No active tasks here :)";
85pub const NO_SEARCH_RESULTS: &str = "No tasks found :)";