Commit 8aa9c5c
authored
refactor: extract magic strings, decompose long functions, standardize error display (#628)
* refactor: extract magic strings, decompose long functions, standardize error display
- Add WORKTREE_ADMIN_PREFIX constant to naming.rs alongside KILD_BRANCH_PREFIX
- Use kild_branch_name() instead of raw format!("kild/{}") in pr.rs, detail_view.rs
- Use KILD_BRANCH_PREFIX in kild_branch_name() function body
- Add SHIM_VERSION constant for tmux version string in shim commands
- Extract kill_tracked_agents() from destroy_session() (127 lines → helper)
- Extract sweep_ui_daemon_sessions() from destroy_session() (55 lines → helper)
- Extract resolve_resume_args() from open_session() (46 lines → helper)
- Add display_operation_error() helper for consistent CLI error formatting
- Standardize error display across open, hide, focus, diff, health, stats,
sync, commits, and teammates commands to use color::error() consistently
Closes #438
* fix: address PR review — restore comment, tighten visibility, fix test helpers
- Restore non-fatal comment on daemon cleanup in kill_tracked_agents()
- Change WORKTREE_ADMIN_PREFIX to pub(crate) — no external callers
- Replace raw format!("kild/...") in cleanup/handler.rs and overlaps.rs
test helpers with kild_branch_name() / kild_worktree_admin_name()
* fix: address review feedback from PR review agents
- Fix kill_tracked_agents docstring: clarify daemon errors are always
non-fatal, not gated on force flag
- Fix resolve_resume_args docstring: document is_bare_shell parameter
and error return paths
- Remove .unwrap() in kill_tracked_agents, use indexing instead
- Change display_operation_error to use impl Display over &dyn Display
- Inline WORKTREE_ADMIN_PREFIX constant (single use site)
- Reuse kild_branch variable in pr.rs no_pr_found path
- Use imported color module instead of crate::color in teammates.rs
- Add kild-git crate to CLAUDE.md workspace structure1 parent 9375e68 commit 8aa9c5c
18 files changed
Lines changed: 302 additions & 239 deletions
File tree
- crates
- kild-core/src
- cleanup
- git
- sessions
- kild-tmux-shim/src
- kild-ui/src/views
- kild/src/commands
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| |||
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
155 | | - | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1007 | 1007 | | |
1008 | 1008 | | |
1009 | 1009 | | |
1010 | | - | |
1011 | | - | |
| 1010 | + | |
| 1011 | + | |
1012 | 1012 | | |
1013 | 1013 | | |
1014 | 1014 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
| 286 | + | |
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| |||
0 commit comments