Skip to content

fix(web): dragging a sidebar thread no longer scrolls the list to the bottom - #27691

Merged
t3dotgg merged 8 commits into
mainfrom
fix/issue-27669
Nov 6, 2026
Merged

t3dotgg merged 8 commits into
mainfrom
fix/issue-27669

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Picking up a sidebar thread near the bottom of the list ran the list away to the end, even with the pointer held still. Pinned threads left the screen before you could drop.

Fixes #27669

The cause is dnd-kit's default autoscroll: a 20% edge zone at full speed, and a scroll intent that stays on after one pixel of downward movement. The sidebar's DndContext now uses a 5% vertical edge zone and acceleration 3. Dragging to the edge still scrolls the list, at about 400 px/s. Context (tag) drags still turn autoscroll off.

This PR first also fixed a second cause: the Settled drop hint called scrollIntoView on every drag start. #30346 has since fixed that on main, so the takeover removed that part and its tests. Those tests failed against current main.

Measured in the web dev app, 1280×800, sidebar viewport y 100–756, about 500 seeded threads with Settled expanded. Each row: press a row, move as listed, hold still, sample scrollTop every 250 ms.

Gesture Before (main) After
Press at y 700, 8px down, then 3px 13 → 332 → 533 → end in under 1 s 0 throughout
Press at y 700, 10px up, then 1px down 10 → 265 → 425 → 610 → end 0 throughout
Drag a row out to the composer (tag) sidebar left at 342 0
Deliberate drag to the bottom edge (y 750) end in about 0.5 s 13 → 140 → 265 → … → end over 2 s

vp run check:changed passes on the merged head.

Not verified: touch input, trackpad feel by hand, the Electron app, and mobile (separate code).

Original work by @juliusmarminge. Takeover (merge with main, removal of the part #30346 covers, verification) by Claude Opus 5.5 in T3 Code (Claude Code harness).

🤖 Generated with Claude Code

juliusmarminge and others added 5 commits October 30, 2026 15:55
…27669)

This test reproduces #27669: starting a drag on a row near the top of a
tall sortable list scrolls the viewport straight to the off-screen
settled-placeholder drop hint. It fails on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to the bottom

Starting any drag scrolled the sidebar straight to the off-screen settled
drop hint, because the #26736 reveal called scrollIntoView unconditionally.
It now only nudges a hint its scroll viewport already partly shows, which
keeps the clipped-border fix.

Auto-scroll used dnd-kit's 20% edge zone at full acceleration, so resting the
pointer near the bottom ran the list away. It now uses a 5% zone and
acceleration 3.

Fixes #27669

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The drag transform can push an on-screen hint fully below the viewport in one
step, as when the only settled row is lifted into Active. Judge visibility from
the slot the hint rests in, so that hint is still revealed while a far-off hint
is still left alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A drag can also lift a hint resting just below the viewport across its edge,
so follow the hint when either its current box or its resting slot is on
screen. Default the test harness's collision detection so it typechecks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Oct 30, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — This changes the default sidebar drag auto-scrolling to a narrower edge zone with lower acceleration, while keeping context-drag scrolling disabled. A human must confirm the new default interaction.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The sidebar now uses custom auto-scroll settings for non-context drags. Sortable marker hints scroll into view only when their current or transformed bounds overlap the scroll viewport. Browser tests cover hint visibility during drag.

Changes: Sidebar drag scrolling

Layer / File(s) Summary
Configure sidebar auto-scroll
apps/web/src/components/Sidebar.tsx
Non-context drags use a 5% vertical edge threshold and acceleration of 3. Context drags continue to disable auto-scroll.
Guard sortable hint reveal during drag
apps/web/src/components/sidebar/SidebarListMarkers.tsx, apps/web/src/components/sidebar/SidebarListMarkers.browser.test.tsx
The marker scrolls its hint into view only when its current or transformed bounds overlap the scroll viewport. Browser tests cover off-screen, clipped, and shifted hints.

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

  • pingdotgg/t3code#26736: This PR also changes when a settled drop hint scrolls into view during a drag.
  • pingdotgg/t3code#28119: This PR changes which sidebar drag mode Working threads use, affecting whether the configured auto-scroll behavior applies.

Suggested reviewers: t3dotgg

Merge Risk: Minimal · up to 556e4

No actionable merge-blocking risk was identified in the changed sidebar drag-scrolling paths.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Description check Inconclusive The description conflicts with the supplied changes. It says the Settled hint fix and tests were removed, but both appear in the file summaries. It also lacks the required UI screenshots and recording… Confirm the final diff and update the description and verification results to match it. Add the template headings, before-and-after screenshots, and a recording of the drag behavior. Confirm that the linked issue is triaged, link maintainer…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title clearly identifies the sidebar drag-scrolling fix and follows the repository’s conventional commit style.
Linked Issues check Passed Issue #27669 requires three coding changes: (1) the sidebar list must not scroll when a thread drag starts with a stationary pointer away from the edge; (2) edge scrolling must remain, at a controllab…
Out of Scope Changes check Passed The whole-PR diff against the merge base changes three areas, all in apps/web. (a) Sidebar.tsx: adds SIDEBAR_AUTO_SCROLL and the AutoScrollOptions import, and changes the autoScroll prop on …
Full details: Linked Issues check

Explanation

Issue #27669 requires three coding changes: (1) the sidebar list must not scroll when a thread drag starts with a stationary pointer away from the edge; (2) edge scrolling must remain, at a controllable speed; (3) the Settled drop hint must not pull the list to an off-screen position. The reviewed head meets each one.

(1) and (3): In SidebarListMarkers.tsx, SortableSidebarMarker calls scrollIntoView only when the hint rect, or the rect minus transform.y (its resting position), overlaps the first scrollable ancestor's rect. A clipped hint still overlaps, so it is still revealed. An entirely off-screen hint is not scrolled to.

(2): In Sidebar.tsx, SIDEBAR_AUTO_SCROLL sets threshold.y to 0.05 and acceleration to 3. This replaces dnd-kit's 20% zone and default speed. Context drags still get autoScroll={false}. These are the values the issue suggests. The PR transcript reports 0px scroll during the stationary-pointer gestures from the issue, and continued scrolling at the bottom edge (about 440 px/s) and top edge (about 400 px/s). The issue says the speed needs a real feel test. That is a validation step, not a coding requirement, and the PR states it was not done.

The focused browser tests in SidebarListMarkers.browser.test.tsx cover the off-screen case, the clipped case, and both transform directions. The issue's coding requirements are met by the code in the reviewed head.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base changes three areas, all in apps/web. (a) Sidebar.tsx: adds SIDEBAR_AUTO_SCROLL and the AutoScrollOptions import, and changes the autoScroll prop on DndContext. (b) SidebarListMarkers.tsx: changes the useLayoutEffect reveal logic and adds a getScrollableAncestors import. (c) SidebarListMarkers.browser.test.tsx: adds browser tests for these cases. Each change serves issue #27669. The PR does not change useScrollIntent, focus handling, or unrelated sidebar behavior. The added tests support the Settled hint change. No unrelated behavior change was found in the diff.

Full details: Description check

Explanation

The description conflicts with the supplied changes. It says the Settled hint fix and tests were removed, but both appear in the file summaries. It also lacks the required UI screenshots and recording.

Resolution

Confirm the final diff and update the description and verification results to match it. Add the template headings, before-and-after screenshots, and a recording of the drag behavior. Confirm that the linked issue is triaged, link maintainer approval, or explain why the fix qualifies without prior approval.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ast-grep (0.51.1)

ast-grep could not parse rule config: /ast-grep-rules/ast-grep-essentials/rules/rust/security/reqwest-accept-invalid-rust.yml

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2a5accc and 556e47f.

Files selected for processing: 1

  • apps/web/src/components/Sidebar.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@juliusmarminge juliusmarminge added bugfix Fix PR opened by an issue lead; enters the PR loop pr:gate-failed A land gate failed pr:in-progress A lead is working on this PR and removed pr:gate-failed A land gate failed labels Oct 30, 2026

Copy link
Copy Markdown
Member Author

Taking over this one

@juliusmarminge juliusmarminge self-assigned this Nov 3, 2026
t3dotgg and others added 2 commits November 6, 2026 02:11
#30346 already limits the settled hint's scrollIntoView to drags that
target Settled, so the on-screen guard and its tests are redundant and
the tests fail against current main. Keep the autoscroll tuning, which
still fixes the bottom-edge runaway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added size:XS 0-9 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Nov 6, 2026
@t3dotgg
t3dotgg merged commit 86d8838 into main Nov 6, 2026
30 of 32 checks passed
@t3dotgg
t3dotgg deleted the fix/issue-27669 branch November 6, 2026 10:21
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Nov 6, 2026
**v0.1.8-nightly.20261106.4275** · 12 changes from 6 contributors

**8 bug fixes and performance improvements.**

<details>
<summary>Full changelog</summary>

## What's Changed
* fix(desktop): arm64 macOS builds no longer ship x64-only objc-js binary by @joshuarossi in pingdotgg/t3code#31285
* fix(web): keep task updates static in the timeline by @Yash-Singh1 in pingdotgg/t3code#31888
* fix(devices): keep devices listed when simulator discovery fails by @shivamhwp in pingdotgg/t3code#25971
* fix(web): dragging a sidebar thread no longer scrolls the list to the bottom by @juliusmarminge in pingdotgg/t3code#27691
* fix(web): tagging a thread by drag no longer scrolls the sidebar by @t3dotgg in pingdotgg/t3code#31924
* ci: stacked PRs stop evicting the shared pnpm cache by @t3dotgg in pingdotgg/t3code#31937
* fix(web): remote subagents no longer split from the lineage list by @t3dotgg in pingdotgg/t3code#29285
* perf(ci): release uploads stop recompressing installers and CLI archives by @t3dotgg in pingdotgg/t3code#31942
* feat(antigravity): identify as T3 Code to agy acp 1.5.1+ by @patrick-toulme in pingdotgg/t3code#31158
* ci(release): JS bundle jobs stop building an unused Linux helper by @t3dotgg in pingdotgg/t3code#31941
* feat(marketing): help search engines tell t3.codes apart from copycat sites by @t3dotgg in pingdotgg/t3code#31142
* perf(server): background service launcher uses 75% less memory by @t3dotgg in pingdotgg/t3code#29284

## New Contributors
* @joshuarossi made their first contribution in pingdotgg/t3code#31285
* @patrick-toulme made their first contribution in pingdotgg/t3code#31158

**Full Changelog**: pingdotgg/t3code@v0.1.8-nightly.20261106.4262...v0.1.8-nightly.20261106.4275

</details>


Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.8-nightly.20261106.4275
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fix PR opened by an issue lead; enters the PR loop pr:gate-failed A land gate failed size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Dragging a sidebar thread from the lower part of the list auto-scrolls the sidebar to the bottom

2 participants