Skip to content

fix(desktop): compile rfd after nil-NSOpenPanel guard (E0069) - #21

Merged
jmfcamp merged 2 commits into
mainfrom
cursor/fix-rfd-modal-return-88d6
Aug 20, 2026
Merged

fix(desktop): compile rfd after nil-NSOpenPanel guard (E0069)#21
jmfcamp merged 2 commits into
mainfrom
cursor/fix-rfd-modal-return-88d6

Conversation

@jmfcamp

@jmfcamp jmfcamp commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #20 (file-attach NSOpenPanel nil-guard). That patch vendored rfd 0.16.0 and added an early-out when +[NSOpenPanel openPanel] / +[NSSavePanel savePanel] is nil. The sync fallback in ModalFuture::new used a bare return;, but that function returns Self, so Apple Silicon just desktop-release-build failed with:

error[E0069]: `return;` in a function whose return type is not `()`
   --> vendor/rfd/src/backend/macos/modal_future.rs:113:21

The async sheet path’s return; is inside a () closure and was already valid. The sync path now clones the future state, completes it as NSModalResponseCancel (so callers get None / no path), and returns Self { state } — same cancel behavior as #20, just a type-correct constructor exit.

Hula branding is unchanged (productName Hula Buzz, bundle id com.huladesk.buzz, hulabuzz://). No extra crates vendored; no Tauri/wry bump.

Related issue

N/A. Follow-up to #20. None found for the E0069 compile break.

Testing

  • Linux CI source-string guards in macos_file_panel.rs now also include modal_future.rs and assert the constructor returns Self on the nil-panel path (catches a regression to return;).
  • Rebuild on Apple Silicon with just desktop-release-build. rfd must compile (E0069 gone). Vite/chunk warnings and wry unused-unsafe / deprecated warnings are not the failure.
  • Then attach a file on macOS 26. If the panel is nil, the picker must cancel / produce no path instead of aborting. fix(desktop): stop macOS attach from aborting on nil NSOpenPanel #20 intent is unchanged.
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 20, 2026 22:08
PR #20's rfd vendor patch used a bare `return;` in ModalFuture::new
when +[NSOpenPanel openPanel] / save panel was nil. That constructor
returns Self, so Apple Silicon `just desktop-release-build` failed with
E0069. Complete the future as cancelled and return Self instead.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: jmfcamp <jmfcamp@users.noreply.github.com>
Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: jmfcamp <jmfcamp@users.noreply.github.com>
@jmfcamp
jmfcamp marked this pull request as ready for review August 20, 2026 22:10
@jmfcamp
jmfcamp merged commit 6396bc1 into main Aug 20, 2026
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