dsh-file-activity 0.5.5 → 0.5.6
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/CHANGELOG.md +8 -0
- package/README.md +4 -2
- package/assets/preview-float-0.5.6.png +0 -0
- package/lib/client.js +13 -1
- package/lib/parts/apply.part.js +3 -0
- package/lib/parts/styles.part.js +10 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
本文件记录 dsh-file-activity 的所有版本变更。格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
4
4
|
|
|
5
|
+
## [0.5.6] - 2026-09-04
|
|
6
|
+
|
|
7
|
+
### 变更
|
|
8
|
+
|
|
9
|
+
- chore(release): dsh-file-activity v0.5.6(#111 浮窗预览 + 验证清单)
|
|
10
|
+
- fix(file-activity): #111 HTML 预览内容撑满浮窗 (#116)
|
|
11
|
+
- docs: #106 安装命令统一加 --trust-lockfile (#113)
|
|
12
|
+
|
|
5
13
|
## [0.5.5] - 2026-09-02
|
|
6
14
|
|
|
7
15
|
### 变更
|
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
<img alt="文件活动插件截图(最近访问 / 文件统计)" src="https://unpkg.com/dsh-file-activity/assets/screenshot.png" width="340" />
|
|
7
7
|
<br />
|
|
8
8
|
<img alt="浮窗预览:点击文件复用侧边栏内置 Markdown 渲染" src="https://unpkg.com/dsh-file-activity/assets/preview-float.png" width="340" />
|
|
9
|
+
<br />
|
|
10
|
+
<img alt="浮窗 HTML 预览:内容撑满整个浮窗主体(issue #111)" src="https://unpkg.com/dsh-file-activity/assets/preview-float-0.5.6.png" width="340" />
|
|
9
11
|
</div>
|
|
10
12
|
|
|
11
13
|
**DSH 侧边栏文件活动插件**(基于 [dsh-better-sidebar](https://github.com/omdsh-dev/DSH-better-sidebar) 扩展):在 better-sidebar 中新增「文件活动」页签,记录 agent 工具与侧边栏自身的文件读取/新增/修改事件,提供**最近访问**(LRU)与**文件统计**(树形目录)两块视图,点击文件弹出浮窗预览。
|
|
@@ -36,7 +38,7 @@
|
|
|
36
38
|
|
|
37
39
|
## 安装
|
|
38
40
|
|
|
39
|
-
> 💡 **npm 安装(普通用户推荐)**:`dsh plugin --profile web add dsh-file-activity`——无需克隆本仓库;依赖自动级联安装:`dsh-better-sidebar`(宿主,提供侧边栏扩展点)与 `dsh-shared`(server 端共享工具包)均声明为 dependencies,安装时自动安装并加入 profile bundles,无需手动单独处理。
|
|
41
|
+
> 💡 **npm 安装(普通用户推荐)**:`dsh plugin --profile web add dsh-file-activity --trust-lockfile`——无需克隆本仓库;依赖自动级联安装:`dsh-better-sidebar`(宿主,提供侧边栏扩展点)与 `dsh-shared`(server 端共享工具包)均声明为 dependencies,安装时自动安装并加入 profile bundles,无需手动单独处理。
|
|
40
42
|
|
|
41
43
|
```sh
|
|
42
44
|
# 方式一:dsh plugin(推荐)
|
|
@@ -73,7 +75,7 @@ dsh plugin --profile web add link:<仓库路径>/plugins/dsh-file-activity
|
|
|
73
75
|
- **Markdown**(`.md` / `.markdown`):渲染后的富文本预览,可切换 预览/编辑 模式。
|
|
74
76
|
- **图片**(png / jpg / jpeg / gif / webp / svg / bmp / ico / avif):通过媒体路由渲染。
|
|
75
77
|
- **PDF**:浏览器原生 PDF 查看器(浮窗内嵌,工具栏提供下载)。
|
|
76
|
-
- **HTML
|
|
78
|
+
- **HTML**:沙箱化渲染预览,内容**撑满整个浮窗主体**(iframe 随浮窗尺寸自适应、内部滚动,与代码/Markdown/图片预览体验一致,issue #111)。
|
|
77
79
|
- 其余文件按内置 viewer 的 `matchFileViewer` 回退匹配(如 `binary-download` 下载未知二进制)。
|
|
78
80
|
|
|
79
81
|
> 💡 **工作区外文件也能预览**:文件活动记录的是 agent 实际触碰过的文件,路径可能在会话工作区之外(如 `/tmp` 临时文件)。侧边栏自带的媒体路由只允许工作区内文件,因此图片/PDF 的字节由插件自身的 `/file-activity/file` 路由提供——它按会话记录授权(只放行本会话记录过的路径,未记录的路径一律 403),fence 与侧边栏一致。Markdown/代码/HTML 文本则仍走侧边栏 `fs.read`(不被工作区限制)。
|
|
Binary file
|
package/lib/client.js
CHANGED
|
@@ -780,7 +780,16 @@ const STYLES = `
|
|
|
780
780
|
.dfa-fp-title { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:var(--dsw-font-s-strong-14); color:var(--dsw-alias-label-primary); }
|
|
781
781
|
.dfa-fp-hint { flex:none; font:var(--dsw-font-xxs-12); color:var(--dsw-alias-label-tertiary); opacity:0.8; }
|
|
782
782
|
.dfa-fp-actions { display:flex; align-items:center; gap:2px; flex:none; }
|
|
783
|
-
|
|
783
|
+
/* issue #111: the preview body is a FLEX COLUMN so the mounted viewer
|
|
784
|
+
component (better-sidebar's TextEditor for html/code/markdown, the image
|
|
785
|
+
wrap, and the pdf frame) actually fills the window. Their roots size via
|
|
786
|
+
flex:1 (html iframe .editorHtml, .editorCm, .editorMd, .editorImageWrap,
|
|
787
|
+
.dfa-pdf), which is IGNORED in a block context — so the HTML iframe, which
|
|
788
|
+
otherwise has a fixed browser-default height, rendered as a thin top strip
|
|
789
|
+
with the rest of the window dark. Making the body a flex column lets every
|
|
790
|
+
viewer's flex:1 child stretch to the full .dfa-fp-body height and scroll
|
|
791
|
+
internally, so content fills the window and follows window resizes. */
|
|
792
|
+
.dfa-fp-body { flex:1; display:flex; flex-direction:column; overflow:auto; padding:10px 12px; min-height:0; }
|
|
784
793
|
.dfa-fp-note { color:var(--dsw-alias-label-tertiary); font:var(--dsw-font-xxs-12); }
|
|
785
794
|
.dfa-fp-err { color:var(--dsw-alias-state-error-primary); font:var(--dsw-font-xxs-12); white-space:pre-wrap; word-break:break-all; }
|
|
786
795
|
/* PDF preview: a native browser PDF frame filled from the plugin's own media
|
|
@@ -1574,6 +1583,9 @@ exports.__test = {
|
|
|
1574
1583
|
isInsideFloating,
|
|
1575
1584
|
closePreviewOnHidden,
|
|
1576
1585
|
AUTO_CLOSE_MS,
|
|
1586
|
+
// Static stylesheet text, so the render-path suite can assert the floating
|
|
1587
|
+
// preview body keeps its flex-fill container (issue #111).
|
|
1588
|
+
STYLES,
|
|
1577
1589
|
}
|
|
1578
1590
|
|
|
1579
1591
|
|
package/lib/parts/apply.part.js
CHANGED
package/lib/parts/styles.part.js
CHANGED
|
@@ -64,7 +64,16 @@ const STYLES = `
|
|
|
64
64
|
.dfa-fp-title { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:var(--dsw-font-s-strong-14); color:var(--dsw-alias-label-primary); }
|
|
65
65
|
.dfa-fp-hint { flex:none; font:var(--dsw-font-xxs-12); color:var(--dsw-alias-label-tertiary); opacity:0.8; }
|
|
66
66
|
.dfa-fp-actions { display:flex; align-items:center; gap:2px; flex:none; }
|
|
67
|
-
|
|
67
|
+
/* issue #111: the preview body is a FLEX COLUMN so the mounted viewer
|
|
68
|
+
component (better-sidebar's TextEditor for html/code/markdown, the image
|
|
69
|
+
wrap, and the pdf frame) actually fills the window. Their roots size via
|
|
70
|
+
flex:1 (html iframe .editorHtml, .editorCm, .editorMd, .editorImageWrap,
|
|
71
|
+
.dfa-pdf), which is IGNORED in a block context — so the HTML iframe, which
|
|
72
|
+
otherwise has a fixed browser-default height, rendered as a thin top strip
|
|
73
|
+
with the rest of the window dark. Making the body a flex column lets every
|
|
74
|
+
viewer's flex:1 child stretch to the full .dfa-fp-body height and scroll
|
|
75
|
+
internally, so content fills the window and follows window resizes. */
|
|
76
|
+
.dfa-fp-body { flex:1; display:flex; flex-direction:column; overflow:auto; padding:10px 12px; min-height:0; }
|
|
68
77
|
.dfa-fp-note { color:var(--dsw-alias-label-tertiary); font:var(--dsw-font-xxs-12); }
|
|
69
78
|
.dfa-fp-err { color:var(--dsw-alias-state-error-primary); font:var(--dsw-font-xxs-12); white-space:pre-wrap; word-break:break-all; }
|
|
70
79
|
/* PDF preview: a native browser PDF frame filled from the plugin's own media
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-file-activity",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "DSH 侧边栏文件活动插件:按 LRU 记录文件读取/新增/修改事件(最近访问),按绝对路径树形统计(文件统计),点击文件浮窗预览(代码高亮/Markdown/图片/PDF)。DSH web plugin: file activity tracker — LRU recent-access list plus per-file read/create/modify counts in a folder tree, with floating preview.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|