Skip to content

Present the camera and photo pickers over sheets on iOS - #17

Merged
simonhamp merged 1 commit into
mainfrom
fix/present-over-sheets
Oct 22, 2026
Merged

simonhamp merged 1 commit into
mainfrom
fix/present-over-sheets

Conversation

@simonhamp

Copy link
Copy Markdown
Member

On iOS the camera, video and photo pickers are presented from the key window's root view controller. When the app is already showing a sheet, the root view controller is busy presenting it, so present does nothing: the photo picker's view service starts and is torn down straight away, and no event ever comes back.

This presents them from the topmost view controller instead, walking presentedViewController the way the browser plugin already does in BrowserFunctions.swift. Nothing changes when no sheet is showing.

I hit this in the devnull app, where the composer is a native:bottom-sheet and its photo and camera buttons did nothing. With this change the photo picker opens over the sheet and MediaSelected arrives as expected, checked on an iOS 27 simulator. The camera can't be tried on a simulator, but it goes through the same path.

Worth knowing: main has a few fixes 1.0.4 doesn't, including the HEIC to JPEG conversion (#7) and the persistent storage fix (#12). The devnull app needs both, so a 1.0.5 release with this would let it drop the branch.

🤖 Generated with Claude Code

The pickers were presented from the window's root view controller, which
can't present while it's already presenting something. So when an app
opened the camera or the photo library from a sheet, nothing happened.
They now present from the topmost view controller, as the browser plugin
does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simonhamp
simonhamp marked this pull request as ready for review October 22, 2026 14:43
@simonhamp
simonhamp merged commit 6a51521 into main Oct 22, 2026
2 checks passed
simonhamp added a commit to sonalidudhia/mobile-camera that referenced this pull request Oct 22, 2026
NativePHP#17 landed on main with a smaller version of this fix, so the three
picker call sites conflicted. This keeps CameraPresenter and drops
NativePHP#17's topViewController helper, because CameraPresenter also waits
for a sheet that is still closing before it presents. Everything else
from main, including NativePHP#13, comes through unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simonhamp
simonhamp deleted the fix/present-over-sheets branch October 22, 2026 15:20
simonhamp added a commit to NativePHP/dev-null-app that referenced this pull request Oct 22, 2026
… polls (#24)

* Attach photos, start polls and preview from the composer sheet, and vote on polls

The composer sheet gets the web composer's tools on a row under the field:
photos from the library, a photo from the camera, a poll, and a preview.

Photos come through the official camera plugin, up to three, each checked
the way devnull checks them and moved into the app's storage until the
commit goes. Each can have a description. A commit with photos is signed
as multipart with the image hashes, the way the API asks, and sent from the
background, so Commit spins while it uploads.

A new commit or a quote can have a poll instead, with two to four options
and a length, as on the web. The preview shows the draft as the commit it
would become, and fills in the body devnull sends back for it.

A commit page's reply bar has no room for these, so it gets an expand
button that opens the reply in the same sheet, and the draft goes back to
the bar if the sheet closes unsent.

Polls in lists can now be voted on: pick an option, then Vote.

The camera plugin is pinned to a branch until NativePHP/mobile-camera#17
is released, since its pickers did nothing when opened from a sheet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Pin the composer's toolbar to the bottom of the sheet

The tools, stash@{0} and the counter now sit in a bar under the scroll
view instead of at the end of it, so they stay just above the keyboard
while you write, and above the home indicator when it's down.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
simonhamp added a commit to NativePHP/dev-null-app that referenced this pull request Oct 22, 2026
The composer sheet needed NativePHP/mobile-camera#17 to open the camera
and photo library over it, so the app tracked that PR's branch from a
VCS repository. #17 was squash-merged and its branch deleted, which
leaves composer update unable to resolve it. The fix shipped in 1.1.0,
so require ^1.1 from Packagist and drop the repository entry.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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