Repository navigation
Commit 6fa776c
committed
Fix preview state handling for renamed files and patch repair by cleaning up old paths and propagating updated content
- apply this: [Pasted text]
- in a scenario where 'patch repair' renames a file, the newly created file is displayed as deleted with '-0' line numbers. expected behavior: when 'patch repair' renames a file, it should be marked as new file with total line numbers created e.g. '+200'
- in a scenario where 'patch repair' renames a file, the newly created file has correct line counts only when fixed by chatbot—when fixed by api call, it shows '+0'. Expected behavior: should show the right line count when using api as well.
- In `workspace-listener.ts`, update `set_file_applied_with_patch_repair` to also set `file.previewable_file.proposed_content = new_content` when `new_content` is provided, preventing the UI from falsely displaying the "Discard user changes" action.
- The same ternary is repeated about 40 times. This should be a single helper (e.g. in @shared/utils): ts export const get_error_message = (error: unknown): string => error instanceof Error ? error.message || error.name : String(error)
- use `packages/shared/src/utils/get-error-message.ts` when possible
- move get_error_message to `apps/editor/src/utils`
├── apps
│ └── editor
│ └── src
│ ├── commands
│ │ ├── apply-response-command
│ │ │ ├── apply-response-command.ts
│ │ │ ├── response-processor
│ │ │ │ └── handlers
│ │ │ │ ├── diff-handler.ts
│ │ │ │ ├── fast-replace-handler.ts
│ │ │ │ ├── patch-repair-handler.ts
│ │ │ │ ├── search-replace-handler.ts
│ │ │ │ └── truncated-handler.ts
│ │ │ ├── types
│ │ │ │ └── original-file-state.ts
│ │ │ └── utils
│ │ │ ├── file-operations
│ │ │ │ ├── handle-deleted-file-item.ts
│ │ │ │ └── undo-files.ts
│ │ │ └── preview
│ │ │ ├── build-history-files.ts
│ │ │ ├── diff-utils.ts
│ │ │ ├── file-preparer.ts
│ │ │ ├── types.ts
│ │ │ └── workspace-listener.ts
│ │ ├── copy-markdown-command.ts
│ │ ├── copy-merge-commit-details-command.ts
│ │ ├── generate-commit-message-commands
│ │ │ └── actions
│ │ │ └── run-generate-action.ts
│ │ ├── history-command
│ │ │ └── actions
│ │ │ ├── delete-checkpoint-with-undo.ts
│ │ │ └── restore-checkpoint.ts
│ │ ├── new-file-command.ts
│ │ ├── new-folder-command.ts
│ │ ├── rename-command.ts
│ │ ├── select-clipboard-paths-command.ts
│ │ ├── select-definition-file-command.ts
│ │ ├── select-files-of-commit-command.ts
│ │ ├── select-referencing-files-commands
│ │ │ └── select-referencing-files-commands.ts
│ │ └── set-ranges-command.ts
│ ├── features
│ │ ├── checkpoints
│ │ │ └── actions
│ │ │ └── create-checkpoint.ts
│ │ ├── context-restoration
│ │ │ └── utils
│ │ │ └── context-file-utils.ts
│ │ └── search-files
│ │ └── search-files.ts
│ ├── migrations
│ │ ├── migrate-clear-all-checkpoints.ts
│ │ ├── migrate-commit-message-details-filename.ts
│ │ ├── migrate-configurations-to-api-configurations.ts
│ │ ├── migrate-edit-context-to-edit-files-system-instructions.ts
│ │ ├── migrate-model-providers-to-providers.ts
│ │ ├── migrate-prompt-templates-suffixes.ts
│ │ ├── migrate-prompt-templates-to-templates.ts
│ │ └── migrate-settings-keys-to-chatbots-and-models.ts
│ ├── utils
│ │ ├── build-user-content.ts
│ │ └── get-error-message.ts
│ └── views
│ ├── prompt
│ │ └── backend
│ │ ├── message-handlers
│ │ │ ├── handle-patch-repair.ts
│ │ │ ├── handle-pick-api-reasoning-effort.ts
│ │ │ ├── handle-preview-generated-code.ts
│ │ │ └── handle-voice-input.ts
│ │ ├── prompt-view-provider.ts
│ │ └── utils
│ │ └── preview-text-in-temp-file.ts
│ ├── settings
│ │ └── backend
│ │ └── message-handlers
│ │ └── handle-pick-api-reasoning-effort.ts
│ └── shared
│ └── actions
│ ├── agent
│ │ └── delete.ts
│ ├── api
│ │ ├── create
│ │ │ └── interactions
│ │ │ └── initial-select-model.ts
│ │ └── update
│ │ └── interactions
│ │ └── edit-model-for-api-config.ts
│ └── web
│ └── delete.ts
└── packages
├── shared
│ ├── package.json
│ └── src
│ └── utils
│ └── logger.ts
└── ui
└── src
└── components
└── editor
└── prompt
└── ResponsePreview
└── components
└── FileItem
└── FileItem.tsx1 parent 416f0f5 commit 6fa776c
47 files changed
Lines changed: 194 additions & 75 deletions
File tree
- apps/editor/src
- commands
- apply-response-command
- response-processor
- handlers
- utils
- file-operations
- preview
- generate-commit-message-commands/actions
- history-command/actions
- select-referencing-files-commands
- features
- checkpoints/actions
- context-restoration/utils
- search-files
- migrations
- utils
- views
- prompt/backend
- message-handlers
- utils
- settings/backend/message-handlers
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
376 | 377 | | |
377 | 378 | | |
378 | 379 | | |
379 | | - | |
| 380 | + | |
380 | 381 | | |
381 | 382 | | |
382 | 383 | | |
| |||
457 | 458 | | |
458 | 459 | | |
459 | 460 | | |
460 | | - | |
| 461 | + | |
461 | 462 | | |
462 | 463 | | |
463 | 464 | | |
| |||
679 | 680 | | |
680 | 681 | | |
681 | 682 | | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
| 683 | + | |
686 | 684 | | |
687 | 685 | | |
688 | 686 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
178 | | - | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| |||
288 | 289 | | |
289 | 290 | | |
290 | 291 | | |
291 | | - | |
| 292 | + | |
292 | 293 | | |
293 | 294 | | |
294 | 295 | | |
| |||
310 | 311 | | |
311 | 312 | | |
312 | 313 | | |
313 | | - | |
| 314 | + | |
314 | 315 | | |
315 | 316 | | |
316 | 317 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| |||
27 | 31 | | |
28 | 32 | | |
29 | 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 | + | |
30 | 59 | | |
31 | 60 | | |
32 | 61 | | |
33 | 62 | | |
34 | 63 | | |
35 | 64 | | |
36 | 65 | | |
37 | | - | |
| 66 | + | |
| 67 | + | |
38 | 68 | | |
39 | 69 | | |
40 | 70 | | |
| |||
47 | 77 | | |
48 | 78 | | |
49 | 79 | | |
50 | | - | |
| 80 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
263 | 264 | | |
264 | 265 | | |
265 | 266 | | |
266 | | - | |
| 267 | + | |
267 | 268 | | |
268 | 269 | | |
269 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
144 | | - | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| |||
174 | 175 | | |
175 | 176 | | |
176 | 177 | | |
177 | | - | |
| 178 | + | |
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| |||
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
219 | | - | |
| 220 | + | |
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
547 | 552 | | |
548 | | - | |
| 553 | + | |
549 | 554 | | |
550 | 555 | | |
551 | 556 | | |
552 | | - | |
| 557 | + | |
553 | 558 | | |
554 | 559 | | |
555 | 560 | | |
| |||
558 | 563 | | |
559 | 564 | | |
560 | 565 | | |
561 | | - | |
| 566 | + | |
562 | 567 | | |
563 | 568 | | |
564 | 569 | | |
565 | 570 | | |
566 | 571 | | |
567 | 572 | | |
568 | | - | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
246 | | - | |
| 247 | + | |
247 | 248 | | |
248 | 249 | | |
249 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
0 commit comments