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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//! Central action enum — components emit these, the root dispatcher routes.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Action {
Noop,
Quit,
// Navigation
MoveUp,
MoveDown,
DrillIn,
DrillOut,
PreviewLineUp,
PreviewLineDown,
// Pane filter (SEARCHING mode)
EnterSearch,
CommitFilter,
ClearFilter,
// Leader
Leader,
LeaderSearch,
LeaderFileFind,
LeaderGrep,
LeaderQuit,
// Popup
ClosePopup,
// Overlays & command layer (plans/0003, plans/0004)
KeybindsPopup,
CommandLine,
RunCommand(String),
Visual,
ExitVisual,
ToggleSelect,
/// `␣ y` — yank the context's remote URL (plans/0003 §1).
LeaderYank,
/// `␣ c` — clear all VISUAL marks.
ClearMarks,
/// `␣ d` — delete marked orgs from the browser (+ state).
DeleteMarked,
/// `␣ r` — reload the open repo's tree (or the org's repos).
LeaderReload,
/// Settings popup closed with edits: persist + hot reload.
ApplySettings(crate::config::Config),
/// Clone wizard: run the clones (repos + destination).
RunClone {
repos: Vec<String>,
dest: std::path::PathBuf,
},
// Global search view (plans/0002-v0.2)
CloseSearchView,
GlobalSearchSubmitted {
kind: crate::components::global_search::SearchKind,
query: String,
scope: String,
extension: String,
},
GlobalSearchResults {
hits: Vec<crate::components::global_search::SearchHit>,
},
GlobalSearchFailed {
message: String,
},
/// Cursor landed on a hit without preview lines but with a sha —
/// fetch its blob and locate the context lazily (plans/0006 §1).
LoadHitContext {
hit: Box<crate::components::global_search::SearchHit>,
query: String,
},
HitContextLoaded {
repo: String,
path: String,
sha: String,
line: u32,
preview: Vec<(u32, ratatui::text::Line<'static>)>,
match_count: u32,
},
OpenSearchHit(crate::components::global_search::SearchHit),
// Search popup ↔ GitHub backend
SearchSubmitted(String),
SearchResults {
items: Vec<crate::provider::SearchItem>,
},
SearchFailed {
message: String,
},
// Org loading
OrgSelected(String),
LoadOrgRepos(String),
OrgReposLoaded {
org: String,
repos: Vec<String>,
},
OrgReposFailed {
org: String,
message: String,
},
// Repo tree loading
LoadRepoTree {
owner: String,
name: String,
},
TreeLoaded {
owner: String,
name: String,
entries: Vec<crate::provider::TreeNode>,
truncated: bool,
branch: String,
},
TreeFailed {
owner: String,
name: String,
message: String,
},
// Blob preview
LoadBlob {
sha: String,
name: String,
},
BlobLoaded {
sha: String,
name: String,
bytes: Vec<u8>,
},
BlobFailed {
sha: String,
message: String,
},
// Selection outcomes
RepoSelected {
owner: String,
name: String,
},
OpenSelected,
}