dsh-enhance 0.3.6 → 0.3.7

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.md CHANGED
@@ -17,8 +17,9 @@ DeepSeek Harness(DSH)增强插件:Markdown 主题统一、划词批注、
17
17
  - **文件右键菜单** — 在对话消息里的文件链接(含行内代码形式的文件引用)上右键,弹出跟随深浅主题的菜单:用默认应用打开、打开方式(列出系统为该登记的应用)、另存为、复制路径、复制文件内容、在 Finder 中显示。打开/打开方式/Finder 定位走宿主 `ctx.remote.session.openWorkspacePath`,应用清单走 `workspacePathApplications`,读取内容走鉴权路由 `GET /api/file?path=`。路径取文件链接的 `title`,相对路径按当前会话 `cwd` 补全;另存为从 `/api/file` 取得字节后优先调用 `showSaveFilePicker`,不支持时退化为浏览器下载(DSH 未提供原生保存对话框)。
18
18
  - **网页链接右键菜单** — 在对话消息里的普通 HTTP(S) 链接上右键,弹出「打开方式」菜单:新标签页、新窗口、默认浏览器、复制链接、链接另存为…。新标签页优先打开宿主内置浏览器页签(`ctx.sidebarRight.openTab('browser', { url })`,未启用该页签时回退到新窗口);新窗口用浏览器弹窗;默认浏览器交给系统(桌面端主窗口把 `window.open` 的 http(s) 交给系统浏览器);链接另存为通过 `fetch` 取数据后以 `download` 下载,受跨域限制时提示无法下载。两个菜单都只在会话正文内拦截右键,其它位置保留宿主原生菜单;点击别处、滚动、Esc、失焦、窗口缩放都会关闭它。
19
19
  - **侧栏更窄** — 侧栏可拖到 214px(上游限制 264px),文字相应缩小一档;文件夹图标换成展开/收起三角,文件夹标题与会话标题同字号、左端对齐。
20
- - **面板图标置顶** — Plugins / 自动化等面板图标移到侧栏顶部、工作区列表之上,并排成一行;每行最多 5 个,超出换行。上游是带文字的竖排列表,此前本插件把它放在右下角。只改位置与排版,宿主的选中态、悬停态和那个「更多」菜单都照旧。
21
- - **插件图标也置顶** — 新装的插件如果把图标注册到侧栏底部(`sidebar.footer.action`,比如「远程访问」的电话图标),它的按钮会被搬进同一行顶部列表,同样按 5 个一行、超出换行。搬的是宿主自己的容器而不是插件的按钮,所以插件自己的选中态、悬停态和弹层都照常工作;折叠成图标轨时交回宿主布局。
20
+ - **面板图标置顶** — Plugins / 自动化等面板图标移到侧栏顶部、工作区列表之上,并排成一行;一行放几个由侧栏宽度决定,放不下就换行。上游是带文字的竖排列表,此前本插件把它放在右下角。只改位置与排版,宿主的选中态、悬停态和那个「更多」菜单都照旧。
21
+ - **插件图标也置顶** — 新装的插件如果把图标注册到侧栏底部(`sidebar.footer.action`,比如「远程访问」的电话图标),它的按钮会被搬进同一行顶部列表,跟着侧栏宽度一起换行。搬的是宿主自己的容器而不是插件的按钮,所以插件自己的选中态、悬停态和弹层都照常工作;折叠成图标轨时交回宿主布局。
22
+ - **这一行只显示图标** — 顶部图标行里的每个按钮只留图标,文字一律不显示:宿主面板的标题本来就已隐藏,插件自己带进这一行的标签(比如「远程访问」那个图标旁边的「Remote」)也被去掉——标签按形状识别(这一段里没有图标的内容就是文字),不写死插件的类名。按钮的 `title`/`aria-label` 原样保留,悬停和读屏仍能认出是哪个插件;插件若在同一个插槽里放了纯文字按钮(如「退出」),它保持可读、可点,不会被压成空白方块。
22
23
  - **启动即最窄** — 首次启动侧栏直接是 214px(上游每次加载都回到 280px),之后按你上次拖到的宽度打开。折叠/展开不会丢掉这个宽度。
23
24
  - **窗口铺满屏幕** — 首次启动主窗口铺满可用区域(菜单栏与 Dock 保留,等同绿色按钮的缩放);之后按上次关闭时的窗口位置与大小重新打开。保存的窗口若超出当前显示器(换屏、改分辨率)会被拉回可见区域。
24
25
  - **运行中彩色转圈** — 侧栏里正在运行的会话,状态环不再是宿主那样的灰色,而是一圈彩色:蓝→紫→洋红→琥珀的 4 秒色相循环,浅色与深色主题下都清晰。环的转动与虚线段仍由宿主驱动,本插件只改颜色;其他位置的状态点(任务、审批、工作流)保持原样。
@@ -33,9 +34,9 @@ DSH 打开 **Plugins** 页面 → 添加插件 → 输入 `dsh-enhance` → 安
33
34
  ### 方式二:本地 tar 包
34
35
 
35
36
  ```bash
36
- # 从 Releases 下载 dsh-enhance-0.3.4.tgz 后
37
+ # 从 Releases 下载 dsh-enhance-0.3.7.tgz 后
37
38
  cd ~/.dsh/profiles/desktop
38
- npx pnpm@11.28.5 add "file:/绝对路径/dsh-enhance-0.3.4.tgz"
39
+ npx pnpm@11.28.5 add "file:/绝对路径/dsh-enhance-0.3.7.tgz"
39
40
  ```
40
41
 
41
42
  再编辑 `~/.dsh/profiles/desktop/package.json`,把 `dsh-enhance` 加入 `dsh.profile.bundles`:
package/lib/client.js CHANGED
@@ -726,9 +726,10 @@ body[data-ds-dark-theme] [class*="sidebarCol"] {
726
726
  * The row is kept — upstream stacks these icons in a column, which costs one
727
727
  * row per shortcut at the top of the tree.
728
728
  *
729
- * Five per line, wrapping beyond that. The count is enforced by max-width
730
- * rather than by the sidebar's own width: five 36px buttons and four 2px gaps
731
- * are 188px, so a wider sidebar cannot fit a sixth on the first line.
729
+ * How many fit on a line follows the sidebar's own width: the row takes the
730
+ * full content width and the wrap does the counting, so a wider sidebar shows
731
+ * more icons on the first line and the narrowest one (214px) still fits five
732
+ * 36px buttons and four 2px gaps.
732
733
  *
733
734
  * Scope excludes the collapsed rail: there the column is the app's 56px icon
734
735
  * strip (0px on macOS), a row of 36px buttons cannot fit it, and the host's own
@@ -742,7 +743,8 @@ body[data-ds-dark-theme] [class*="sidebarCol"] {
742
743
  justify-content: flex-start !important;
743
744
  gap: 2px !important;
744
745
  margin: 0 0 6px 0 !important;
745
- max-width: calc(36px * 5 + 2px * 4) !important;
746
+ width: 100% !important;
747
+ max-width: 100% !important;
746
748
  }
747
749
 
748
750
  [class*="sidebarCol"] [class*="panelList"] [class*="panelTitle"] { display: none !important; }
@@ -780,8 +782,17 @@ body[data-ds-dark-theme] [class*="sidebarCol"] {
780
782
  * trigger into an icon+label pill that fills that row's width, which means
781
783
  * justify-content:flex-start and a gap. In a 36px square that reads as an icon
782
784
  * glued to the left edge, so the box model is normalised here: centred, no
783
- * gap, no padding, one icon size for the whole row. */
784
- [class*="sidebarCol"] [class*="panelList"] > [data-dsh-enhance-entries] button {
785
+ * gap, no padding, one icon size for the whole row.
786
+ *
787
+ * Only a trigger that carries an icon is normalised: a plugin may also put a
788
+ * text-only control in the same slot (the Remote plugin's Exit link), and
789
+ * squeezing that into a 36px square would clip the word instead of showing it.
790
+ *
791
+ * The font size goes to zero as well: a trigger that puts bare text next to
792
+ * its icon (no element around it) has no box to hide, and the text would
793
+ * otherwise spill out of the square. The icon keeps its own size — the sheet
794
+ * pins the svg to 16px below, in pixels, not in em. */
795
+ [class*="sidebarCol"] [class*="panelList"] > [data-dsh-enhance-entries] button:has(svg, img) {
785
796
  flex: none !important;
786
797
  display: inline-flex !important;
787
798
  justify-content: center !important;
@@ -792,12 +803,29 @@ body[data-ds-dark-theme] [class*="sidebarCol"] {
792
803
  margin: 0 !important;
793
804
  padding: 0 !important;
794
805
  border-radius: 12px !important;
806
+ font-size: 0 !important;
795
807
  }
796
808
  [class*="sidebarCol"] [class*="panelList"] > [data-dsh-enhance-entries] button svg {
797
809
  flex: none !important;
798
810
  width: 16px !important;
799
811
  height: 16px !important;
800
812
  }
813
+ /* The row is a strip of glyphs: every entry shows its icon and nothing else.
814
+ *
815
+ * A plugin that joins the row brings its footer markup with it, and that
816
+ * markup is written for a wide footer row — the Remote plugin's entry is an
817
+ * icon+label pill, so in the 36px square its label spilled out as a clipped
818
+ * "R…". The label is dropped by shape rather than by name, because the markup
819
+ * is the plugin's own: inside the relocated container an element that carries
820
+ * no icon is text. The has() selector keeps an icon wrapper (a span around an
821
+ * svg) alive, and the empty check keeps the plugin's own badge dots.
822
+ *
823
+ * The trigger keeps its title and aria-label, so the icon still names the
824
+ * plugin on hover and to a screen reader; only the visible text goes.
825
+ */
826
+ [class*="sidebarCol"] [class*="panelList"] > [data-dsh-enhance-entries] :where(span, label, p, div):not(:empty):not(:has(svg)):not(:has(img)) {
827
+ display: none !important;
828
+ }
801
829
  /* The rail keeps the host's own treatment: the footer action block is hidden
802
830
  there exactly as the host hides it, so the strip keeps only the app's icons. */
803
831
  [class*="sidebarCol"] [class*="_root"][class*="collapsed"] [data-dsh-enhance-entries] {
@@ -2148,8 +2176,9 @@ body[data-ds-dark-theme] .dsh-enhance-edit {
2148
2176
  * parents, and no amount of `order` moves a node into a sibling container. So
2149
2177
  * this module moves the footer's action container into the panel nav once the
2150
2178
  * shell exists, and the stylesheet dissolves it (`display: contents`) so its
2151
- * buttons join the row the nav lays out. Five per line, wrapping beyond that:
2152
- * the nav's own max-width does the counting (see sidebar-layout.css).
2179
+ * buttons join the row the nav lays out. How many sit on one line follows the
2180
+ * sidebar's width: the row spans the content width and wraps by itself (see
2181
+ * sidebar-layout.css).
2153
2182
  *
2154
2183
  * The relocated element is the *container* the host owns, not the entries a
2155
2184
  * plugin renders. React updates those entries inside it and removes them from
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-enhance",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "DeepSeek Harness enhancements: Markdown theme for every renderer, select-text annotations with pins, a file right-click menu, a narrower sidebar, and startup defaults (maximized window, narrowest sidebar, colourful running marker). 中文:DSH 增强插件——Markdown 主题、划词批注、文件右键菜单、侧栏宽度、启动默认状态。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",