Commit 5857e2f
authored
Add staged file tracking and selective commit support (#1429)
## TL;DR
Add support for staged file tracking and selective commits, enable diff viewing for staged/unstaged changes separately, and improve the PR creation workflow to support committing only staged files.
## What changed?
### Core functionality
- Added `staged` field to `ChangedFile` schema to track which files are staged
- Added `stagedOnly` parameter to `CreatePrSagaInput` to support selective PR creation
- Modified `commit()` method signature to accept an options object with `paths`, `allowEmpty`, and `stagedOnly` parameters
- Added new methods to `GitService`:
- `getDiffCached()` - get diff of staged changes
- `getDiffUnstaged()` - get diff of unstaged changes
- `stageFiles()` - stage specific files
- `unstageFiles()` - unstage specific files
### Schema updates
- Renamed generic diff schema from `getDiffHead` to `diffInput`/`diffOutput` for reusability across multiple diff operations
- Added `staged` field to `changedFileSchema`
- Added `stagedOnly` field to `commitInput` and `createPrInput` schemas
- Added new `stageFilesInput` schema for file staging operations
### PR creation workflow
- Updated `CreatePrSaga` to pass `stagedOnly` parameter through to the commit step
- Updated git router to expose new diff and file staging endpoints
- Modified `commit()` call in service to pass `stagedOnly` option
## How did you test this?
Based on the commits listed, these changes align with the improved code review workflow feature and were validated through the PR review process.1 parent 24bca98 commit 5857e2f
22 files changed
Lines changed: 770 additions & 237 deletions
File tree
- apps/code/src
- main
- services/git
- trpc/routers
- renderer/features
- code-review
- components
- hooks
- git-interaction
- components
- hooks
- state
- utils
- task-detail/components
- packages/git/src
- sagas
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
| |||
123 | 128 | | |
124 | 129 | | |
125 | 130 | | |
126 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
127 | 136 | | |
128 | 137 | | |
129 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | | - | |
124 | | - | |
| 124 | + | |
| 125 | + | |
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
128 | | - | |
| 129 | + | |
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
134 | 141 | | |
135 | 142 | | |
136 | 143 | | |
| |||
198 | 205 | | |
199 | 206 | | |
200 | 207 | | |
| 208 | + | |
201 | 209 | | |
202 | 210 | | |
203 | 211 | | |
| |||
241 | 249 | | |
242 | 250 | | |
243 | 251 | | |
| 252 | + | |
244 | 253 | | |
245 | 254 | | |
246 | 255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
266 | 268 | | |
267 | 269 | | |
268 | 270 | | |
| 271 | + | |
269 | 272 | | |
270 | 273 | | |
271 | 274 | | |
| |||
283 | 286 | | |
284 | 287 | | |
285 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
286 | 319 | | |
287 | 320 | | |
288 | 321 | | |
| |||
479 | 512 | | |
480 | 513 | | |
481 | 514 | | |
| 515 | + | |
482 | 516 | | |
483 | 517 | | |
484 | 518 | | |
| |||
502 | 536 | | |
503 | 537 | | |
504 | 538 | | |
505 | | - | |
| 539 | + | |
506 | 540 | | |
507 | 541 | | |
508 | 542 | | |
| |||
521 | 555 | | |
522 | 556 | | |
523 | 557 | | |
| 558 | + | |
524 | 559 | | |
525 | 560 | | |
526 | 561 | | |
| |||
584 | 619 | | |
585 | 620 | | |
586 | 621 | | |
587 | | - | |
588 | | - | |
| 622 | + | |
589 | 623 | | |
590 | 624 | | |
591 | 625 | | |
| |||
600 | 634 | | |
601 | 635 | | |
602 | 636 | | |
603 | | - | |
604 | | - | |
| 637 | + | |
605 | 638 | | |
606 | 639 | | |
607 | 640 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
32 | | - | |
33 | | - | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| |||
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
142 | | - | |
143 | | - | |
| 144 | + | |
| 145 | + | |
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
148 | 164 | | |
149 | 165 | | |
150 | 166 | | |
151 | 167 | | |
152 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
153 | 183 | | |
154 | 184 | | |
155 | 185 | | |
| |||
189 | 219 | | |
190 | 220 | | |
191 | 221 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
198 | 227 | | |
199 | 228 | | |
200 | 229 | | |
| |||
0 commit comments