Skip to content

fix(desktop): show a partly hidden provider as mixed, not off; target side panels by test id - #1641

Merged
huichen merged 2 commits into
mainfrom
pr/huichen
Nov 17, 2026
Merged

huichen merged 2 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

A provider group whose models are partly hidden was drawn as off: Switch took a boolean, so checked={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. Switch now accepts a mixed state (aria-checked="mixed", knob halfway), ModelsPage computes it from the visible/total counts, and clicking a mixed switch turns the whole group on.

The harness case 10-side-panels asserted 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-view root, remote-hub-lead plus the host direction block) with a hit test, clicks rail entries through rail-nav instead 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

  • fix(desktop): show a partly hidden provider as mixed, not off
  • test(harness): assert the side panels themselves, not the main area's text

Verification

Run locally on this branch before opening the PR:

  • npm --prefix desktop run typecheck (tsc --noEmit) — clean
  • npx eslint over the six touched desktop files — clean
  • npx vitest run src/components/ui/uiExtra.test.tsx src/features/settings/ModelsPage.test.tsx — 58 passed (2 files)
  • harness/cases/core/10-side-panels.json parses as JSON

User-visible changes

  • Provider visibility switch (Settings > Models). Before: a provider group with some of its models hidden rendered as a normal off switch, and clicking it turned the group on. After: that row renders a third "mixed" state (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.
  • The other commit only adds data-testid anchors (rail-nav, provider-visibility-switch, skills-view) and rewrites the harness case; no behaviour change.

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.
@huichen
huichen enabled auto-merge (squash) November 17, 2026 21:18
@huichen
huichen merged commit b294375 into main Nov 17, 2026
10 checks passed
@huichen
huichen deleted the pr/huichen branch November 17, 2026 21:23
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