fix: make discovered models selectable in the Profile editor - #109
Merged
Conversation
The Profile editor prefills the Provider's default_model, and ModelPicker used that same string as its list filter. A default is rarely among the IDs an endpoint actually returns, so the list rendered "no matching models" directly below a notice reporting how many had been found, and none of them could be chosen. Track the typed query separately from the committed model ID, and put the list behind a disclosure arrow on the two Profile editors: an always-open list pushed the editor's footer off screen, and the arrow is also the only affordance that said the discovered models were selectable. The wizard's model step is a whole page about choosing one, so there the list stays open and unarrowed. Also fixes two stale e2e selectors left by 8c678c8, which renamed 模板 to 模版 in the UI but not in the spec. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
openCreate derives the ID and the name from the first Provider, but changeProvider only recomputed the model. So a Profile created after switching Provider was still called "PPIO 配置模版" and stored under profile-ppio -- a name and a storage key both naming the Provider the user had just moved away from. Recompute all three, but only where the field still holds what the previous Provider seeded: a value the user typed is theirs to keep. Creating only -- an existing Profile's ID is its storage key and the field is disabled, and its name is one the user has already lived with. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
The Profile editor prefills the Provider's
default_model(ProfilesPage.tsx:82), andModelPickerused that same string as its list filter:One string served as both the committed model ID and the search query. A Provider default is rarely among the IDs an endpoint actually returns, so the list rendered "没有匹配的模型" directly below a notice reading "找到 N 个模型" — a count of found models over an empty list, with no way to reach any of them.
Reproduced against the server-mode backend before the fix:
No substring overlap, so nothing was listed.
Fix
Track the typed query separately from the committed model ID, and put the list behind a disclosure arrow on the two Profile editors. The arrow is not cosmetic: an always-open list pushed the editor's footer off screen, and it was also the only missing affordance saying the discovered models were selectable at all. The query resets on commit and on reopening, so a filtered session cannot leave a stale filter behind.
The wizard's model step is a whole page about choosing a model, so there the list stays open and unarrowed — that path is unchanged.
Also fixes two stale e2e selectors left by 8c678c8, which renamed 模板 to 模版 in the UI but not in the spec.
pnpm run test:e2ewas already failing onmainatwails.spec.ts:110before this branch.Verification
npx vitest run— 36 files, 264 passed (9 new inModelPicker.test.tsx)pnpm run build—tsc --noEmitcleanpnpm run test:e2e— 6 passed, including a new test for this pathgo test ./...,go vet ./...— cleanpython3 scripts/check-docs.py— okBoth new tests were confirmed to fail against the old filter and pass with the fix, so they pin the regression rather than merely passing.
Computed styles checked in both palettes: the popup background tracks the theme (
rgb(255,255,255)→rgb(30,30,32)), input text flips to near-white in dark mode, and the list floats over the footer atz-index: 40while the footer stays on screen.🤖 Generated with Claude Code