Skip to content

feat(stream): nav row and resume - #9

Open
lutz-grex wants to merge 4 commits into
mainfrom
feat/react-stream-nav-resume
Open

lutz-grex wants to merge 4 commits into
mainfrom
feat/react-stream-nav-resume

Conversation

@lutz-grex

@lutz-grex lutz-grex commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

DeviceStream now ships the phone controls that Mobilerun Cloud shows: a dark Back / Home / Recent apps row inside the screen, and a stopped-device view with a Play button that resumes the device. Both parts are on by default and can be turned off per component.

Changes

  • Navigation row: DeviceStream renders NavigationBar under the video, inside the screen. Keys send BACK / HOME / RECENT and are disabled while the stream is not connected or hasControl is false. hideNavigation turns the row off. NavigationBar keeps its props and gains optional disabled and labels; its look changes to the dark Cloud row.
  • Stopped devices: new props deviceState and onResume. With deviceState="stopped" the stream is not opened; the screen shows a "Device stopped" pill with a power icon and a round Play button. A tap calls onResume and shows "Starting" until the state leaves stopped; if onResume rejects, the button comes back. hideResumeButton keeps the pill and hides the button. Reconnecting is paused while the device is stopped and starts fresh when it runs again.
  • useDeviceStream({ device }) returns resume() when the SDK device object supports it (@mobilerun/sdk 6.2+). It resumes, then refetches the device, also when the readiness wait fails after the resume request.
  • Labels: new optional keys back, home, recentApps, resume, stopped, starting. Existing complete label objects still type-check.
  • StreamStatusPill gains an optional icon (spinner by default, or power).
  • Example app: uses the built-in row and resumes stopped devices through two new server routes, POST /api/v1/devices/:id/resume and the read-only GET /api/v1/devices/:id/wait, with the same same-origin, id and missing-key guards as the stream-key route. The API key stays on the server.
  • README, docs/default-ui.md and the device-stream skill document the new props, flags and labels.

Upgrade notes: no version, peer range or export changes. The navigation row now appears by default and takes space inside the component's height; apps that already render their own row should remove it or set hideNavigation. The navigation buttons are type="button", so a DeviceStream inside a form never submits it.

Testing

  • bun run typecheck: pass
  • bun test: pass (0 failures)
  • bun run build: pass; the new utility classes are present in dist/styles.css
  • New tests cover key mapping and disabled state of the row, hideNavigation, the stopped view (pill, Play, Starting, rejection, state change), hideResumeButton, reconnect paused while stopped, resume() refetch after a failed readiness wait, the old label shape, and the example's resume and wait routes (happy path, invalid id, foreign origin, missing key, upstream errors).

Runtime

UNVERIFIED — no resume against a real device yet; needs one stopped dev device resumed through the example app after merge.

Release Checklist

  • Tests/CI green — CI green on 79cddf4
  • Code review by a second engineer — exception: admin merge without required approval
  • Security impact checked (auth, secrets, customer data, new dependencies) — no auth, token or secret logic in the package; no new or bumped dependencies; the example server's two new routes run behind its existing same-origin and id guards and keep the API key server-side
  • No open high/medium findings (Dependabot/scanners) — 0 open critical/high/medium Dependabot alerts; code scanning not enabled
  • Rollback plan clear (for infra/DB changes) — revert this PR; no infra, migration or published version involved
  • Docs/runbooks updated where needed — README, docs/default-ui.md and the device-stream skill updated in this PR

🤖 Generated with Claude Code

lutz-grex and others added 4 commits December 2, 2026 13:42
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@lutz-grex
lutz-grex requested a review from sleynsol December 2, 2026 14:17
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