Repository navigation
fix(desktop): show a partly hidden provider as mixed, not off; target side panels by test id - #1641
Merged
Merged
Conversation
A provider's group switch was `checked={allVisible}`, so a provider with one
model shown and one hidden rendered as "off" — the user reads the whole group
as unavailable. On 2026-11-18 a GPT-6.1-Terra visual rerun of the side-panels
case caught exactly that on omlx (Qwen3.8 on, Qwen3.6 off); the UI had no way
to say "some of it is on".
Switch gains an optional `mixed` state: `aria-checked="mixed"`, the knob sits
between the two ends, and a click resolves to "on" rather than flipping to
off (the same intent as a partial checkbox in a tree). ModelsPage computes it
from the visible count and also names the group switch's wrapper
(`provider-visibility-switch`) so a test can address it without relying on
document order.
Tests pin the three states and the click semantics at both levels: the control
itself, and the page that decides what "mixed" means for a provider.
… text The side-panels case asserted `main.innerText.length > 20` for every entry. That is true whenever the main column holds *anything* — including the conversation you were already reading — so the "skills" and "remote" checks could not go red. A 2026-11-18 Terra rerun of this case reported "clicked skills, main still shows the conversation", and the case had said pass. Two things had to be fixed for the check to mean anything. Addressing the panel. SkillsView's root gains `data-testid="skills-view"`; the remote page already had `remote-hub-lead` and `remote-hub-host`. The two assertions now require that anchor inside `main`, a plausible size, the panel's own controls (two tab buttons / the host block), and that `elementFromPoint` inside it lands within it — so a panel that is mounted but covered (the settings dialog stays open across a rail click) is still red. Addressing the entry. The rail's standing entries are now reachable as `[data-testid="rail-nav"] button`, because clicking by body text is ambiguous: the harness takes the *last* element whose text starts with the needle, and a conversation titled "远程桌面工作区会话归档与搜索" matched "远程" — the click opened that session instead of the rail entry, which the old assertion also called pass. The models part gains the invariant the rerun exposed: a group switch must agree with its children, `mixed` included. `定时任务` and `设置` keep their old checks; they are the same class of problem and a separate change.
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.
What and why
A provider group whose models are partly hidden was drawn as off:
Switchtook a boolean, sochecked={models.every(...)}rendered a half-hidden group exactly like a fully hidden one. The user reads that as "this whole provider is unavailable" while some of its models are in fact usable.Switchnow accepts amixedstate (aria-checked="mixed", knob halfway),ModelsPagecomputes it from the visible/total counts, and clicking a mixed switch turns the whole group on.The harness case
10-side-panelsasserted on "the main area has some text", which is true even when the wrong panel is on screen — the skills and remote steps therefore could never fail. It now asserts on each panel's own anchor (skills-viewroot,remote-hub-leadplus the host direction block) with a hit test, clicks rail entries throughrail-navinstead of full-text matching (a conversation whose title contains the same characters as the远程rail label also matched, so the click opened a session rather than the panel), and adds a mixed-state invariant for the models page.Commits
Verification
Run locally on this branch before opening the PR:
npm --prefix desktop run typecheck(tsc --noEmit) — cleannpx eslintover the six touched desktop files — cleannpx vitest run src/components/ui/uiExtra.test.tsx src/features/settings/ModelsPage.test.tsx— 58 passed (2 files)harness/cases/core/10-side-panels.jsonparses as JSONUser-visible changes
aria-checked="mixed", knob between the ends, track unfilled), and clicking it turns every model in the group on — the same intent as clicking a partial checkbox. A fully hidden group is still off, a fully visible one still on. Revert:d0da2e46a.data-testidanchors (rail-nav,provider-visibility-switch,skills-view) and rewrites the harness case; no behaviour change.