@deepseek-ai/dsh-client-ui-model-selection 0.1.7-alpha.1 → 0.1.7-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/client/ui-model-selection/README.md
5
- README.md: 37253cf04242275f22d646da0e65cfd44f4fefbf
6
- README.zh.md: 4e339e6a6c6db8c3125e6ccc19c0fc3af9947f88
5
+ README.md: 60a1491779cda03daac53cecf3fe1597e6930414
6
+ README.zh.md: b1d297877bfe4f112e07e357f836b4cb06608077
package/README.md CHANGED
@@ -27,6 +27,8 @@ The Web GUI lets users switch the model and reasoning effort for an existing ses
27
27
 
28
28
  Mount this plugin alongside `ui-conversation` and the commands package; the composer then shows the model seat next to the pending indicator, and `/model` opens the same directory as a popup. While the seat's menu is open, `↑`/`↓` move focus across the rows of the shown pane, Tab settles the focused row, and Escape and `Shift+Tab` leave a drilled pane first and otherwise close back to the trigger. Drilling lands on the row of the value in use, and going back lands on the cell that opened the pane left. Both surfaces show the host-reported current selection when the exact provider/model pair remains in the advertised groups; a missing catalog row leaves the routable selection intact while the trigger prompts `Select model`.
29
29
 
30
+ Mouse selection uses native browser clicks, including their cancellation behavior; a press alone never selects. Opening the menu focuses its trigger, and clicking the trigger again closes the menu and returns focus there. While a selection is pending, focus stays on the trigger; a rejected selection leaves the menu open, and Tab returns to the current row.
31
+
30
32
  ### Model and effort
31
33
 
32
34
  Models stay grouped by provider. The composer menu shows model and effort names only. The `/model` popup shows provider names and catalog descriptions; it localizes the two built-in DeepSeek descriptions and leaves external provider descriptions verbatim. The popup applies the selected model's default effort; the composer can then choose any advertised effort. An adapter without reasoning metadata leaves the Effort row absent; there is no arbitrary effort input.
package/README.zh.md CHANGED
@@ -27,6 +27,8 @@ Web GUI 允许用户通过 `/model` 弹窗或 composer 模型控件切换既有
27
27
 
28
28
  与 `ui-conversation` 及命令包一起挂载本插件;composer 随即在待处理指示器旁显示模型位,`/model` 则以弹窗打开同一份目录。模型位菜单打开期间,`↑`/`↓` 在所显示面板的行间移动焦点,`Tab` 选定聚焦行,Escape 与 `Shift+Tab` 先退出已下钻的面板,否则关闭并回到触发器。下钻落在正在使用的那一行,返回则落在打开该面板的格子上。当确切提供方/模型对仍在已公布分组中时,两个界面都显示 Host 报告的当前选择;目录行缺席时,可路由的选择保持不变,触发器提示 `Select model`。
29
29
 
30
+ 鼠标选择沿用浏览器原生点击及其取消行为;仅按下按钮不会选定。打开菜单时聚焦触发按钮,再次点击触发按钮会关闭菜单并把焦点还给它。等待选择结果时,焦点停在触发按钮;选择被拒绝后菜单保持打开,Tab 可回到当前选中的行。
31
+
30
32
  ### 模型与推理强度
31
33
 
32
34
  模型按提供方分组。composer 菜单只显示模型与推理强度名称。`/model` 弹窗显示提供方名称与目录说明;其中两个内置 DeepSeek 模型的说明使用当前语言,外部提供方说明保持原文。弹窗应用所选模型的默认推理强度;composer 随后可以选择任一已公布的推理强度。适配器没有推理元数据时不显示 Effort 行;不存在任意推理强度输入。
package/lib/client.js CHANGED
@@ -581,6 +581,7 @@ window.__ModuleLoader__.load({
581
581
  ]);
582
582
  if (!available) return null;
583
583
  const show = () => {
584
+ triggerRef.current?.focus();
584
585
  setPane("root");
585
586
  setOpen(true);
586
587
  reload();
@@ -656,13 +657,17 @@ window.__ModuleLoader__.load({
656
657
  text: error.code === "session/writer-held" ? t("error.sessionInUse") : t("error.action", { message: `${error.code}: ${error.message}` })
657
658
  });
658
659
  };
660
+ const submit = (selection) => {
661
+ lastActionRef.current = "select";
662
+ triggerRef.current?.focus();
663
+ select(selection).then(settleSelection);
664
+ };
659
665
  const choose = (selection) => {
660
666
  if (state.current?.provider === selection.provider && state.current.model === selection.model) {
661
667
  close(true);
662
668
  return;
663
669
  }
664
- lastActionRef.current = "select";
665
- select(selection).then(settleSelection);
670
+ submit(selection);
666
671
  };
