Skip to content

fix(editor): keep edits when the project can't be saved before appending a recording - #4271

Open
ManthanNimodiya wants to merge 3 commits into
CapSoftware:mainfrom
ManthanNimodiya:fix/editor-append-save-failure
Open

ManthanNimodiya wants to merge 3 commits into
CapSoftware:mainfrom
ManthanNimodiya:fix/editor-append-save-failure

Conversation

@ManthanNimodiya

@ManthanNimodiya ManthanNimodiya commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When a recording started from the editor finishes, append_recorded_clip flushes 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_recording and 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 when project.write fails, and show editor.clips.save_before_append_failed.
  • New string in all seven locales, registered in the editor shell surface test.

Validation

  • cargo test --locked --bin cap-gpui: 1874 passed, 0 failed.
  • Not reproduced end to end. Forcing the save to fail in a running editor wasn't practical, so the fix is verified by reading the code against the import path's handling.

RetriggerView in GreptileConfidence 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.

  • The editor keeps edits when a project cannot be saved before appending a recording.

Reviews (3) · Last reviewed commit: "fix(editor): give append errors the Linu..." · Reviewed by Greptile

Keeps unsaved edits in the editor and leaves the recording in the library.
@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Skipped Skipped Nov 17, 2026 4:35am UTC

@vercel
vercel Bot temporarily deployed to Preview – cap-status November 15, 2026 12:57 Inactive
@ManthanNimodiya

Copy link
Copy Markdown
Contributor Author

@richiemcilroy

Comment on lines +1355 to +1356
cx.spawn(async move |_, _| show_append_error(&message))
.detach();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

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.

@richiemcilroy

Copy link
Copy Markdown
Member

Thanks @ManthanNimodiya, this looks like a useful change.

Before we can merge it:

  • Greptile is at 5/5, but its point on editor_clips.rs is still open: show_append_error has no Linux fallback when zenity is missing, so the new save failure would be silent there. show_import_error already has one.
  • The branch is behind main with Rust changes on both sides; please merge main in so CI runs on current code.

Once those are sorted, request a re-review from Greptile.

@vercel
vercel Bot temporarily deployed to Preview – cap-status November 17, 2026 04:35 Inactive
@ManthanNimodiya

Copy link
Copy Markdown
Contributor Author

@greptileai review

@richiemcilroy merged main in and gave show_append_error the same no-zenity Linux fallback as show_import_error. Both now go through one shared show_clip_error helper. cargo test --bin cap-gpui passes (1990 tests).

This branch was previously deployed

1 inactive deployment
Preview – cap-status — 399c183a Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants