dsh-content-search-ad 0.25.2 → 0.26.0

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.
Files changed (3) hide show
  1. package/client.js +16 -2
  2. package/index.js +1 -1
  3. package/package.json +1 -1
package/client.js CHANGED
@@ -19,7 +19,7 @@ window.__ModuleLoader__.load({
19
19
  /** Locale namespace owned by this plugin. */
20
20
  const NS = 'contentSearch'
21
21
  /** Plugin version, shown in the panel so a running build can be identified. */
22
- const PLUGIN_VERSION = '0.25.2'
22
+ const PLUGIN_VERSION = '0.26.0'
23
23
  /** Tab-type identity; the body slot registers under the same key. */
24
24
  const TAB_ID = 'dsh-content-search-ad/panel'
25
25
  /** Page kind opened by the guide card and the strip's add control. */
@@ -1161,6 +1161,8 @@ window.__ModuleLoader__.load({
1161
1161
  ? memory.anchorSessionId
1162
1162
  : focusSessionId
1163
1163
  const inputRef = React.useRef(null)
1164
+ const chatListRef = React.useRef(null)
1165
+ const chatStickRef = React.useRef(true)
1164
1166
  const [query, setQuery] = React.useState(memory.query)
1165
1167
  const [phase, setPhase] = React.useState(memory.query.trim().length > 0 ? 'loading' : 'idle')
1166
1168
  const [rows, setRows] = React.useState(memory.rows)
@@ -1249,6 +1251,15 @@ window.__ModuleLoader__.load({
1249
1251
  return () => clearInterval(timer)
1250
1252
  }, [focusSessionId])
1251
1253
 
1254
+ // The list is a log: keep the newest question in view, unless the user has
1255
+ // scrolled up on purpose to read older ones.
1256
+ React.useEffect(() => {
1257
+ const node = chatListRef.current
1258
+ if (node === null) return
1259
+ if (!chatStickRef.current) return
1260
+ node.scrollTop = node.scrollHeight
1261
+ }, [questions])
1262
+
1252
1263
  // The zoom buttons move this; the choice is remembered per browser.
1253
1264
  const stepFont = React.useCallback((delta) => {
1254
1265
  setFontPx((value) => {
@@ -1633,7 +1644,10 @@ window.__ModuleLoader__.load({
1633
1644
  questions.length > 0
1634
1645
  ? h('div', { className: 'dcs-chat' },
1635
1646
  h('p', { className: 'dcs-section dcs-chat-head' }, t('questions.title', { n: questionCount })),
1636
- h('div', { className: 'dcs-chat-list' }, questions.map((question, index) => {
1647
+ h('div', { className: 'dcs-chat-list', ref: chatListRef, onScroll: (event) => {
1648
+ const node = event.currentTarget
1649
+ chatStickRef.current = node.scrollHeight - node.scrollTop - node.clientHeight < 48
1650
+ } }, questions.map((question, index) => {
1637
1651
  const hit = trimmed.length > 0 && matchesQuery(question.text, query)
1638
1652
  return h('button', {
1639
1653
  key: String(question.seq) + ':' + index,
package/index.js CHANGED
@@ -64,7 +64,7 @@ const FUZZY_MAX_CHARS = 12
64
64
  /** Shortest query, in code points, still worth a fuzzy pass. */
65
65
  const FUZZY_MIN_CHARS = 4
66
66
 
67
- const VERSION = '0.25.2'
67
+ const VERSION = '0.26.0'
68
68
 
69
69
  //#region http helpers
70
70
  function writeJson(res, status, value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-content-search-ad",
3
- "version": "0.25.2",
3
+ "version": "0.26.0",
4
4
  "description": "DeepSeek Harness (DSH) plugin: full-text search over every conversation's prose from a right sidebar tab, with a jump-to-match detail view.",
5
5
  "license": "MIT",
6
6
  "author": "zmq6931",