Skip to content

[feat] canvas: keep one compact row per model in the picker - #497

Open
Zhangbo-cn wants to merge 7 commits into
ThinkFlowLab:mainfrom
Zhangbo-cn:feat/model-picker-compact
Open

Zhangbo-cn wants to merge 7 commits into
ThinkFlowLab:mainfrom
Zhangbo-cn:feat/model-picker-compact

Conversation

@Zhangbo-cn

@Zhangbo-cn Zhangbo-cn commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

What

The model picker drew one block per model instead of one row. Every selected model expanded its capability switches and its availability check inline, so a service returning six models filled the panel: the model names, the only thing the list is for, were the smallest thing on screen and selecting one pushed the next off the page.

Each model is now one line — checkbox, id, test button, and a disclosure control that opens that row's service capabilities and availability check. Nothing was deleted: the details are the same components, defaulted closed, with per-row open state. Fetch feedback moved into the heading; the availability and capability cards gained a compact form that no longer prints "Not checked" on every row.

Refs #477 — a batch control was reported as missing there. The root cause was that it was plain text in a row nobody looked at, and it was redundant: discovery already selects everything a new service returns. That is now the stated behaviour (one API key normally covers the catalog), the user's own edit is never replaced by a later refresh, and a catalog above the enable limit stays manual instead of becoming unsavable.

Search and bulk selection stay

The compact layout keeps the search box, the "Selected only" filter and a bulk select-all button with a count (for lists above four models). The button uses normal button styling with a border and background, is keyboard focusable, and its label counts only the rows currently visible, so filtering then selecting never touches hidden rows. A later refresh still never replaces a selection the user edited.

Verification

Gate-lane browser tests, run against the isolated fixture (fixture API + Vite on this branch, creation-test-health.isolated === true):

  • new tests/browser/model_select_all.mjs — a 13-model catalog: discovery selects every returned model, the visible search and bulk button select/deselect the current rows, an edited selection survives refresh, clearing every checkbox asks for a selection, one save writes one service with every model enabled, and the same holds in English.
  • capability_discovery.mjs, provider_settings.mjs, zhipu_provider.mjs — updated for the compact rows, all pass.
  • tsc --noEmit clean, npm test 978 pass / 0 fail, check:i18n 3343 keys 0 problems, check:browser-manifest 94 entries OK.

Text models no longer show the draft availability check inside the row: their own Test button sends a real message, which proves more than the probe does. The capability card keeps the text and image-understanding switches.

Evidence

Screenshots come from the isolated browser fixture (creation-test-health.isolated === true), with the Zhipu catalog fixture returning six models. Before is origin/main at 4cd524ce; after is 93495795, the feature tip. 332dc9ad merges origin/main at 322f98c3 to resolve the shard-manifest conflict and does not change the picker; Release checks are green on 332dc9ad.

Before (main) After
zh-CN
en-US —

Before: each selected model takes about 200 px, so two of six fill the editor and push the rest out of view. After: one compact row per model, with the discovery result ("已获取 6 个模型" / "将启用 6 个模型") in the heading.

After, one row expanded

Expanding a row opens that row's capability switches and availability check in place, in one line; the other rows stay closed.

Review follow-up (search/bulk entry + long list)

Restored the search box and bulk selection entry the compact layout had removed; david's review asked for them to stay discoverable on saved connections and manually edited lists:

  • The bulk control is now a regular bordered button with a count (Select all 13 models / 全选 13 个模型), not the muted text from [bug] 模型接入:批量全选控件被渲染成灰色小字,一个 API Key 配置全部模型不可发现 #477. It focuses with the keyboard, and aria-pressed marks the "Selected only" filter.
  • It operates on the visible rows only: filter to 3 models, select those, clear the filter, and the other 10 keep their state.
  • Existing behaviour is unchanged: discovery auto-selects a new service, a refresh after the user edits a selection does not overwrite it.
  • tests/browser/model_select_all.mjs now uses a 13-model catalog and asserts the button's border/background, focusability, count and visible-row scope, the long-list save (one service, 13 enabled models) and the reopened/refreshed service. It fails on the previous tip (toolbar.extra is 0).
  • Playable demo (13-model list → deselect/select → search → save → reopen → refresh keeps the edit): model-picker-long-list.mp4

