@ryuu-64/dsh-find-all 0.1.6 → 0.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.7
4
+
5
+ - Use the host-native icon button for the conversation search entry, including theme, hover and keyboard-focus styles.
6
+ - Clarify that search covers loaded conversation content and can continue loading available earlier history; status text no longer implies complete history when the host cannot provide it.
7
+ - Retain the current match during history loading when its identity can still be verified.
8
+
9
+ The runtime code is unchanged from the accepted PR #17 merge (`f945fb9ccd581c808bc7f50128c3a7d7d2fca6da`). The existing 195 checks, release-artifact verification and RC2 Web acceptance passed; the user also confirmed their real-device test passed before this release. The exact supported host-version list is unchanged.
10
+
3
11
  ## 0.1.6
4
12
 
5
13
  Fix text matching, history feedback and search state after the 0.1.5 compatibility release.
package/README.md CHANGED
@@ -13,8 +13,9 @@ DSH 桌面窗口是 Electron 壳,本身没有浏览器那种查找栏。而会
13
13
  ## 功能
14
14
 
15
15
  - **⌘F / Ctrl+F** 唤起查找栏,优先带入有效的选中文字;没有新选词时恢复上次关键词。关键词仅保留在当前插件实例内存中,禁用、刷新或重启后清空
16
- - **范围切换**:`整段`(默认)↔ `本页`,点那个胶囊按钮切换
17
- - **边搜边加载**:整段模式下自动分页加载历史,高亮与计数随加载实时更新
16
+ - **范围切换**:`包含更早内容`(默认)↔ `已加载内容`,点那个胶囊按钮切换
17
+ - **已加载内容**:只搜索当前会话中已经加载到页面的内容,包括滚动区域外的内容;不会继续加载历史,也不会移除先前已经加载的内容
18
+ - **边搜边加载**:“包含更早内容”模式下自动分页加载历史,高亮与计数随加载实时更新
18
19
  - **进度可见**:显示「正在加载更早的历史… 已 3 页」,**点一下这段文字即可停止加载**
19
20
  - **安全上限**:最多加载 400 页(约 2 万条消息);历史不再增长时会自行停止
20
21
  - **导航**:Enter / Shift+Enter 上下一个;⌘G(Ctrl+G)/ F3 下一个,加 Shift 反向;Esc 关闭查找栏并清除高亮
@@ -54,7 +55,7 @@ dsh plugin --profile desktop remove dsh-find-bar
54
55
  | 打开查找栏 | `⌘F` / `Ctrl+F` |
55
56
  | 下一个 / 上一个命中 | `Enter` / `Shift+Enter` |
56
57
  | 下一个 / 上一个命中(另一套) | `⌘G`(`Ctrl+G`)/ `F3`,加 `Shift` 反向 |
57
- | 切换范围 `整段` ↔ `本页` | 点查找栏上的胶囊按钮 |
58
+ | 切换范围 `包含更早内容` ↔ `已加载内容` | 点查找栏上的胶囊按钮 |
58
59
  | 停止加载更早的历史 | 点「正在加载更早的历史…」那行文字 |
59
60
  | 关闭并清除高亮 | `Esc` |
60
61
 
@@ -63,9 +64,9 @@ dsh plugin --profile desktop remove dsh-find-bar
63
64
  ## 已知限制
64
65
 
65
66
  - 大小写不敏感,没有「区分大小写」开关
66
- - 单次搜索最多记 5000 个命中
67
+ - 单次搜索仅显示前 5000 处匹配
67
68
  - 折叠起来的工具调用和思考块,正文不在页面里,搜不到——先展开再搜
68
- - 整段模式要真的翻历史,所以很长的会话首次搜索需要等几秒
69
+ - “包含更早内容”模式要真的翻历史,所以很长的会话首次搜索需要等几秒
69
70
  - 宿主尚未就绪、公开报错、无进展或到达上限时,保留已找到的结果并提示未完成;再次打开查找或输入关键词可手动重试。停止、关闭、换词或切换会话会取消插件任务,但不会中断宿主已经发出的请求
70
71
  - “已搜索当前可用历史”不保证历史完整。宿主可能在正常末页和不连续页错误时都不再提供更早页;此时重新查找也不保证恢复缺失历史
71
72
 
@@ -82,7 +83,7 @@ dsh plugin --profile desktop add dsh-find-bar # 想换回上游那
82
83
 
83
84
  ## 关于这个项目
84
85
 
