fix(mobile): gate the phone overview's run picker on CLI availability - #214
Conversation
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>
Uh oh!
There was an error while loading. Please reload this page.
Ark0N
commented
Aug 5, 2026
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 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 Thanks for keeping the mobile surface in step with the toolbar. |
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 inmobile-overview.jsnever 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 (sameisCliAvailable()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 --noEmitclean,npm run lintclean.