1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/// Every user-visible action in ticker-mac.
///
/// Both keyboard input and native menu events produce a `Command`.
/// The single `App::execute()` method handles all of them.
#[derive(Clone, Debug)]
#[allow(dead_code)]
pub enum Command {
// ── Navigation ────────────────────────────────────────────────────────────
MoveUp,
MoveDown,
MoveLeft,
MoveRight,
MoveFirstCol,
MoveLastCol,
MoveFirstTick,
MoveLastTick,
PageUp,
PageDown,
NextSheet,
PrevSheet,
GoToSheet(usize),
// ── Editing ───────────────────────────────────────────────────────────────
/// Start editing: clear buffer and put cell in edit mode (Enter / char-key).
StartEdit,
/// Open edit mode keeping the current value (F2).
StartEditKeepValue,
/// Enter formula mode (= key in Normal).
StartFormula,
/// Append a character to the active buffer.
TypeChar(char),
Backspace,
/// Delete key in edit modes — clears whole buffer.
DeleteBuffer,
/// Delete key in Normal mode — removes cell content.
DeleteCell,
/// Confirm the active buffer (Enter in Editing / FormulaName / Command).
Confirm,
/// Cancel the active input (Escape).
Cancel,
// ── Formula ───────────────────────────────────────────────────────────────
/// Empty-Enter on a variadic formula (finish the arg list).
FinishVariadic,
/// Enter a nested formula (= inside FormulaArgs).
StartNestedFormula,
// ── Undo / Redo ───────────────────────────────────────────────────────────
Undo,
Redo,
// ── File ──────────────────────────────────────────────────────────────────
Save,
Open(String),
Quit,
// ── Native file-dialog variants (menu bar only) ───────────────────────────
/// Show a native folder-picker and open the selected project.
OpenDialog,
/// Save to the known path, or show a native folder-picker if none is set.
SaveDialog,
/// Show a native file-picker (CSV/TSV/JSON) and import the selection.
ImportDialog,
// ── Sheet management ──────────────────────────────────────────────────────
AddSheet(Option<String>),
RenameCurrentSheet(String),
DeleteSheet,
CreateFilter { source: Option<String>, condition: String },
UpdateFilter(String),
// ── Column management ─────────────────────────────────────────────────────
AddColumn(Option<String>),
RenameCurrentColumn(String),
DeleteColumn,
MoveColumnLeft,
MoveColumnRight,
ClearColumn,
HideColumn,
ShowColumn(String),
ListHidden,
ConvertToValues,
// ── Properties ────────────────────────────────────────────────────────────
SetProperty { key: String, value: String },
DeleteProperty(String),
// ── Period navigation ─────────────────────────────────────────────────────
PeriodIncrease,
PeriodDecrease,
// ── View ──────────────────────────────────────────────────────────────────
TogglePropertyPanel,
// ── Property panel focus ──────────────────────────────────────────────────
FocusGrid,
FocusPropertyPanel,
PropMoveUp,
PropMoveDown,
PropStartEdit,
PropStartFormula,
PropDeleteSelected,
// ── Help ──────────────────────────────────────────────────────────────────
OpenHelp,
CloseHelp,
// ── Colon-command dispatcher ──────────────────────────────────────────────
/// A complete `:cmd args` string from command mode.
RunCommand(String),
// ── Import ────────────────────────────────────────────────────────────────
RenameProject(String),
// ── Repeat ───────────────────────────────────────────────────────────────
/// Re-run the last `:command` string (F4).
RepeatLastCommand,
}