fix(ui): sync the engine chips when the mobile settings sheet opens - #105
Open
Its-My-Work wants to merge 1 commit into
Open
Its-My-Work wants to merge 1 commit into
Its-My-Work wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
defaultEngineresolves.Root cause
syncMobSheetFromDesktop()re-derives each mobile chip's highlightedstate from the current in-memory
cur*variables:There's no
enginebranch, so for that groupcurstays'', whichnever equals
'api'or'subscription'— both chips lose their.onclass every time the sheet opens.
curEngineitself and the ★"default engine" star (synced separately by
syncDefaultStar()) areunaffected, 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:
One line, mirrors the existing pattern for the other three groups.
🤖 Generated with Claude Code
https://claude.ai/code/session_011E2bJQ2sL9LgEWosjvydTR