[Bug]: Dragging a sidebar thread from the lower part of the list auto-scrolls the sidebar to the bottom
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
从 apps/web/src/components/Sidebar.tsx 中约第 3169 行附近的 autoScroll prop 开始,然后检查 dnd-kit 6.3.1 的自动滚动设置,并复现所报告的从较低行开始拖动的情况。调整自动滚动区域和速度,使列表在指针接近侧边栏边缘之前保持静止,同时在边缘拖动时仍能滚动。在应用中验证所报告的操作,尤其是从当前可见的较低行拖动已固定线程的操作。
由索引模型根据 Issue 内容生成。
描述
Before submitting
- I searched existing issues and did not find a duplicate. Closest: #27586 (a row jumps down the list on pickup, same build). It may be the same cause, but it doesn't mention the list scrolling, so I'm filing this separately. #26392 fixed a similar jump when settling a thread, through a different path (focus restore).
- I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
- Have enough threads that the sidebar list is taller than the sidebar, and scroll it to the top.
- Press a thread in the lower part of the visible list. A pinned thread shows it best when Pinned fills most of the sidebar.
- Move the pointer a few pixels to start the drag. A small wobble downward is enough, even if you mean to drag up.
Expected behavior
The list stays put until the pointer reaches the edge of the sidebar, then scrolls at a speed you can control. You can move a pinned thread to the top of Pinned without losing sight of Pinned.
Actual behavior
As soon as the drag starts, the sidebar scrolls to the bottom of the list, even with the pointer held still. The pinned threads leave the screen, so you have to drag all the way back up.
Likely cause
The sidebar uses dnd-kit's default auto-scroll settings, which are too aggressive for a list this narrow and tall:
Sidebar.tsx:3169passesautoScroll={!isContextDrag}, so dnd-kit 6.3.1's defaults apply.- The default zone is 20% of the scroller's height (
getScrollDirectionAndSpeed). In an 800px sidebar that's the bottom 160px, about two thread rows, so a row can start inside it. - The default speed is up to 10px every 5ms at the edge, or 2,000px/s (
useAutoScroller). - Scroll intent is sticky (
useScrollIntent). One pixel of downward movement allows forward scrolling for the rest of the drag. - The scroll interval keeps running while the pointer is still, so the list runs to the end.
What I checked
Confirmed in the source, and with a simulation that runs the real dnd-kit 6.3.1 and an unmodified Sidebar.pointer.ts in jsdom with fake geometry (800px viewport, 82px rows, 3,280px list):
| Gesture | Pressed row | Scrolled after holding 1.5s |
|---|---|---|
| 8px down | Top or middle of the viewport | 0px |
| 8px down | In the bottom 20% | 1,143px, still moving |
| 8px up only | In the bottom 20% | 0px |
| 8px up, then 1px down | In the bottom 20% | 816px, still moving |
Not confirmed: I haven't reproduced this in a running app with this explanation, and the simulation has no real layout. I saw the jump in the app, but didn't measure where the pointer was. In the simulation, rows above the bottom 20% never scroll, so if this happens from the top of the list there is a second cause.
Ruled out by reading the code: the focus restore from #26392 now uses preventScroll, the drag labels and placeholders don't change layout height (h-0), and the sidebar's other scrollIntoView calls only run for keyboard navigation and route reveals.
Suggested fix
A smaller zone and a lower speed, keeping the current on/off behavior:
autoScroll={{ enabled: !isContextDrag, threshold: { x: 0, y: 0.05 }, acceleration: 3 }}
With these values in the same simulation, the row that ran away above stays at 0px, in both the 8px-down and 1px-wobble gestures. Dragging to the edge still scrolls, at about 500px/s. A row pressed in the last 5% still scrolls, at about 400px/s. The values need a real feel test.
Impact
Minor bug or occasional failure
Version or commit
T3 Code (Beta) 0.1.5 (6d450a428485). Source references are from main at 616c426f5f.
Environment
macOS 26.6.2, desktop app.
Workaround
Scroll the list so the row sits higher in the sidebar before picking it up. Based on the simulation, not tested in the app.
Investigated and drafted by Claude Code (Claude Opus 5.5).
- 主要语言
- TypeScript
- 星标
- 24.8k
- 派生
- 6.4k
- 平均合并
- 3 小时 20 分钟
- 30 天内合并 PR
- 208
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pingdotgg/t3code 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
pingdotgg/t3code#27445 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
pingdotgg/t3code#27146 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
pingdotgg/t3code#27022 · 1 条评论 ·
维护者通常 1 天内回复
-
[Bug]: Device hub update button is clipped with long canary version strings可能已有人在做 @juliusmarminge 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
Northeastern-Electric-Racing/FinishLine#4660 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
mihaip/infinite-mac#475 ·
-
Let TypeScript accept an initial object in ReactiveDict可能已有人在做 @yograj-vijay-yadav 今天认领。 未关闭bug good first issue help wanted workshop
难度 2/5 1-3 小时 新手友好度 92/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
marmelab/atomic-crm#401 ·
维护者通常 1 天内回复
-
account: profile
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 5 天内回复