Skip to content

fix(ui): sync the engine chips when the mobile settings sheet opens - #105

Open
Its-My-Work wants to merge 1 commit into
Lexus2016:mainfrom
Its-My-Work:fix/mobile-engine-chip-sync
Open

Its-My-Work wants to merge 1 commit into
Lexus2016:mainfrom
Its-My-Work:fix/mobile-engine-chip-sync

Conversation

@Its-My-Work

Copy link
Copy Markdown
Contributor

Bug

Opening the mobile bottom-sheet settings panel always shows neither the
API nor the Subscription engine chip as selected, even right
after picking one or after defaultEngine resolves.

Root cause

syncMobSheetFromDesktop() re-derives each mobile chip's highlighted
state from the current in-memory cur* variables:

if (group === 'mode') cur = curMode;
else if (group === 'agent') cur = curAgent;
else if (group === 'model') cur = curModel;
chip.classList.toggle('on', v === cur);

There's no engine branch, so for that group cur stays '', which
never equals 'api' or 'subscription' — both chips lose their .on
class every time the sheet opens. curEngine itself and the ★
"default engine" star (synced separately by syncDefaultStar()) are
unaffected, so the underlying selection is actually correct — only the
chip highlighting is wrong, which reads as "my engine choice isn't
saved."

Fix

Add the missing branch:

else if (group === 'engine') cur = curEngine;

One line, mirrors the existing pattern for the other three groups.

🤖 Generated with Claude Code

https://claude.ai/code/session_011E2bJQ2sL9LgEWosjvydTR

syncMobSheetFromDesktop() re-derives each mobile chip's highlighted
state from the in-memory cur* variables, but its if/else chain only
covered mode/agent/model — engine was never assigned, so `cur` stayed
empty and both the API and Subscription chips lost their `.on` class
every time the sheet opened, even though curEngine (and the ★ default
star, which is synced separately) were correct underneath.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011E2bJQ2sL9LgEWosjvydTR
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