Skip to content

fix(mobile): gate the phone overview's run picker on CLI availability - #214

Merged
Ark0N merged 1 commit into
Ark0N:masterfrom
timkjr:fix/mobile-overview-run-gating
Aug 5, 2026
Merged

fix(mobile): gate the phone overview's run picker on CLI availability#214
Ark0N merged 1 commit into
Ark0N:masterfrom
timkjr:fix/mobile-overview-run-gating

Conversation

@timkjr

Copy link
Copy Markdown

Summary

The phone overview's Run picker (the "C" logo home screen under 430px) always listed all six CLI backends — Claude, Shell, OpenCode, Codex, Gemini, Antigravity — regardless of whether the corresponding CLI was actually installed. Tapping an unavailable one produced a confusing failed-launch instead of the entry simply not being there.

The desktop/tablet toolbar's Run dropdown already gates each entry on isCliAvailable(mode); the mobile overview's picker in mobile-overview.js never had the equivalent check, so it silently drifted from the toolbar's behavior as new CLI backends were added.

Fix

_buildMobileOverviewRunMenu() now skips any non-shell entry whose CLI isn't installed, mirroring the toolbar's existing gating logic exactly (same isCliAvailable() call, same shell exemption).

Testing

  • test/mobile-overview.test.ts (vm-sandbox harness) — new coverage asserting an unavailable CLI is excluded from the menu while available ones and shell remain.
  • tsc --noEmit clean, npm run lint clean.

MOBILE_OVERVIEW_RUN_MODES / _buildMobileOverviewRunMenu is a separate,
hardcoded duplicate of the toolbar's #runModeMenu (mobile-overview.js
is a newer feature that mirrors the toolbar menu's look/behavior
rather than reusing its render), so it never picked up Ark0N#201's
isCliAvailable() gating and offered every backend regardless of what
the server actually has installed.
Gate it the same way: skip an entry unless isCliAvailable(mode),
shell always exempt. Added functional + static regression tests
mirroring the toolbar menu's own test pattern.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Ark0N
Ark0N merged commit 22e77a1 into Ark0N:masterAug 5, 2026
2 checks passed
@Ark0N

Ark0N commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Merged, thank you! 🙏

Clean catch. The phone overview's picker being a hardcoded duplicate of the toolbar menu rather than a shared render is exactly why it silently missed #201's gating, and it would have kept drifting every time a backend was added. Mirroring the toolbar logic exactly (same isCliAvailable(), same shell exemption) is the right fix, and isCliAvailable() failing open on an unknown flag means the menu can never end up empty.

The third test is the one I appreciate most: asserting that every mode the picker offers is actually gated catches the next backend being added ungated, which is the recurring shape of this bug rather than the instance of it.

Verified here before merging: merged cleanly alongside #203 and #215, and the full test:ci sweep on the combined merge was green (198 files, 3971 tests, zero failures).

Thanks for keeping the mobile surface in step with the toolbar.

Sign up for freeto 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.

2 participants

@timkjr@Ark0N