Commit 02e5c9a
committed
experimental lazybut TUI
Wanted to see how far I could get towards LazyGit functionality with
GitButler APIs. Turns out we can get pretty far, pretty fast if we
make Agents do most of the work.
Initial plan
Remove large unused CLI and metrics modules
Compile with `cargo build -p but` and fix issues by removing or stubbing out large, unused modules that caused build problems. The args and metrics modules were deleted and lib.rs updated to stop referencing removed modules and to import CommandName where needed. Also disabled the incomplete legacy lazy module (commented out) and cleaned up metrics usage sites to use the re-exported CommandName to resolve compilation errors.
Make lazy TUI runnable
Add optional crossterm and ratatui dependencies, expose a hidden "Lazy" CLI subcommand and wire the lazy module into the CLI so the experimental Lazy TUI can be launched. Update Cargo.lock to include the new crates and versions required, and make numerous code changes to adapt the lazy UI to recent upstream API and structural changes: replace removed CommandContext usage with TODO stubs and safe fallbacks, adjust status/diff API usage, switch to command::legacy::status::assignment paths, provide temporary IdMap construction, and stub out upstream/update/reword/squash/uncommit operations until they are reimplemented without CommandContext.
These changes were needed to make the Lazy TUI runnable again after refactors that removed CommandContext and changed diff/status APIs. The commit brings in the terminal UI crates, registers the CLI entry point, and makes conservative code changes (stubbing or converting calls) so the lazy interface can start while leaving TODOs to fully restore interactive operations.
Fix compile errors and update lazy modules
Address multiple compilation errors caused by API/type changes and missing imports. Replace now-invalid commit detail handling with a placeholder implementation that returns empty file changes and zeroed stats (note: needs reimplementation using Context). Import anyhow::anyhow macro and tidy up unused code by removing duplicate/reset methods that conflicted with function signatures. Also apply minor type conversion fixes hints (use Into::into and deref suggestions) documented for future work.
Fix warnings by removing unused imports/fields and dead code paths
Resolve multiple compiler warnings by cleaning up unused imports, constants, and struct fields, and by adjusting unreachable code paths in lazy UI modules. Specifically:
- Removed unused imports and the unused DATE_ONLY constant from lazy/app.rs, and simplified collection imports.
- Marked several target-info structs with #[allow(dead_code)] to silence dead-code warnings for fields currently unused.
- Adjusted upstream_integration import usage to only bring in needed types.
- In squash.rs and uncommit.rs, renamed pattern-bound variables to _target and converted early-return Err(...) with a return into direct Err(...) expressions; commented out legacy CommandContext-dependent code and removed statements after early errors that made code unreachable.
These changes clean up the codebase to eliminate unreachable code and unused-item warnings while preserving the placeholders and TODOs for future reimplementation.1 parent 180a128 commit 02e5c9a
File tree
18 files changed
+5683
-28
lines changed- crates/but
- src
- args
- lazy
- utils
18 files changed
+5683
-28
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
| 107 | + | |
| 108 | + | |
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
162 | 181 | | |
163 | 182 | | |
164 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
0 commit comments