Skip to content

View commit images natively with zoom and gallery controls - #70

Merged
simonhamp merged 8 commits into
NativePHP:mainfrom
ricardovfreixo:feat/native-image-viewer
Oct 24, 2026
Merged

simonhamp merged 8 commits into
NativePHP:mainfrom
ricardovfreixo:feat/native-image-viewer

Conversation

@ricardovfreixo

@ricardovfreixo ricardovfreixo commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements the README's native image viewer roadmap item for published commit attachments, replacing the in-app browser sheet with an EDGE full-screen modal.

  • Uses the native image, gesture-area and SharedValue primitives on iOS and Android: whole-image fit, pinch zoom from 1× to 4× and pan, without webviews or new dependencies.
  • Keeps the image on screen with the gesture area's new bounded mode and the image's real aspect ratio. Zoomed in, the image's edges stop at the screen's edges, and it stays centred on an axis where it fits. A drag past that meets resistance and springs back on release, so at 1× the image always returns to the centre. A pinch zooms around the fingers.
  • Opens the attachment that was tapped; accessible previous/next controls and an image counter navigate the commit's attachments, resetting zoom/pan for each image.
  • Keeps the modal mounted for dismissal, handles close/Android back, retains the underlying screen, and shares the existing image cache.
  • Rejects unsupported URL schemes on both initial opening and gallery navigation; other browser links keep their existing behavior.

Refs #53. This is the image-viewing slice; the replies/undocking interaction requested there is not included.

Latest-main sync and SDK companions

Merged upstream main (up to #29) without rewriting this branch's history. The README's obsolete camera-branch note was removed; image-viewer implementation and security tests are unchanged. Upstream's composer-sheet handle adjustment and signed-binary .env.example changes are retained.

bounded and content-ratio are new on the gesture area, so this branch requires the branches that add them:

Both are based on current main, which already builds without the tab-row mismatch, so the earlier pins to the #588 and #162 fork branches are gone. The viewer doesn't use anything from them. Only the two SDK package records differ from upstream's lock. Swap both back to dev-main once #603 and #173 are merged.

Verification

  • Full Pest suite on this branch with the #603/#173 pair: 1,211 passed (11,709 assertions).
  • vendor/bin/pint --dirty --format agent: passed.
  • git diff --check: passed.
  • Independent subagent review of the PHP/EDGE contract against both installed native renderers, followed by fixes for dismissal lifecycle, loading-comment accuracy, and a gallery-navigation URL guard.

Tests cover both platform wire trees, selected attachment index, gallery boundaries and reset state, unsafe sibling URLs, dismissal/reopening, Log/Profile/CommitDetail/Starred hosts, preservation of browser link behavior, and the bounds the gesture area gets (an image's real ratio, uncapped by the feed, and none when its size is unknown).

Native verification

Built and run on an iPhone 16 Pro and a moto g24 (Debug builds). On the moto, a one-finger drag at 1× trails the finger with resistance and springs back to the centre when released. No screenshots or recordings yet. Still worth a check by hand: close/back, safe-area layout, and opening the viewer above an already-open composer sheet.

Known limits: loading/failure presentation comes from the platform image loader because EDGE exposes no app callbacks. Draft-photo previews are unchanged. The implemented image-viewer item is removed from the README roadmap.

The camera dependency is updated to stable 1.1.0 because the previous fix/present-over-sheets source ref is no longer fetchable. No native runtime-lock changes are included.

@ricardovfreixo
ricardovfreixo marked this pull request as ready for review October 22, 2026 18:19
Take upstream's camera 1.1 release (NativePHP#73), SDK main baseline (NativePHP#75), the
screens' private query() helper rename (NativePHP#76), the 4.2.0-rc.2 binaries
(NativePHP#77), and keep the image viewer hanging over the commit sheet without
handle-over-content, which mobile-ui no longer offers.

Constrain nativephp/mobile to dev-fix/root-tab-reselect (f06d13c, based
on mobile-air main with #557) and nativephp/mobile-ui to
dev-fix/list-root-tab-scroll-target (28753b7), the reviewed pair the
notification centre PR tests against, instead of mobile-ui main.
simonhamp and others added 2 commits October 24, 2026 03:12
Both are drafts (NativePHP/mobile-air#603, NativePHP/mobile-ui#173). Swap
back to dev-main once they're merged.

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

Copy link
Copy Markdown
Member

Thanks for this, Ricardo. I've pushed two commits on top:

I've updated the description to match. Shout if any of this gets in the way of #79.

@simonhamp
simonhamp merged commit 5711c40 into NativePHP:main Oct 24, 2026
1 check passed
simonhamp added a commit that referenced this pull request Oct 24, 2026
…#85)

* Use mobile-air and mobile-ui main again

The bounded gesture area work is merged (NativePHP/mobile-air#603 and
NativePHP/mobile-ui#173), so the app goes back to requiring dev-main of
both, with the same 4.6.0 and 0.8.0 aliases. The dev-main heads have the
same tree as the feature branches #70 locked to, so no code changes.

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

* Catch the Boost agent files up with main

Merging #83 into #84 by hand skipped the boost:update rerun, so AGENTS.md
was still #83's older copy and .agents/skills only held ui-screenshots.
This reruns it on dev-main of nativephp/mobile, which also adds the
nativephp-agent-loop skill (agents drive native:run, screenshots and the
device log on a simulator themselves) and points the nativephp-mobile
skill at it.

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

---------

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.

2 participants