Skip to content

fix: make discovered models selectable in the Profile editor - #109

Merged
yujiezhang-ops merged 2 commits into
mainfrom
fix/model-picker-selectable
Aug 8, 2026
Merged

fix: make discovered models selectable in the Profile editor#109
yujiezhang-ops merged 2 commits into
mainfrom
fix/model-picker-selectable

Conversation

@yujiezhang-ops

Copy link
Copy Markdown
Collaborator

Problem

The Profile editor prefills the Provider's default_model (ProfilesPage.tsx:82), and ModelPicker used that same string as its list filter:

const filtered = models.filter((model) => model.includes(value.trim()));

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:

prefilled model: "deepseek/deepseek-v4-pro"
notice:          找到 1 个模型
discovered:      ["oneagent-e2e-model"]

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:e2e was already failing on main at wails.spec.ts:110 before this branch.

Verification

  • npx vitest run — 36 files, 264 passed (9 new in ModelPicker.test.tsx)
  • pnpm run buildtsc --noEmit clean
  • pnpm run test:e2e — 6 passed, including a new test for this path
  • go test ./..., go vet ./... — clean
  • python3 scripts/check-docs.py — ok

Both 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 at z-index: 40 while the footer stays on screen.

🤖 Generated with Claude Code

yujiezhang-ops and others added 2 commits August 8, 2026 11:29
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>
@yujiezhang-ops
yujiezhang-ops merged commit e98e802 into main Aug 8, 2026
4 checks passed
@Paulkm2006
Paulkm2006 deleted the fix/model-picker-selectable branch August 10, 2026 05:52
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