Repository navigation
feat(desktop-gpui): restore the recordings overlay after a Studio recording - #4258
richiemcilroy wants to merge 15 commits into
Conversation
|
Sandchest reviewed Sandchest reviews every change for vulnerabilities an attacker could use · 3 credits · Review details |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
hey @greptileai, please re-review the PR |
|
hey @greptileai, please re-review the PR |
…tch Tauri's action buttons
…uilds the stack on Linux
|
hey @greptileai, please re-review the PR |
…ass the upload organization
|
hey @greptileai, please re-review the PR |
| ) -> Result<PathBuf, String> { | ||
| let meta = RecordingMeta::load_for_project(project_path) | ||
| .map_err(|error| format!("Failed to load recording metadata: {error}"))?; | ||
| let save_path = destination.unwrap_or_else(|| meta.output_path()); |
There was a problem hiding this comment.
render_for_project writes Copy and Share exports to meta.output_path() without coordinating with automations. A Studio-finished rule can export to ProjectFolder or upload while the card is available. Clicking Copy or Share then starts another render to the same file.
If both renders stage a new file, one fails when it publishes. If the file already exists, both can write it at once, damaging the export or changing bytes during an upload. Coordinate work for each project, or render to a separate file and upload that exact file.
Knowledge Base Used: Export and editor rendering
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/src/recordings_overlay.rs
Line: 1092
Comment:
**Renders compete for one file**
`render_for_project` writes Copy and Share exports to `meta.output_path()` without coordinating with automations. A Studio-finished rule can export to `ProjectFolder` or upload while the card is available. Clicking Copy or Share then starts another render to the same file.
If both renders stage a new file, one fails when it publishes. If the file already exists, both can write it at once, damaging the export or changing bytes during an upload. Coordinate work for each project, or render to a separate file and upload that exact file.
**Knowledge Base Used:** [Export and editor rendering](https://app.greptile.com/-/switch-tenant?tenant=cap&next=%2Fcustom-context%2Fknowledge-base%2Fcapsoftware%2Fcap%2F-%2Fdocs%2Fexport-and-editor-rendering.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Brings back the floating overlay that followed a Studio recording in 0.6.0 when "After a Studio recording" was set to show it.
Why it was missing
RecordingsOverlayfromapply_post_studio_editor_behaviour(apps/desktop/src-tauri/src/recording.rs:5963-5975at800ab28de^).showOverlaybut labelled it "Show Cap", and the stop flow sent it to the fallback arm that reshows the main window (app_windows.rs, phase observer).flowchart LR stop[Studio recording stops cleanly] --> rules[automation rules<br/>SkipEditor / OpenEditor] rules --> b{postStudioRecordingBehaviour} b -- openEditor --> editor[editor] b -- showOverlay --> overlay[recordings overlay<br/>main window stays hidden] b -- doNothing --> lib[library only] shot[screenshot taken] -- overlay already up --> overlayWhat changed
apps/desktop-gpui/src/recordings_overlay.rs(new): a stack of 260x150 cards, newest on top, in the bottom-left corner of the display under the cursor. Hovering a card shows the Tauri card's actions:upload_exported_videowith the organization picked in the export dialog (first one if it is gone), with progressupload_rendered_screenshotand saves the link on the bundleEach action shows a progress panel with Close above it, which cancels the render or upload. A failure shows its message and a Retry button (offline, server error). Signed out starts sign-in. A free plan over 5 minutes opens pricing, as the editor does.
Renders go through the editor's
ExportResourcescheck and supervision (a full drive fails with its message, a low-space warning asks first; on Linux that dialog runs off the UI thread). An update restart waits for overlay work (updates::work_in_flight).Cards stay until closed or edited, as in Tauri (no timeout). The stack hides while a recording runs or a screenshot is captured (two separate flags, so a screenshot during a recording keeps it hidden), and comes back afterwards. On Wayland it first presents an empty frame with the picker windows (
empty_overlays_for_screenshot). Actions in flight keep running meanwhile.A screenshot taken while the stack is up joins it, which is what the Tauri overlay did through
NewScreenshotAdded. Screenshots do not open the stack by themselves (Tauri never did that either).When the stack is taller than the display allows, the oldest idle card goes first; a card mid-upload is never dropped. Cards whose recording was deleted meanwhile are dropped when the stack comes back.
Setting:
postStudioRecordingBehaviouris unchanged on disk.showOverlay, written by 0.6.0 for its overlay and by 0.6.1 to 0.6.3 for "Show Cap", now means the overlay again and is labelled "Show in overlay" (Shortcuts page outcome: "Show overlay"). Nothing new is written, so a downgrade to 0.6.0 still reads it.Automations (feat(desktop-gpui): run saved automation rules #4059): its
studio_editor_behaviourmapsSkipEditortodoNothingandOpenEditortoopenEditor, so the overlay is suppressed and the editor wins exactly as in Tauri'sstudio_recording_editor_behaviour. For screenshots, a matching rule that can delete the capture (a save or custom-path export followed by Delete local files, the same test feat(desktop-gpui): run saved automation rules #4059 uses to keep the editor closed) now gets no overlay card, so no card points at a file about to go (automation::screenshot_rule_deletes, passed intoscreenshot_finished).Small visibility changes for reuse:
editor_export::run_export,export_file_name,app_windows::gpui_display_id,remove_popup_window_chrome.A failed action shows a short hint under its title ("Check your connection and try again." for links, "Something went wrong. Try again." for copy and export) with Retry. The raw error is logged. Sign-in, upgrade and export-resource messages are already written for people and show as they are.
The action buttons are light circles with dark icons in both appearances, as in Tauri (
bg-gray-1 dark:bg-gray-12). The card itself matches Tauri: cover-fit thumbnail, black/40 hover layer, black/50 details strip.Callers checked
postStudioRecordingBehaviourreaders: the phase observer match (app_windows.rs),open_preparing_studio_editorandprepares_studio_editor(onlyopenEditorprepares an editor;showOverlaystill waits for finalization before the card appears, so actions never run on an unfinished recording), the Shortcuts page outcome cards and effect sentences (settings_pages.rs, unchanged wording for non-editor outcomes).prepare_for_screenshot_captureandscreenshot_finished(both screenshot paths, including Wayland'sempty_overlays_for_screenshot, go through them).run_exportkeeps its single editor caller; signature unchanged.screenshot_finishedhas one caller (screenshot.rs), which now passes whether a rule deletes the capture.upload_rendered_screenshotgained an organization argument on main; the overlay's screenshot share passesNonelike the screenshot editor.What could regress
showOverlaysaved from 0.6.1 to 0.6.3 now see the overlay instead of the main window coming back. That is the intent: the value always meant the overlay, and GPUI's own comment called the reshow a stand-in "until an overlay exists".Tests
recordings_overlay::tests::failed_cards_show_a_hint_instead_of_the_raw_error: an HTTP 500 maps to the hint per action; sign-in, upgrade and resource-stop messages pass through.recordings_overlay::tests(15): organization choice, corner placement and the work-area clamp, the card limit, overflow keeping busy cards, progress and titles for every state, a screenshot joining only an open stack, deleted recordings dropped on return, one action at a time with Close cancelling, a deleted recording closing its card, Done and Failed settling back, a screenshot during a recording keeping the stack hidden.store::tests::post_studio_overlay_reads_tauri_and_gpui_stores: a full 0.6.0general_settingsobject and a GPUI single-key store both readshowOverlayas the overlay; unknown and absent values stayopenEditor.automation::tests::only_a_screenshot_rule_that_can_delete_drops_the_overlay_card: a save then delete rule drops the card; a disabled rule, a lone delete (which never runs), an editor rule and a Studio rule do not.Locale surface tests cover every new string in all seven catalogs.
Real app (
upload/real_app_tests.rs, macOS, run byinstant-reliability.yml):real_app_studio_overlay_keeps_the_main_window_hidden: a real Studio recording withshowOverlayshows one card and the main window stays hidden.real_app_overlay_actions_copy_share_retry_export_and_edit: drives the card throughCAP_GPUI_AUTO_RECORDINGS_OVERLAY(debug builds only). Copy rendersoutput/result.mp4onto the clipboard; Share hits an injected 500 and fails, Retry uploads to the organization picked in the export dialog (orgId=org-picked) and the clipboard holds the saved/s/<id>link; Export writes an MP4 to the chosen path; Edit opens the editor.real_app_recording_start_behaviour_minimises_or_hides_main_windowusedshowOverlayonly to get the main window back; it now uses the Instant "Show Cap" outcome for that.Proof
Screenshots and recording
Real app on a GitHub-hosted macOS 15 runner with real ScreenCaptureKit capture, driven by the same overlay hook as the tests (the share server is a local stub, so the failure is the injected 500). The runner desktop has a stock wallpaper and a Finder window, so each thumbnail is that recorded screen filling its card.
Recordings (record, card, stack, Copy, Share failure and Retry, Copy shareable link, Edit): light, dark. Every still, including hover on each card of the stack and the stack hidden while recording, is on media/gpui-recordings-overlay.
The PR needs a fix before merging because overlay actions can compete with automations for the same export file.
Findings
Fix with agent prompt
Summary
Restores the floating recordings overlay for the saved
showOverlaysetting.The seven supplied earlier threads are unnumbered, so they have no
previousFindingsentries. Their fixes are present: Close appears above status panels, updates check busy cards, Wayland screenshots wait for an empty frame, renders use resource safeguards, the flagged comments were removed, and Linux save dialogs preserve chosen paths and show failures.Reviews (13) · Last reviewed commit: "fix(desktop-gpui): no overlay card for a..." · Reviewed by Greptile