Verification: tsc --noEmit clean, check:i18n 3865 keys 0 problems, model_select_all.mjs, provider_settings.mjs, capability_discovery.mjs and zhipu_provider.mjs pass at the isolated fixture.

@github-actions github-actions Bot added area:provider Model providers and generation protocols type:feat New capability or behaviour labels Nov 25, 2026
A service that returns six models drew six blocks of switches: each selected row dumped its capability card and its availability check into the list, so the model names — the only thing the list is for — were buried. Selecting one model pushed the next one off the screen.

Every row is now one line: checkbox, name, test button, and a disclosure control that opens that model's service capabilities and availability check for the row being edited. Nothing was removed from the details, only defaulted closed, and each row keeps its own open state. The fetch status moved from a separate status block into the heading, and the availability and capability cards gained a compact form that drops their placeholder line instead of printing "Not checked" on every row.

Discovery now selects every model it returns for a new service, which is what the batch button was for: one API key normally covers the whole catalog. An edited selection is never replaced by a later refresh, and a list above the enable limit stays manual instead of becoming unsavable.

The search box and the bulk row are gone with it. That is the part I would like reviewed rather than assumed: with discovery selecting everything the bulk control only repeated the checkboxes, and the list is short in practice, but a catalog of hundreds of models would now need the search box back. Each is a filterbar-sized addition; say the word and I will restore them.

Refs ThinkFlowLab#477.
@Zhangbo-cn
Zhangbo-cn force-pushed the feat/model-picker-compact branch from 5576be6 to 91c5597 Compare November 25, 2026 03:55
@github-actions github-actions Bot added the area:docs Documentation / 文档 label Nov 25, 2026
@github-actions
github-actions Bot requested a review from wuzhf9 November 25, 2026 03:56
@Zhangbo-cn

Copy link
Copy Markdown
Contributor Author

Conflicts with main are resolved on the current head 332dc9ad. The only conflict was scripts/ci/python_shards.json, whose manual test listing is now superseded by #700's default-core routing. Required Release checks are green on this head: https://github.com/ThinkFlowLab/OpenDirector/actions/runs/47505579471

Internal audit score: 95/100. @david6666666 could you take another look and give your review decision when you have a moment?

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

COMMENT(非表决) 332dc9a Refs #477

下载核对了 4 张图,六个模型确实能压成紧凑行,展开也能保留详细能力。不过 #477 要的是一个明显的批量入口,首次自动选中不能替代已保存连接或手动改过的列表上的批量操作。请至少保留清晰的搜索/批量选择入口,并用长列表验证保存和刷新。当前只有截图,没有覆盖新操作路径的可播放视频。技术结论:需修改。

Ran: 回读同 SHA Release及本 PR 的变更与证据。Not run: 未独立执行 PR 代码或调用真实 provider。

55/100(范围/正确性/验证/主张证据/简洁度:3/2/2/0/3)。
Base 322f98c317322c1ac12541093719c890507b51b0 · Head 332dc9ad5c8321eed06ed4619d601bf7de47d765。

Dot,代表 @david6666666。

Comment thread src/canvas/ModelPicker.tsx Outdated
</div>
) : (
visible.map((id) => (
ids.map((id) => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里直接渲染整份 catalog,同时删除了搜索和批量控件。已有连接刷新不会触发新建时的自动全选,长列表里定位、批量启用又变成逐个点。能保留紧凑行,同时把搜索和明显的批量按钮放回列表头吗?至少补一条已有连接刷出长列表后的用例。

… model picker

Review follow-up for ThinkFlowLab#497 / ThinkFlowLab#477.

The compact rows dropped the search box and the bulk row altogether, which
removed the only batch entry on saved connections and manually edited lists.
Restore both:

- the search box and "Selected only" filter, working on the visible rows;
- a bordered, keyboard-focusable "Select all N models" / "Deselect all"
  button with the count of the current rows, replacing the muted text the
  issue reported as invisible.

The browser journey now uses a 13-model catalog, asserts the button's
border/background/focusability and visible-row scope, saves one service with
every model and reopens it after refresh. It fails on the previous picker
because neither control is rendered.

Co-Authored-By: Claude Code <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentation / 文档 area:provider Model providers and generation protocols type:feat New capability or behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants