Skip to content

feat(build): improve native build setup flow#2045

Merged
riderx merged 3 commits into
mainfrom
codex/build-platform-choice-ui
May 6, 2026
Merged

feat(build): improve native build setup flow#2045
riderx merged 3 commits into
mainfrom
codex/build-platform-choice-ui

Conversation

@riderx
Copy link
Copy Markdown
Member

@riderx riderx commented May 6, 2026

Summary (AI generated)

  • Let build request prompt for iOS or Android when --platform is omitted in an interactive terminal.
  • Replace the old native-build empty state cards with one command-first setup flow with an iOS/Android switch.
  • Hide the setup command for any platform that already has build history, and keep the request/wait flow available.
  • Add CLI docs, skill docs, and a focused platform-selection test.

Motivation (AI generated)

Build onboarding should be usable directly from the console and less brittle in the CLI. Users can now choose the platform interactively in local shells, while CI/non-interactive usage still requires an explicit platform.

Business Impact (AI generated)

This reduces friction for users trying Capgo native builds, makes the console setup path clearer, and keeps build request behavior safer for automation.

Screenshot (AI generated)

Build setup command flow

Test Plan (AI generated)

  • bun lint
  • bun typecheck
  • bun run build
  • bun run lint in cli/
  • bun run build in cli/
  • bun run test:build-platform-selection in cli/
  • bun run test:mcp in cli/
  • bun run test:bundle in cli/
  • Headless screenshot of /app/com.demo.app/builds

Generated with AI

Summary by CodeRabbit

  • New Features

    • Platform selection is now optional in interactive terminals; users can omit the flag and be prompted to choose iOS or Android.
    • Enhanced build setup flow with platform-specific guidance and improved error messages.
  • Documentation

    • Updated documentation clarifying that --platform is optional in interactive mode but required for non-interactive usage.
  • Tests

    • Added test coverage for platform selection behavior across interactive and non-interactive scenarios.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

Warning

Rate limit exceeded

@riderx has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 23 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6fffdd65-2f08-4dee-b76a-cd372b589109

📥 Commits

Reviewing files that changed from the base of the PR and between d08e3d8 and 4b39224.

⛔ Files ignored due to path filters (1)
  • docs/pr/builds-command-setup.png is excluded by !**/*.png
📒 Files selected for processing (12)
  • cli/README.md
  • cli/package.json
  • cli/skills/native-builds/SKILL.md
  • cli/src/build/request.ts
  • cli/src/schemas/build.ts
  • cli/test/test-build-platform-selection.mjs
  • cli/webdocs/build.mdx
  • messages/en.json
  • src/components.d.ts
  • src/components/dashboard/BuildSetupInvite.vue
  • src/components/dashboard/StepsBuild.vue
  • src/components/tables/BuildTable.vue
📝 Walkthrough

Walkthrough

This PR implements optional platform selection for the native build request flow. When users omit the --platform flag in an interactive terminal, they are prompted to choose iOS or Android. The build request logic is refactored to resolve the platform early, and the frontend UI is restructured to display platform-aware build steps. Documentation, localization, and tests are updated accordingly.

Changes

Platform-Aware Build Flow

Layer / File(s) Summary
Type & Schema Foundation
cli/src/build/request.ts, cli/src/schemas/build.ts
New BuildPlatform type, ResolveBuildPlatformOptions interface, and exported resolveBuildPlatform function introduced. Schema platform field changed from required to optional to reflect interactive prompting behavior.
Platform Resolution Core
cli/src/build/request.ts
resolveBuildPlatform validates input and optionally prompts user for platform choice; promptBuildPlatform helper provided. Platform is resolved early and used throughout request flow instead of raw options.platform.
Build Request Integration
cli/src/build/request.ts
Build request payload construction, credential validation, zip/upload workflow, and status polling updated to use resolved platform. Platform-specific paths derived from capacitor config. Version from package.json injected into payload.
Frontend Component Overhaul
src/components/dashboard/StepsBuild.vue, src/components/tables/BuildTable.vue
StepsBuild rewritten with per-platform step sequences and reactive watchers for platform/appId changes. BuildTable refactored to track per-platform build counts and render StepsBuild when onboarding is active. BuildSetupInvite component removed and deleted from src/components.d.ts.
Localization & Configuration
messages/en.json, cli/package.json
New localization keys added for build docs link, platform names, setup steps, and readiness flags. New test:build-platform-selection script added to test suite.
Documentation
cli/README.md, cli/skills/native-builds/SKILL.md, cli/webdocs/build.mdx
Platform option descriptions updated to clarify interactive prompting behavior (omit --platform for prompt in interactive mode; required in non-interactive mode).
Test Coverage
cli/test/test-build-platform-selection.mjs
New test suite verifying resolveBuildPlatform across explicit platforms, invalid inputs, interactive prompting, cancellation, and error scenarios.

Sequence Diagram

sequenceDiagram
    actor User
    participant CLI as Build CLI
    participant Resolver as Platform Resolver
    participant Prompt as Interactive Prompt
    participant Build as Build Request
    participant UI as Frontend UI

    User->>CLI: Run build command<br/>(--platform omitted)
    CLI->>Resolver: resolveBuildPlatform(undefined)
    alt Interactive Terminal
        Resolver->>Prompt: isInteractive() = true
        Prompt->>User: Choose iOS or Android
        User->>Prompt: Select platform
        Prompt-->>Resolver: Platform selected
    else Non-Interactive
        Resolver-->>CLI: Error: platform required
    end
    Resolver-->>CLI: Resolved platform (ios|android)
    CLI->>Build: Build request with<br/>resolved platform
    Build->>Build: Validate credentials<br/>for platform
    Build->>Build: Zip project for platform
    Build->>Build: Upload & start build
    Build-->>CLI: Build status/logs
    CLI->>UI: Emit platform build counts
    UI->>UI: Render platform-aware<br/>build steps
    UI-->>User: Display build progress
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • Cap-go/capgo#1999: Modifies cli/src/build/request.ts and the build zip/upload flow with overlapping changes to request packaging and zipDirectory callsites.
  • Cap-go/capgo#1977: Touches the same CLI workspace files (cli/src/build/request.ts, cli/src/schemas/build.ts, cli/README.md) with related platform and build request refactoring.

Poem

🐰 Platform prompts now hop and spring,
Interactive flows make terminals sing—
iOS and Android choose with care,
Build steps dance platform-aware,
✨ A smoother request, everywhere!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: improving the native build setup flow with interactive platform selection and command-first UI.
Description check ✅ Passed The description includes a comprehensive AI-generated summary, motivation, business impact, screenshot, and detailed test plan covering multiple aspects of the change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/build-platform-choice-ui

Comment @coderabbitai help to get the list of available commands and usage tips.

@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq Bot commented May 6, 2026

Merging this PR will not alter performance

✅ 28 untouched benchmarks


Comparing codex/build-platform-choice-ui (4b39224) with main (8c586bb)

Open in CodSpeed

@riderx riderx marked this pull request as ready for review May 6, 2026 14:42
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5785ec3b28

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/components/tables/BuildTable.vue Outdated
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

@riderx riderx merged commit a0483d0 into main May 6, 2026
67 of 68 checks passed
@riderx riderx deleted the codex/build-platform-choice-ui branch May 6, 2026 16:29
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