Repository navigation
fix(editor): keep edits when the project can't be saved before appending a recording - #4271
ManthanNimodiya wants to merge 3 commits into
Conversation
Keeps unsaved edits in the editor and leaves the recording in the library.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
| cx.spawn(async move |_, _| show_append_error(&message)) | ||
| .detach(); |
There was a problem hiding this comment.
On Linux desktops without zenity, the new save-failure message never appears because show_append_error calls rfd directly. The append now stops silently, so users are not told why the clip is missing or that it is still in the library. Add the Linux fallback already used by show_import_error.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/src/editor_clips.rs
Line: 1355-1356
Comment:
**Linux save errors stay silent**
On Linux desktops without `zenity`, the new save-failure message never appears because `show_append_error` calls `rfd` directly. The append now stops silently, so users are not told why the clip is missing or that it is still in the library. Add the Linux fallback already used by `show_import_error`.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.|
Thanks @ManthanNimodiya, this looks like a useful change. Before we can merge it:
Once those are sorted, request a re-review from Greptile. |
Moves the no-zenity fallback into one helper both error dialogs share.
|
@greptileai review @richiemcilroy merged main in and gave |
Summary
When a recording started from the editor finishes,
append_recorded_clipflushes and writes the project config, then appends the new bundle and reloads the editor from disk. If that write failed, the error was only logged and the append went ahead: the append rewrites the on-disk project and the reload replaces the in-memory one, so edits made since the recording started were lost.The append now stops when the save fails, the same way
begin_editor_recordingand the import path already do. The editor keeps its state, and an error explains that the recording was not added and is still in the library.Changes
editor_clips.rs: return before the append whenproject.writefails, and showeditor.clips.save_before_append_failed.Validation
cargo test --locked --bin cap-gpui: 1874 passed, 0 failed.

Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues remain.Summary
Stops adding a recording when the current project cannot be saved.
Reviews (3) · Last reviewed commit: "fix(editor): give append errors the Linu..." · Reviewed by Greptile