dsh-composer-scroll-hide
其他 活跃维护

dsh-composer-scroll-hide

wanglaixiang-cyber/dsh-composer-scroll-hide

支持输入组件随消息滚动自动收起,不遮挡聊天内容,同时保留回到底部的浮动按钮,交互自然流畅,适配消息流场景无需额外配置

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
10 KB
仓库大小
1 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:wanglaixiang-cyber/dsh-composer-scroll-hide
git clone https://github.com/wanglaixiang-cyber/dsh-composer-scroll-hide.git
git clone git@github.com:wanglaixiang-cyber/dsh-composer-scroll-hide.git
README.md main

dsh-composer-scroll-hide

A DSH browser-side plugin that makes the composer follow the message flow while scrolling.

Features

  • Scroll up: the input bar slides off-screen at the same speed as the content, so it never covers the history you are reading
  • Browsing history: while paging down through history, the input bar stays hidden — it never pops in early
  • Back to latest: the input bar only rides back in over the final stretch of the return to the latest message (about one composer height), settling fully at the bottom
  • Float tracking: the app's "back to bottom" float button moves together with the input bar and lands 16px above the bottom edge once the bar is fully hidden

Install

dshpm install github:wanglaixiang-cyber/dsh-composer-scroll-hide --profile <profile-name>

Development

For local development, link the package into a profile:

"dsh-composer-scroll-hide": "link:/path/to/dsh-composer-scroll-hide"

Edits to lib/client.js are picked up by client-hmr within about a second — no page refresh, no restart.

How it works (short)

  • Listens to scroll events on the [data-conversation-scroll] scrollport (passive — never blocks scrolling)
  • Composer offset = min(distance to bottom, composer height): position-driven, so any state (re-attach, jump, resize) converges on the next scroll
  • Syncs the --dsh-composer-height custom property, which drives the back-to-bottom float's clearance so the float tracks the bar
  • The seat height is cached via ResizeObserver; the transform is written at most once per frame (requestAnimationFrame)

License

MIT