Skip to content

feat(ui): wire Welcome screen CTAs to Scanner navigation + external browser #14

@ilmoniemi

Description

@ilmoniemi

User Story

As a new Pyrycode Mobile user on the Welcome screen who hasn't yet set up the pyrycode CLI, I want the Set up pyrycode first CTA to open the setup landing page in my browser so I can install pyrycode without leaving the app guessing where to go.

Context

The Welcome screen's two CTAs were scaffolded in #7 with hoisted onPaired / onSetup callbacks. #12 (merged in PR #41) already re-wired onPaired at the MainActivity PyryNavHost layer to navigate to Routes.Scanner — that half of the original #14 is done. What remains is the onSetup callback, which is still a TODO(#14) placeholder at MainActivity.kt's composable(Routes.Welcome) { ... } block.

This ticket wires that one callback to an external-browser launch via Intent.ACTION_VIEW + Context.startActivity, pointing at https://pyryco.de/setup. That URL currently redirects to the pyrycode repo README; that's fine — a real landing page is out of scope here.

Acceptance Criteria

  • Tapping the Welcome screen's secondary CTA ("Set up pyrycode first") opens https://pyryco.de/setup in the device's default browser via Intent.ACTION_VIEW + Context.startActivity.
  • The wiring lives at the composable(Routes.Welcome) { ... } site in MainActivity.kt (replacing the existing TODO(#14) line); WelcomeScreen's onSetup: () -> Unit parameter shape is unchanged.
  • Compose @Preview functions in WelcomeScreen.kt still compile and render — preview callbacks remain no-ops, no preview-only branching needed.
  • ./gradlew assembleDebug passes.
  • ./gradlew lint passes.

Technical Notes

  • Existing wiring shape at MainActivity.kt's onPaired shows the pattern — the architect can mirror it with a Context-aware lambda (e.g. LocalContext.current captured in the composable { ... } body).
  • No new dependencies expected.
  • URL is a hardcoded constant — no input parsing, not security-sensitive.

Out of Scope

  • Scanner UI / behavior — owned by feat(ui): add Stub Scanner screen + route #12 (closed).
  • Real pairing landing page at pyryco.de/setup — temporary redirect to repo README is acceptable.
  • Hardening for the "no browser installed" edge case (ActivityNotFoundException) — defer until observed; not a realistic failure mode on stock Android 13+ where the system handles ACTION_VIEW for https URLs.

Depends on

Size Estimate

XS — single callback wiring at one call site in MainActivity.kt, well under 30 lines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    size:xs<30 lines production code; trivial change

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions