dsh-model-doctor 0.5.4 → 0.5.5

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.
@@ -79,8 +79,9 @@ window.__ModuleLoader__.load({
79
79
  .dmd-chip.is-ok{color:#2fa96e;background:color-mix(in srgb,#2fa96e 16%,transparent)}
80
80
  .dmd-chip.is-bad{color:#e5484d;background:color-mix(in srgb,#e5484d 14%,transparent)}
81
81
  .dmd-chip.is-warn{color:#d08700;background:color-mix(in srgb,#d08700 16%,transparent)}
82
- /* max-width 是关键:官方菜单是 width:max-content,状态条文字不能把菜单撑宽 */
83
- .dmd-allbar{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;padding:6px 10px;margin:2px 4px;font-size:11px;border-radius:8px;background:color-mix(in srgb,currentColor 6%,transparent);max-width:208px}
82
+ /* 关键:官方菜单是 width:max-content,状态条文字绝不能参与菜单的固有宽度计算。
83
+ width:0 + min-width:100% → 对菜单的宽度贡献为 0,但实际占满整行,不再留右侧空白。 */
84
+ .dmd-allbar{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;padding:6px 10px;margin:2px 0;font-size:11px;border-radius:8px;background:color-mix(in srgb,currentColor 6%,transparent);box-sizing:border-box;width:0;min-width:100%;max-width:100%}
84
85
  .dmd-allbar button{font:inherit;font-size:11px;line-height:16px;padding:2px 9px;border-radius:6px;border:1px solid color-mix(in srgb,currentColor 25%,transparent);background:transparent;color:inherit;cursor:pointer;flex:none}
85
86
  .dmd-allbar button:disabled,.dmd-allbar button.is-busy{opacity:.45;cursor:default}
86
87
  .dmd-allbar .dmd-status,.dmd-allbar .dmd-balance{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@@ -781,6 +782,14 @@ window.__ModuleLoader__.load({
781
782
  if (hint) status.textContent = hint
782
783
  if (before !== null && before.parentNode === host) host.insertBefore(bar, before)
783
784
  else host.insertBefore(bar, host.firstChild)
785
+ // 保险:状态条靠「width:0 + min-width:100%」占满整行且不参与菜单的固有宽度计算。
786
+ // 万一该技巧在某引擎上没生效,条形会塌成 0 宽 —— 这里实测一次,退化成像素宽度。
787
+ window.requestAnimationFrame(() => {
788
+ if (disposed || !bar.isConnected) return
789
+ const hostWidth = host.clientWidth
790
+ if (hostWidth <= 40) return
791
+ if (bar.getBoundingClientRect().width < hostWidth * 0.5) bar.style.width = `${hostWidth}px`
792
+ })
784
793
  }
785
794
 
786
795
  function providerLabel(providerId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-model-doctor",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "模型医生:在对话输入区的模型选择菜单里,为每个模型选项追加「连通检测」与「删除」按钮——直接适配 DSH 官方模型菜单(按官方 DOM 契约精确定位,不依赖任何菜单渲染插件),检测直连各网关探测连通性/欠费/额度,删除直接从 llm-pi-ai 配置移除模型(自动备份配置文档)。",
5
5
  "keywords": [
6
6
  "deepseek",