Skip to content

Roll out real device screenshots across the Edge Component docs - #511

Open
lessevv wants to merge 9 commits into
NativePHP:mainfrom
lessevv:feat/docs-capture-screenshots
Open

Roll out real device screenshots across the Edge Component docs#511
lessevv wants to merge 9 commits into
NativePHP:mainfrom
lessevv:feat/docs-capture-screenshots

Conversation

@lessevv

@lessevv lessevv commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds docs:capture-screenshots, which drives a local super-native checkout via native:run/native:screenshot to regenerate every Edge Component doc screenshot from real iOS/Android devices, with --crop/--crop-percent/--crop-offset to trim OS chrome and a --dry-run/--publish flow
  • Wires real device screenshots into 18 Edge Component docs pages (top-bar, bottom-nav, side-nav, bottom-sheet, modal, menus, list, refreshable, virtual-list, slider, toggle, checkbox, select, radio-group, web-view, gesture-area, tab-row, text), tracked in a DocsScreenshotManifest for future regeneration
  • Fixes the device-chrome mockup (<x-docs.edge-preview>): adds a live clock, switches the Dynamic Island/camera cutout and home indicator to percentage-based sizing so they scale with the screenshot instead of a fixed pixel size, and adds sidebarWidthIos/sidebarWidthAndroid props so the fake status/home-indicator bars can match a partial-width drawer's dimming scrim
  • Fixes a browser layout bug where pairing a percentage width with aspect-square on the Android bottom-nav icons made the fake chrome bar's shrink-to-fit width diverge from the actual screenshot width

Test plan

  • php artisan test --filter=Docs passes (95 tests)
  • Pint passes
  • Manually verified rendering (both platforms, light/dark, mobile/desktop viewports) in-browser for every newly-wired page

🤖 Generated with Claude Code

lessevv and others added 9 commits September 10, 2026 22:12
…mponent screenshots

Adds an Artisan command that drives a local super-native checkout's
native:run/native:screenshot commands per screen and platform, stages
results under storage/docs-screenshots, and (with --publish) copies them
into public/img/docs. The 9 captured screens live in
App\Support\DocsScreenshotManifest, one entry per route in super-native's
Edge Component showcase.

Guards against the ways this can go wrong when run unattended: an
ambiguous device without --udid can make the underlying native:run prompt
interactively with no attached terminal, so that timeout is now caught
instead of crashing the command; a screen whose drawer needs a manual
open is skipped with a clear message rather than silently publishing a
closed-drawer screenshot when run non-interactively; and --publish checks
each source file exists and each copy actually succeeds before reporting
success.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… options

Splits CaptureDocsScreenshots into three focused, independently-testable
services (ScreenshotCapturer, ScreenshotPublisher), and the manifest now
records each screen's crop direction. Cropping itself is delegated to
mobile-air's own native:screenshot --crop/--crop-percent flags rather than
duplicated here, so every NativePHP developer gets it, not just this
pipeline. --full skips cropping, --crop-percent overrides the configured
default, and --dry-run prints the plan without running anything.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0.25 pulled in whatever sat just below/above the top/bottom bar on a
real device capture (verified against a booted iOS simulator) — 0.15
is the tightest value that still keeps the full bar on both the
top-bar and bottom-nav reference screens.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…approach

The inline <native:side-nav> element the old example and props table
documented renders nothing on either platform (its own admonition said
so) — there was no working example to preserve parity with, so this
replaces it with the Drawer-builder approach that actually works,
matching the reference screen in NativePHP/super-native. Also fixes
<native:horizontal-divider>, a stale tag name with no real element
behind it — <native:divider> is the real element.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
For developers without Herd's own database service running — matches
.env.example's default DB_* values, so `docker compose -f
docker-compose.local.yml up -d && php artisan migrate` is enough to get
a working local database.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Replace the bare two-up image grid with a tabbed iOS/Android preview
card: a device-style frame, a link to the exact reference-screen file
in super-native so the example can be seen running for real, and a
decorative (non-captured) chrome strip so the crop is unmistakably a
phone screen without embedding real device data (time, battery %,
carrier). Screenshots are regenerated with --crop-offset to exclude
the real status bar / OS nav bar entirely.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Lets a capture skip the OS status bar/nav bar before measuring
crop-percent, mirroring native:screenshot's own --crop-offset option.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add screenshots for bottom-sheet, modal, menus, list, refreshable,
virtual-list, slider, toggle, checkbox, select, radio-group, web-view,
gesture-area, tab-row, and text, alongside the existing top-bar/
bottom-nav/side-nav coverage, all captured from real iOS/Android
devices via native:screenshot and wired through DocsScreenshotManifest.

Fix edge-preview's device chrome:
- Add a live clock and percentage-based (not fixed-px) sizing for the
  Dynamic Island/camera cutout and home indicator, so they scale with
  the screenshot instead of a fixed size
- Fix a browser bug where pairing a percentage width with aspect-square
  on the Android bottom-nav icons made the fake chrome bar's shrink-to-
  fit width diverge from the actual screenshot width, leaving a visible
  gap; swapped to a fixed height instead
- Add sidebarWidthIos/sidebarWidthAndroid props so the fake status/
  home-indicator bars can match a partial-width drawer's dimming scrim

Co-Authored-By: Claude Sonnet 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