Skip to content

fix(mobile): break native step bar import cycle - #2947

Merged
DoodleBears merged 2 commits into
mainfrom
codex/2945-android-step-bar-cycle
Oct 27, 2026
Merged

DoodleBears merged 2 commits into
mainfrom
codex/2945-android-step-bar-cycle

Conversation

@DoodleBears

@DoodleBears DoodleBears commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Issue #2945 · QA source #2930 · Agent claim

Why the change

Native platform resolution made the step bar import its own exports, crashing mobile startup before Environment selection or Bot creation could open.

Special things to note

  • Merge risk: two-way door — revert this PR; medium blast radius — both mobile native entry points use this shared control, and an export regression can prevent app startup. Review the real Metro resolution regression and shared label exports.
  • Android 16 arm64 native repro failed before the change; the same development binary renders the Environment fixture after reloading the candidate JS. iOS native runtime remains untested; its actual Metro resolution regression is covered. No model was called.
  • Validation: 102 tests across nine relevant files pass, mobile typecheck and repository lint pass. Task: codex/local/01a17bef-21c0-75f0-bf5d-2fedb6df7b73.

Change outline

Before: step-bar.android/ios -> ./step-bar -> same platform renderer -> recursive getter
After:  step-bar.android/ios + fallback -> step-bar-contract.ts -> labels and types

The new regression uses the installed Expo Metro resolver on each renderer's actual runtime imports and re-exports; both platform cases failed before the fix and pass after it. The contract preserves existing label formatting and exported types.

Before — Android native load failure. After minimizing the stack-overflow overlay, the Environment fixture never renders.

Before: blank Android content after step-bar stack overflow

After — Environment list rendered. One native selected row and the Add 1 Environment capsule are visible. Both captures use the same 1220 × 1712 screen region; the upper account area, fixture email, status notifications and local paths are omitted. Original full PNG/XML/error evidence remains machine-local.

After: Android Environment list and native selected-row check

Refs #2922; Closes #2945.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue that could prevent the mobile app from opening Bot creation and Environment selection screens.

Issue: #2945

Agent-Task: codex/local/01a17bef-21c0-75f0-bf5d-2fedb6df7b73
Issue: #2945

Agent-Task: codex/local/01a17bef-21c0-75f0-bf5d-2fedb6df7b73
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b25a1ad5-75e5-4b1d-a9c7-b17eec2f6e65
Commits

Reviewing files that changed from the base of the PR and between a3b9b11 and 68c68f4.

Files ignored due to path filters: 2
  • .github/pr-screenshots/2945/after.png is excluded by !**/*.png
  • .github/pr-screenshots/2945/before.png is excluded by !**/*.png
Files selected for processing: 6
  • apps/mobile/src/ui/primitives/step-bar-contract.ts
  • apps/mobile/src/ui/primitives/step-bar.android.tsx
  • apps/mobile/src/ui/primitives/step-bar.ios.tsx
  • apps/mobile/src/ui/primitives/step-bar.tsx
  • changes/2945-native-step-bar-cycle.md
  • scripts/test/step-bar-platform-resolution.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The step-bar contract and label helpers now reside in a platform-neutral module. The Android and iOS renderers use that module, and a regression test checks platform dependency resolution.

Changes: Native step-bar module-cycle fix

Layer / File(s) Summary
Define the shared step-bar contract
apps/mobile/src/ui/primitives/step-bar-contract.ts
Adds shared action and prop types, plus label helpers that include step details when provided.
Wire renderers and check platform resolution
apps/mobile/src/ui/primitives/step-bar.tsx, apps/mobile/src/ui/primitives/step-bar.android.tsx, apps/mobile/src/ui/primitives/step-bar.ios.tsx, scripts/test/step-bar-platform-resolution.test.mjs, changes/2945-native-step-bar-cycle.md
The shared renderer entry point and platform renderers import and re-export the contract symbols. The test checks that Metro resolves renderer dependencies to source files other than the renderer itself. The changelog records the fix in English and Chinese.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

  • Issue 2926 describes native Git import flows that use the step bar. This fix addresses the Android startup failure that can block those flows.
  • Issue 2923 describes Environment selection and shared step-bar use. This fix addresses the Android startup failure that can prevent the screen from loading.
  • Issue 2928 describes Zip and marketplace import flows that reuse the step bar. This fix addresses the Android startup failure that can block those flows.
  • Issue 2802 describes Bot creation and import journeys. This fix addresses a shared startup failure that can prevent the journeys from starting, but does not implement their feature behavior.
Merge Risk: Minimal · up to 68c68

No actionable issue is established for this change; it is mergeable after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: breaking the native step-bar import cycle in the mobile application.
Description check Passed The description is mostly complete. It explains the problem, links the issue, documents merge risk, verification results, the untested iOS runtime, the structural change, and before/after evidence. It…
Linked Issues check Passed Directly linked issue #2945 has three coding requirements. (1) Separate the platform-neutral step-bar contract and labels from the platform renderers: the PR adds apps/mobile/src/ui/primitives/step-ba…
Out of Scope Changes check Passed All changed files relate to the #2945 objectives. The new step-bar-contract.ts holds the shared contract and label helpers. The android, ios, and base step-bar files change only their import and re-ex…
Full details: Description check

Explanation

The description is mostly complete. It explains the problem, links the issue, documents merge risk, verification results, the untested iOS runtime, the structural change, and before/after evidence. It does not explicitly state the CI test-plan mode, but this omission does not prevent understanding the change.

Full details: Linked Issues check

Explanation

Directly linked issue #2945 has three coding requirements. (1) Separate the platform-neutral step-bar contract and labels from the platform renderers: the PR adds apps/mobile/src/ui/primitives/step-bar-contract.ts with StepBarAction, StepBarProps, stepBarLabel, and stepBarAccessibilityLabel. step-bar.android.tsx and step-bar.ios.tsx now import and re-export these symbols from step-bar-contract. step-bar.tsx drops its former definitions and imports them from the contract. This removes the self-import cycle that caused the recursive getter. (2) Add regression coverage using Android module resolution: scripts/test/step-bar-platform-resolution.test.mjs parses each renderer, collects relative runtime imports and re-exports, resolves them with Metro, and asserts that they resolve to a source file other than the renderer. Per the PR, both the Android and iOS cases failed before the fix and pass after it. (3) Rerun the real phone before and after: this is manual device verification and is non-coding. The PR reports Android 16 arm64 evidence (failed before, Environment list rendered after). Under the instructions, it is not assessed as a coding requirement. Evidence came from the whole-PR summary and PR description; no repository inspection was needed to establish these behaviors.

Full details: Out of Scope Changes check

Explanation

All changed files relate to the #2945 objectives. The new step-bar-contract.ts holds the shared contract and label helpers. The android, ios, and base step-bar files change only their import and re-export sources, with exported names and signatures unchanged. The regression test scripts/test/step-bar-platform-resolution.test.mjs covers the required Android resolution check. The changes/2945-native-step-bar-cycle.md changelog entry is documentation for this fix. The added label helpers preserve existing label formatting, per the PR. No unrelated behavior change appears in the summary.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 5 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

bug(mobile): Android step bar crashes on first load after #2930

1 participant