Skip to main content

seal_tui/
message.rs

1//! Message types for the Elm Architecture
2
3/// All possible user actions and system events
4#[derive(Debug, Clone)]
5pub enum Message {
6    // === Navigation ===
7    /// Select a review from the list
8    SelectReview(String),
9    /// Go back to previous screen
10    Back,
11
12    // === List Navigation ===
13    /// Move selection up in list
14    ListUp,
15    /// Move selection down in list
16    ListDown,
17    /// Page up in list
18    ListPageUp,
19    /// Page down in list
20    ListPageDown,
21    /// Go to first item
22    ListTop,
23    /// Go to last item
24    ListBottom,
25
26    // === File Sidebar ===
27    /// Move down in sidebar tree
28    NextFile,
29    /// Move up in sidebar tree
30    PrevFile,
31    /// Jump to first sidebar item
32    SidebarTop,
33    /// Jump to last sidebar item
34    SidebarBottom,
35    /// Select file by index
36    SelectFile(usize),
37    /// Select sidebar item by row index (mouse click)
38    ClickSidebarItem(usize),
39    /// Activate current sidebar item (Enter)
40    SidebarSelect,
41
42    // === Diff/Content Pane ===
43    /// Move cursor up one row
44    CursorUp,
45    /// Move cursor down one row
46    CursorDown,
47    /// Move cursor to first row
48    CursorTop,
49    /// Move cursor to last row
50    CursorBottom,
51    /// Toggle visual line selection mode (Shift+V)
52    VisualToggle,
53    /// Scroll content up
54    ScrollUp,
55    /// Scroll content down
56    ScrollDown,
57    /// Scroll to top
58    ScrollTop,
59    /// Scroll to bottom
60    ScrollBottom,
61    /// Scroll up by half a page
62    ScrollHalfPageUp,
63    /// Scroll down by half a page
64    ScrollHalfPageDown,
65    /// Scroll up by 10 lines
66    ScrollTenUp,
67    /// Scroll down by 10 lines
68    ScrollTenDown,
69    /// Page up in content
70    PageUp,
71    /// Page down in content
72    PageDown,
73    /// Jump to next thread
74    NextThread,
75    /// Jump to previous thread
76    PrevThread,
77    /// Expand a thread to show comments
78    ExpandThread(String),
79    /// Collapse expanded thread
80    CollapseThread,
81
82    // === Focus ===
83    /// Toggle focus between panes
84    ToggleFocus,
85
86    // === Actions ===
87    /// Resolve a thread
88    ResolveThread(String),
89    /// Reopen a resolved thread
90    ReopenThread(String),
91
92    // === Filter/View ===
93    /// Cycle review list status filter (All → Open → Closed → All)
94    CycleStatusFilter,
95    /// Activate search input on review list
96    SearchActivate,
97    /// Append character to search input
98    SearchInput(String),
99    /// Delete last character from search input
100    SearchBackspace,
101    /// Delete last word from search input
102    SearchDeleteWord,
103    /// Clear search input text (stay in search mode)
104    SearchClearLine,
105    /// Clear and deactivate search
106    SearchClear,
107    /// Toggle between unified and side-by-side diff view
108    ToggleDiffView,
109    /// Toggle file sidebar visibility
110    ToggleSidebar,
111    /// Toggle diff line wrapping
112    ToggleDiffWrap,
113    /// Open current file in editor
114    OpenFileInEditor,
115
116    // === Command Palette ===
117    ShowCommandPalette,
118    HideCommandPalette,
119    CommandPaletteNext,
120    CommandPalettePrev,
121    CommandPaletteUpdateInput(String),
122    CommandPaletteInputBackspace,
123    CommandPaletteDeleteWord,
124    CommandPaletteExecute,
125
126    // === Commenting ===
127    /// Open inline multi-line comment editor (a)
128    StartComment,
129    /// Open $EDITOR for comment (Shift+A)
130    StartCommentExternal,
131    EnterCommentMode,
132    CommentInput(String),
133    CommentInputBackspace,
134    CommentNewline,
135    CommentCursorUp,
136    CommentCursorDown,
137    CommentCursorLeft,
138    CommentCursorRight,
139    CommentHome,
140    CommentEnd,
141    CommentWordLeft,
142    CommentWordRight,
143    CommentDeleteWord,
144    CommentClearLine,
145    SaveComment,
146    CancelComment,
147
148    // === Theme Selection ===
149    ShowThemePicker,
150    ApplyTheme(String),
151
152    // === System ===
153    /// Terminal resize event
154    Resize {
155        width: u16,
156        height: u16,
157    },
158    /// Periodic tick for animations/refresh
159    Tick,
160    /// Request to quit
161    Quit,
162    /// No-op (ignore event)
163    Noop,
164}