Skip to content

Releases: loyalchiiina/dsh-model-fold

v0.5.1

Choose a tag to compare

@loyalchiiina loyalchiiina released this 21 Oct 08:20

v0.5.1:与 npm 同版本发布(GitHub 源码 + npm 包 + 本 Release 三处对齐)。

v0.5.0 - 悬浮模式 + 菜单内设置条

Choose a tag to compare

@loyalchiiina loyalchiiina released this 08 Oct 17:59

新增 / Added

  • 悬浮模式(新默认):鼠标划过来源标题即从右侧滑出该来源的模型,移开自动收起(延迟 260ms,避免掠过间隙时闪烁)。无需点击即可选模型。
    • 同一产品线此前需单击来源才滑出;现在「悬停」成为默认交互。
    • 三模式循环:悬浮 → 面板 → 列表,双击任意来源标题切换。
  • 菜单内设置条:菜单底部新增一行按钮,可直接切模式(悬浮 / 面板 / 列表)与调字号(10 / 11 / 12 / 13)。
    • position:sticky;bottom:0 —— 菜单滚动时始终可见。
    • 字号写入 documentElement 的 --mf-fs,菜单与侧边面板同步生效,选择持久化。
    • 按钮的 mousedown / click 均 stopPropagation,不会触发宿主的「点击外部关闭」。
  • 用法提示行:菜单顶部显示小字 双击来源标题可切换展开方式(当前:悬浮展开),降低新用户上手门槛。
  • 模式默认值迁移:老用户 localStorage 里若存着旧默认值 panel(非主动选择),一次性迁移到 hover;迁移后若用户再次显式选择 panel,则尊重其选择(迁移标记保证只做一次)。

修复 / Fixed

  • 🔴 来源标题(分组标题)的全部自定义样式从未生效。
    • 根因:内核 MenuGroup 渲染的 section[role="group"] 第一个子元素是 span[data-menu-group-start],而插件 CSS 一直用 section[role="group"] > div:first-child(要求首个子元素是 div)定位标题 —— 选择器永不匹配。
    • 影响面:折叠箭头 ▾/▸、悬停高亮、「当前来源」品牌色高亮与徽标(当前·模型名)等 10 条 CSS 规则全部失效;用户因此长期看不到「当前用的是哪个来源下的哪个模型」。
    • 修法:改用内核显式提供的属性钩子 [data-menu-group-heading](CSS 10 处 + JS 兜底查找 4 处),比任何位置选择器都稳定。
  • 字号切换「时好时坏」
    • 根因:paneSignature() 把菜单每个子节点的 index + tagName + className 拼进签名,用于判断菜单视图是否切换。设置的按钮每次重建会改变签名 → 被误判为「pane 切换」→ resetView() 清掉自建 DOM → 按钮事件与状态丢失。
    • 修法三条:① 签名计算排除插件自建节点(提示条 / 设置条);② 设置条改为幂等更新,只在首次创建按钮,之后仅刷新高亮,不再增删节点;③ 字号点击只调 syncConfigBar()(只改 data-on),不再触发 resetMenuGroups / enhance。
  • 字号整体调小:正文 15px → 11px、行高 22px → 16px、条目高 38px → 32px → 28px、箭头 12px → 10px(并接入 --mf-fs 变量,由设置条控制)。

文档 / Docs

  • README 重写「三种模式」章节,配 docs/images/mode-hover.png(悬浮模式)与 docs/images/mode-list.png(列表模式)两张效果图。
  • package.json 描述同步更新为「悬停滑出 + 面板内切换模式与字号」。

All notable changes to this project are documented in this file.

v0.4.8 - official DSH compatibility declarations

Choose a tag to compare

@loyalchiiina loyalchiiina released this 08 Oct 05:05

Release v0.4.8 of dsh-model-fold.

No functional change. This release corrects the compatibility declarations to
match the official DSH plugin spec:

  • Declares the official DSH peer requirements in peerDependencies and
    devDependencies: @deepseek-ai/cordis ^4.0.2, @deepseek-ai/dsh
    >=0.1.7-rc.1. The kernel checks peer dependencies, not engines.dsh.
  • Corrects engines.dsh from a client/shell version to the kernel version.
    ^0.1.7 does not match the pre-release kernel 0.1.7-rc.2, so the range
    uses an explicit pre-release lower bound.

The attached tarball is the prebuilt package, identical to the one published to
npm as dsh-model-fold@0.4.8 (same integrity:
sha512-pMCVFbofmPq3x2E3RskIpPaH2JkrS08xoRFqrrlL8RAJjNHXw9VgtWdzgm+/p01AEZrPrAZEh8cs460xMATBcQ==).

Install:

dsh plugin --profile web add dsh-model-fold

v0.4.7 - fix panel flicker / dead click / transparent panel

Choose a tag to compare

@loyalchiiina loyalchiiina released this 27 Sep 07:01

v0.4.7

Fixes three defects that all came from coupling with the host component's own behaviour, and unifies the styling of both menu levels.

Fixed

  • Side panel flickered and vanished. Collapsing a provider hides its real model buttons with display:none, but the host focuses the currently selected model button when the model list opens. Hiding the focused element forces a blur with relatedTarget = null, and the host's root onBlur then closes the whole menu. The plugin now moves focus back to the menu trigger before hiding anything.
  • Clicking a provider did nothing. Handlers were bound to the React-managed heading, which React replaces on re-render, so the handler sat on a detached node. All interaction now goes through one capture-phase delegate on document.
  • Panel was transparent with unreadable text. The host menu's real background comes from --dsw-specific-menu, whose value is an 8-digit hex such as #43454a73 (alpha approx 45%). parseColor now handles 8-digit hex, and the translucent surface colour is composited over the ancestor colour to yield an equivalent opaque colour.

Changed

  • Provider list and model subset share identical typography and metrics (15px / weight 600 / line-height 22px, 38px rows, 8px 10px padding) and the same colour tokens.
  • Selection check mark enlarged to 16px, bold, brand colour; selected row gains a brand-coloured left bar.
  • Singleton guard: dispose() removes every listener and timer, and a new instance tears down the previous one first.
  • All temporary diagnostic instrumentation removed.

Compatibility

  • DSH kernel 2.0.15-next
  • Official @deepseek-ai/dsh-client-ui-model-selection 0.1.7-rc.2

See the README sections "Compatibility" and "How it works" for details.