dsh-plugin-turn-index 1.0.0 → 1.0.1

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 (2) hide show
  1. package/lib/client.js +3 -2
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -1205,7 +1205,7 @@ body[data-ds-dark-theme] .dsh-turn-index-prompt::highlight(dsh-turn-index) {
1205
1205
  }, [open, query, searchNeedle, filteredNeedle, lockedHeight])
1206
1206
 
1207
1207
  const layout = useMemo(() => {
1208
- if (rect === null) return null
1208
+ if (rail === null || rect === null || !rail.isConnected) return null
1209
1209
  const viewportWidth = window.innerWidth
1210
1210
  const viewportHeight = window.innerHeight
1211
1211
  const buttonSize = 22
@@ -1224,7 +1224,8 @@ body[data-ds-dark-theme] .dsh-turn-index-prompt::highlight(dsh-turn-index) {
1224
1224
  // The overlay sits above the conversation, so the index may cover the
1225
1225
  // composer: use the full window height (minus a small margin) instead of
1226
1226
  // stopping at the chat scroller's bottom.
1227
- const frame = rail.parentElement === null ? null : rail.parentElement.parentElement
1227
+ const railParent = rail.parentElement
1228
+ const frame = railParent === null ? null : railParent.parentElement
1228
1229
  const flow = frame === null ? null : frame.querySelector('[data-chat-flow]')
1229
1230
  const scroller = flow === null ? null : flow.parentElement
1230
1231
  const scrollBox = scroller === null ? null : scroller.getBoundingClientRect()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-turn-index",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "为会话右侧的轮次导航追加提问索引:展开全部提问、搜索过滤,点击即可跳转。在右侧索引列表底部增加展开箭头。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",