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
use crate::git::graph::{DiffStat, GraphRow};
use crate::git::status::RepoStatus;
use crate::repo_id::RepoId;
#[derive(Clone, Debug)]
#[allow(dead_code)]
pub(crate) enum Action {
Tick,
Render,
Quit,
Resize(u16, u16),
SelectNextRepo,
SelectPrevRepo,
SelectRepo(RepoId),
/// Update the file list and graph to a repo's data without moving the
/// list-row selection. Used when a child row (stash entry) is highlighted.
FocusRepoDetails(RepoId),
SelectWorktree {
repo_id: RepoId,
worktree_path: std::path::PathBuf,
worktree_branch: String,
},
/// Carries the result of a worktree status query back to the UI.
WorktreeFilesLoaded {
repo_id: RepoId,
worktree_path: std::path::PathBuf,
name: String,
files: Vec<crate::git::status::FileEntry>,
},
RepoStatusUpdated {
id: RepoId,
status: RepoStatus,
},
RefreshAll,
RefreshRepo(RepoId),
/// Fast local status poll (no spinner, no fetch)
PollLocal,
/// Remote fetch poll (no spinner)
PollFetch,
ShowGitGraph,
ShowFileList,
GraphLoaded {
generation: u64,
rows: Vec<GraphRow>,
},
DiffStatsLoaded {
generation: u64,
stats: Vec<(git2::Oid, DiffStat)>,
},
ShowContextMenu {
id: RepoId,
row: u16,
col: u16,
},
HideContextMenu,
CopyPath(RepoId),
GitPush(RepoId),
GitPull(RepoId),
GitPullRebase(RepoId),
GitPullSubmodules(RepoId),
GitSubmoduleUpdate(RepoId),
GitSubmoduleSync(RepoId),
GitSubmoduleUpdateLatest(RepoId),
GitOpComplete {
id: RepoId,
message: String,
},
ShowDiff(RepoId, std::path::PathBuf),
DiffLoaded {
generation: u64,
content: String,
},
GraphError(String),
ShowCommitFiles {
repo_path: std::path::PathBuf,
oid: String,
},
CommitFilesLoaded {
generation: u64,
oid: String,
message: String,
files: Vec<(String, String)>,
},
ShowCommitDiff {
repo_path: std::path::PathBuf,
oid: String,
file_path: String,
},
CommitDiffLoaded {
generation: u64,
content: String,
},
OpenAddRepo,
AddRepo(std::path::PathBuf),
RemoveRepo(RepoId),
CycleSortOrder,
RescanRepos,
/// Idempotent rescan triggered by FS events. Compares the discovered set
/// against the current set and only mutates state on a diff. Unlike
/// [`Action::RescanRepos`] this preserves `excluded_repos`, in-flight
/// status queries, dirty-repo tracking, and the user's selection.
DiscoverNewRepos,
Error(String),
UpdateAvailable(String),
/// Clears the pending_status flag for a repo (sent on error paths)
StatusQueryDone(RepoId),
/// Open the in-app theme picker overlay.
OpenThemePicker,
/// Apply a theme transiently (live preview), no persistence.
PreviewTheme(String),
/// Apply a theme and write `theme = "<name>"` to the active config file.
CommitTheme(String),
/// Re-apply the theme that was active when the picker opened, then close.
CancelThemePreview,
}