Skip to content

Add Jump compatibility indicators for plugins and EDGE docs#445

Draft
simonhamp wants to merge 1 commit into
mainfrom
jump-plugin-badge
Draft

Add Jump compatibility indicators for plugins and EDGE docs#445
simonhamp wants to merge 1 commit into
mainfrom
jump-plugin-badge

Conversation

@simonhamp

Copy link
Copy Markdown
Member

Surfaces Jump — Bifrost's mobile preview app — in two places it was previously invisible.

Plugins: "Works in Jump" pill

Jump is a pre-built binary containing only NativePHP's core native APIs, so a plugin shipping its own Kotlin/Swift bridge functions can't run in it. That's a judgment call rather than something reliably derivable from a manifest, so this adds a manual works_in_jump flag:

  • Admin-controlled in Filament (form toggle, table toggle-column, ternary filter)
  • Rendered as a pill on the plugin detail page and on marketplace cards
  • Defaults to false; worksInJump() helper mirrors the existing isOfficial() / isActive() conventions

Docs: scannable QR on EDGE component pages

Mobile v4 EDGE component pages now show a collapsible QR card in the right sidebar (between "Copy as Markdown" and the ads), encoding that page's docs URL plus a ?jump=qr marker:

  • With Jump installed — the OS routes the /docs/* deep link straight into the app (already claimed via the existing AASA/assetlinks files)
  • Without it — the link falls back to the mobile browser, where the marker triggers a "Get the Jump app" overlay with platform-detected store buttons (App Store on iOS, Play on Android, both when undetectable)

Two deliberate details worth reviewing:

  1. The overlay lives outside the sidebar. The right sidebar is hidden xl:flex, and the overlay is rendered by the phone, so putting it there would hide it exactly where it's needed.
  2. The QR is pinned to nativephp.com. Jump only claims deep links for that domain, and a phone can't resolve a local/preview hostname — a QR built from url() would be unscannable outside production.

Scoped strictly to Mobile v4: EDGE sections also exist in Mobile v2 and v3, and this must not appear there.

Incidental fixes

  • Extracted App\Support\JumpApp — the deep-link association files and the docs UI now share one source of truth for Jump's bundle IDs and store URLs, instead of duplicating them across ApplinksController and docs markdown.
  • Fixed a Cache::flush() race in ShowDocumentationController. It ran on every local docs request; concurrent requests could delete a hashed cache subdirectory mid-iteration, throwing FilesystemIterator ... Failed to open directory (hit while testing this branch). Local now bypasses the docs cache instead of flushing globally — same always-fresh-in-dev intent, no race, and no longer wipes unrelated cache entries.

Testing

25 new tests across 6 files, all passing alongside the existing docs suite (56 total):

  • QR generation and canonical-domain pinning (unit)
  • Card/overlay rendering, sidebar placement ordering, collapsed-by-default markup
  • Negative coverage: non-EDGE pages, Mobile v2/v3 EDGE pages, desktop docs
  • Plugin pill visibility on the detail page and cards
  • ApplinksTest locks the JumpApp extraction
  • DocsCachingTest locks the cache-race fix

Also verified end-to-end against a live dev site: the rendered QR SVG is byte-identical to one generated from the canonical URL, confirming the actual scannable payload.

Note for reviewers

The QR points at production nativephp.com, so scanning it before this merges will exercise the deep-link path but not the overlay — production has no ?jump=qr handler until this ships. To try the overlay now, load an EDGE page locally with ?jump=qr under device emulation.

🤖 Generated with Claude Code

Surfaces Bifrost's Jump preview app in two places:

- Plugins: a manual `works_in_jump` flag (admin-controlled via Filament)
  rendered as a pill on the plugin detail page and marketplace cards.
- Docs: a collapsible QR code in the right sidebar of Mobile v4 EDGE
  component pages, deep-linking into Jump. Visitors who scan without the
  app installed get an overlay with platform-detected store buttons.

Also extracts Jump's public identity into App\Support\JumpApp so the
deep-link association files and the docs UI share one source of truth,
and fixes a Cache::flush() race in the docs controller that could throw
FilesystemIterator errors on concurrent local requests.

Co-Authored-By: Claude Opus 5 (1M context) <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