Skip to content

improve: keep camera previews smooth across window transitions - #2282

Merged
richiemcilroy merged 3 commits into
mainfrom
improve/smooth-camera-preview
Sep 12, 2026
Merged

improve: keep camera previews smooth across window transitions#2282
richiemcilroy merged 3 commits into
mainfrom
improve/smooth-camera-preview

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Sep 12, 2026

Copy link
Copy Markdown
Member

Reopening the desktop controls currently clears the camera preview while capture restarts. Retain the previous same-camera frame and fade it out over the first live frames in the default Tauri preview and GPUI, preserving the preview dimensions across reopen.

Capture still stops when the preview is unused. Cached frames expire after 60 seconds and are invalidated for camera changes or errors; macOS GPUI copies a single snapshot capped at 960×540 rather than holding a camera surface. Cached pixels do not satisfy recording readiness.

Validation: scoped Biome and Rust formatting, isolated GPUI cargo check, 7 Tauri route transition tests with mocked transport, 8 existing frame-transport tests, and 5 native snapshot and capture-timestamp tests passed. Three real MacBook camera lifecycle cycles completed using the existing harness; this change masks restart latency and makes no capture-speedup claim.

Packaged UI, Windows, and Linux runtime verification remain outstanding. The experimental native Tauri renderer is unchanged. A broader Clippy check reports 19 existing diagnostics outside the changed files.

RetriggerConfidence Score: 5/5

The current changes appear safe to merge, with no actionable new defects or outstanding previous findings identified.

Summary

  • Retains same-camera preview frames for up to 60 seconds and preserves their aspect ratio when reopening.
  • Fades retained frames out when live frames resume.
  • Invalidates retained previews after camera changes or reported errors.
  • Adds capture timestamps and camera epochs to reject frames queued by an earlier camera configuration.
  • Copies bounded native snapshots on macOS rather than retaining camera-backed surfaces.

Reviews (3) · Last reviewed commit: "fix: confirm camera snapshot copies befo..."

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

Comment thread apps/desktop-gpui/src/camera_window.rs Outdated
Comment thread apps/desktop/src/routes/camera.tsx Outdated
Comment thread apps/desktop-gpui/src/camera_window.rs
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@superagent-security superagent-security Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Superagent found 3 security concern(s).

Comment thread apps/desktop-gpui/src/camera_window.rs
Comment thread apps/desktop/src/routes/camera.tsx Outdated
Comment thread apps/desktop-gpui/src/camera_window.rs
Comment thread apps/desktop/src/routes/camera.tsx Outdated
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@richiemcilroy
richiemcilroy merged commit 8d1c4b4 into main Sep 12, 2026
27 checks passed
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.

1 participant