Repository navigation
[feat] canvas: keep one compact row per model in the picker - #497
Zhangbo-cn wants to merge 7 commits into
Conversation
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.
5576be6 to
91c5597
Compare
# Conflicts: # src/canvas/ModelCapabilityCard.tsx # src/canvas/model-settings.css
# Conflicts: # scripts/ci/python_shards.json
|
Conflicts with Internal audit score: 95/100. @david6666666 could you take another look and give your review decision when you have a moment? |
david6666666
left a comment
There was a problem hiding this comment.
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。
| </div> | ||
| ) : ( | ||
| visible.map((id) => ( | ||
| ids.map((id) => { |
There was a problem hiding this comment.
这里直接渲染整份 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>
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):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 --noEmitclean,npm test978 pass / 0 fail,check:i18n3343 keys 0 problems,check:browser-manifest94 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 isorigin/mainat4cd524ce; after is93495795, the feature tip.332dc9admergesorigin/mainat322f98c3to resolve the shard-manifest conflict and does not change the picker; Release checks are green on332dc9ad.main)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.
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:
Select all 13 models/全选 13 个模型), not the muted text from [bug] 模型接入:批量全选控件被渲染成灰色小字,一个 API Key 配置全部模型不可发现 #477. It focuses with the keyboard, andaria-pressedmarks the "Selected only" filter.tests/browser/model_select_all.mjsnow 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.extrais 0).Verification:
tsc --noEmitclean,check:i18n3865 keys 0 problems,model_select_all.mjs,provider_settings.mjs,capability_discovery.mjsandzhipu_provider.mjspass at the isolated fixture.