85
- 本插件 fork 自 [secyborg/dsh-find-bar](https://github.com/secyborg/dsh-find-bar)(作者 secyborg,MIT),在上游的基础上加了「整段会话」搜索。上游原有的查找条界面、高亮、`n/N` 计数和键盘导航都保留了下来。
86
+ 本插件 fork 自 [secyborg/dsh-find-bar](https://github.com/secyborg/dsh-find-bar)(作者 secyborg,MIT),在上游的基础上加了自动加载更早内容的会话搜索。上游原有的查找条界面、高亮、`n/N` 计数和键盘导航都保留了下来。
86
87
 
87
88
  版权与许可为 MIT 双署名:`Copyright (c) 2026 secyborg` 与 `Copyright (c) 2026 Ryuu-64`。上游 README 原样保存在 `README.fork-origin.md`,改动清单与致谢见 `NOTICE.md`。
88
89
 
package/lib/client.js CHANGED
@@ -17,7 +17,7 @@
17
17
  // nothing, even though the conversation demonstrably contains it.
18
18
  //
19
19
  // What this plugin adds:
20
- // * A scope toggle in the bar: 「整段 / Whole」 (default) and 「本页 / Page」.
20
+ // * A scope toggle in the bar: 「包含更早内容 / Include earlier content」 (default) and 「已加载内容 / Loaded content」.
21
21
  // * In whole-conversation mode a search pages the older history in through
22
22
  // the session service (ctx.sessions.binding(id).session.loadOlder()),
23
23
  // re-running the match pass after every page — so the count and the
@@ -72,39 +72,39 @@ window.__ModuleLoader__.load({
72
72
 
73
73
  var ZH = typeof navigator !== "undefined" && /^zh/i.test(navigator.language || "");
74
74
  var L = ZH ? {
75
- placeholder: "查找整段会话…",
75
+ placeholder: "在此会话中查找…",
76
76
  prev: "上一个匹配",
77
77
  next: "下一个匹配",
78
78
  close: "关闭查找",
79
- cap: "已达匹配上限,仅显示前 {n} 条",
80
- scopeWhole: "整段",
81
- scopePage: "本页",
82
- scopeToPage: "搜索范围:整段会话。点击改为只搜当前页面",
83
- scopeToWhole: "搜索范围:仅当前页面。点击改为搜索整段会话",
79
+ cap: "仅显示前 {n} 处匹配",
80
+ scopeWhole: "包含更早内容",
81
+ scopePage: "已加载内容",
82
+ scopeToPage: "搜索当前会话中已加载的内容,并继续加载更早内容。点击改为仅搜索已加载内容",
83
+ scopeToWhole: "仅搜索当前会话中已加载的内容,不再加载更早内容。点击改为包含更早内容",
84
84
  loading: "正在加载更早的历史… 已 {n} 页",
85
85
  available: "已搜索当前可用历史;宿主未提供更早页,无法确认历史完整性",
86
- capped: "历史尚未搜完:已到加载上限({n} 页)",
86
+ capped: "搜索未完成:已到更早内容的加载上限({n} 页),已保留找到的结果",
87
87
  stopTip: "点击停止加载",
88
- noService: "会话接口不可用,仅保留已显示的部分结果",
88
+ noService: "搜索未完成:会话接口不可用,已保留找到的结果",
89
89
  noTarget: "请先选择可见的会话,再打开查找",
90
90
  noRoot: "当前会话的搜索范围不可用",
91
- incomplete: "历史尚未搜完,保留部分结果",
91
+ incomplete: "搜索未完成,已保留找到的结果",
92
92
  find: "查找会话"
93
93
  } : {
94
- placeholder: "Find in conversation…",
94
+ placeholder: "Find in this conversation…",
95
95
  prev: "Previous match",
96
96
  next: "Next match",
97
97
  close: "Close find",
98
- cap: "Match limit reached, showing first {n}",
99
- scopeWhole: "Whole",
100
- scopePage: "Page",
101
- scopeToPage: "Scope: the whole conversation. Click to search only the rendered page",
102
- scopeToWhole: "Scope: the rendered page only. Click to search the whole conversation",
98
+ cap: "Showing only the first {n} matches",
99
+ scopeWhole: "Include earlier content",
100
+ scopePage: "Loaded content",
101
+ scopeToPage: "Search loaded content in this conversation and load earlier content. Click to search loaded content only",
102
+ scopeToWhole: "Search only content already loaded in this conversation, without loading more. Click to include earlier content",
103
103
  loading: "Loading earlier history… {n} pages",
104
104
  available: "Searched currently available history; the host offers no earlier pages, so completeness cannot be confirmed",
105
- capped: "History search incomplete: page cap reached ({n})",
105
+ capped: "History search incomplete: loading limit reached ({n} pages); partial results retained",
106
106
  stopTip: "Click to stop loading",
107
- noService: "Session service unavailable; rendered results only",
107
+ noService: "History search incomplete: session service unavailable; partial results retained",
108
108
  noTarget: "Select a visible conversation before opening find",
109
109
  noRoot: "Search scope unavailable for this conversation",
110
110
  incomplete: "History search incomplete; partial results retained",
@@ -618,6 +618,10 @@ window.__ModuleLoader__.load({
618
618
  if (!state.query) state.count.textContent = "";
619
619
  else if (n === 0) state.count.textContent = state.paging ? "…" : "0/0";
620
620
  else state.count.textContent = (state.index + 1) + "/" + n + (state.capped ? "+" : "");
621
+ var cap = state.query && n > 0 && state.capped ? L.cap.replace("{n}", String(MAX_MATCHES)) : "";
622
+ state.count.title = cap;
623
+ if (cap) state.count.setAttribute("aria-label", state.count.textContent + "; " + cap);
624
+ else state.count.removeAttribute("aria-label");
621
625
  }
622
626
 
623
627
  function setStatus(text, busy) {
@@ -954,6 +958,7 @@ window.__ModuleLoader__.load({
954
958
 
955
959
  var count = document.createElement("span");
956
960
  count.className = "count";
961
+ count.setAttribute("role", "status");
957
962
  count.setAttribute("aria-live", "polite");
958
963
 
959
964
  var status = document.createElement("span");
@@ -1020,6 +1025,8 @@ window.__ModuleLoader__.load({
1020
1025
 
1021
1026
  function apply(ctx) {
1022
1027
  var react = require("react");
1028
+ var ui = require("@deepseek-ai/dsh-client-ui-primitives");
1029
+ var SearchIcon = ui.IconSearchOutlineRegular || ui.IconSearchOutline16;
1023
1030
  state.ctx = ctx;
1024
1031
  state.adapter = createHostAdapter(ctx, function () {
1025
1032
  syncTarget(null, true);
@@ -1028,13 +1035,18 @@ window.__ModuleLoader__.load({
1028
1035
  var anchor = react.useRef(null);
1029
1036
  react.useEffect(function () {
1030
1037
  if (!anchor.current || !props.sessionId) return;
1031
- return state.adapter.mount(anchor.current, props.sessionId);
1038
+ // Older supported Button exports do not forward refs. Always
1039
+ // register the real button rather than the sizing-neutral wrapper.
1040
+ var button = anchor.current.querySelector("button[data-find-all-session]");
1041
+ if (button) return state.adapter.mount(button, props.sessionId);
1032
1042
  }, [props.sessionId]);
1033
- return react.createElement("button", {
1034
- ref: anchor, type: "button", title: L.find, "aria-label": L.find,
1043
+ return react.createElement("span", { ref: anchor, style: { display: "inline-flex", flex: "none" } },
1044
+ react.createElement(ui.Button, {
1045
+ type: "button", size: "sm", variant: "ghost", title: L.find, "aria-label": L.find,
1046
+ style: { flex: "none", width: 28, padding: 0, color: "var(--dsw-alias-label-secondary)" },
1035
1047
  "data-find-all-session": props.sessionId,
1036
1048
  onClick: function (event) { open(event.currentTarget); }
1037
- }, "⌕");
1049
+ }, react.createElement(SearchIcon, { size: 15 })));
1038
1050
  }
1039
1051
  ctx.slots.inject("conversation.session.header.utilities", function () {
1040
1052
  return ctx.slots.register({ name: "conversation.session.header.utilities", id: "dsh-find-all" }, SessionFind);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuu-64/dsh-find-all",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Ctrl+F find bar for the DSH desktop app: it searches the whole conversation, not just the messages already on screen.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -38,7 +38,8 @@
38
38
  "peerDependencies": {
39
39
  "@deepseek-ai/dsh-api-session-controller": "0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2",
40
40
  "@deepseek-ai/dsh-client-ui-chat": "0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2",
41
- "@deepseek-ai/dsh-client-ui-conversation": "0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2"
41
+ "@deepseek-ai/dsh-client-ui-conversation": "0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2",
42
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2"
42
43
  },
43
44
  "scripts": {
44
45
  "test": "node --test \"test/**/*.test.mjs\"",