667
672
  const chooseEffort = (effort) => {
668
673
  if (state.current === null) return;
@@ -670,13 +675,11 @@ window.__ModuleLoader__.load({
670
675
  close(true);
671
676
  return;
672
677
  }
673
- const selection = {
678
+ submit({
674
679
  provider: state.current.provider,
675
680
  model: state.current.model,
676
681
  ...effort === void 0 ? {} : { reasoningEffort: effort }
677
- };
678
- lastActionRef.current = "select";
679
- select(selection).then(settleSelection);
682
+ });
680
683
  };
681
684
  const waiting = state.current === null && state.status === "loading";
682
685
  const modelLabel = waiting ? t("trigger.loading") : currentChoice?.model.name ?? (state.current === null ? t("trigger.fallback") : `${state.current.provider}/${state.current.model}`);
@@ -698,6 +701,9 @@ window.__ModuleLoader__.load({
698
701
  className: ModelSelect_module_css_default.root,
699
702
  onKeyDown: onRootKeyDown,
700
703
  onBlur,
704
+ onMouseDown: (event) => {
705
+ if (event.target instanceof Element && event.target.closest("button") !== null) event.preventDefault();
706
+ },
701
707
  children: [
702
708
  (0, react_jsx_runtime.jsxs)("button", {
703
709
  ref: triggerRef,
@@ -710,7 +716,7 @@ window.__ModuleLoader__.load({
710
716
  title: triggerLabel,
711
717
  disabled: locked,
712
718
  onClick: () => {
713
- if (open) close();
719
+ if (open) close(true);
714
720
  else show();
715
721
  },
716
722
  children: [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-client-ui-model-selection",
3
3
  "description": "Model selection over the shared model catalog, Session projection, and session.selectModel",
4
- "version": "0.1.7-alpha.1",
4
+ "version": "0.1.7-rc.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "license": "MIT",
40
40
  "peerDependencies": {
41
- "@deepseek-ai/cordis": "^4.0.3"
41
+ "@deepseek-ai/cordis": "~4.0.4"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/react": "~18.3.1",
@@ -46,22 +46,22 @@
46
46
  "react-dom": "^18.2.0",
47
47
  "@types/react-dom": "~18.3.0",
48
48
  "clsx": "^2.1.1",
49
- "@deepseek-ai/dsh-api-session-controller": "^0.1.7-alpha.1",
50
- "@deepseek-ai/dsh-client-test-runtime": "^0.1.7-alpha.1",
51
- "@deepseek-ai/dsh-client-ui-commands": "^0.1.7-alpha.1",
52
- "@deepseek-ai/dsh-client-ui-conversation": "^0.1.7-alpha.1",
53
- "@deepseek-ai/dsh-client-ui-input-trigger": "^0.1.7-alpha.1",
54
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-alpha.1",
55
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.7-alpha.1",
56
- "@deepseek-ai/dsh-typert-protocol": "^0.1.7-alpha.1",
57
- "@deepseek-ai/cordis": "^4.0.3",
58
- "@deepseek-ai/dsh-client-store": "^0.1.7-alpha.1",
59
- "@deepseek-ai/dsh-api-remotes": "^0.1.7-alpha.1",
60
- "@deepseek-ai/dsh-util-values": "^0.1.7-alpha.1",
61
- "@deepseek-ai/dsh-client-ui-session": "^0.1.7-alpha.1",
62
- "@deepseek-ai/dsh-client-ui-renderer": "^0.1.7-alpha.1",
63
- "@deepseek-ai/dsh-session": "^0.1.7-alpha.1",
64
- "@deepseek-ai/dsh-client-locale": "^0.1.7-alpha.1"
49
+ "@deepseek-ai/dsh-api-session-controller": "0.1.7-rc.1",
50
+ "@deepseek-ai/dsh-client-locale": "0.1.7-rc.1",
51
+ "@deepseek-ai/dsh-client-test-runtime": "0.1.7-rc.1",
52
+ "@deepseek-ai/dsh-client-ui-commands": "0.1.7-rc.1",
53
+ "@deepseek-ai/dsh-client-ui-conversation": "0.1.7-rc.1",
54
+ "@deepseek-ai/dsh-api-remotes": "0.1.7-rc.1",
55
+ "@deepseek-ai/dsh-client-ui-input-trigger": "0.1.7-rc.1",
56
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.7-rc.1",
57
+ "@deepseek-ai/dsh-typert-protocol": "0.1.7-rc.1",
58
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.7-rc.1",
59
+ "@deepseek-ai/cordis": "~4.0.4",
60
+ "@deepseek-ai/dsh-client-store": "0.1.7-rc.1",
61
+ "@deepseek-ai/dsh-util-values": "0.1.7-rc.1",
62
+ "@deepseek-ai/dsh-client-ui-renderer": "0.1.7-rc.1",
63
+ "@deepseek-ai/dsh-client-ui-session": "0.1.7-rc.1",
64
+ "@deepseek-ai/dsh-session": "0.1.7-rc.1"
65
65
  },
66
66
  "files": [
67
67
  "lib/index.js",