Roo-Code/webview-ui/src/hooks
Hannes Rudolph f864270547
fix(chat): redesign rehydration scroll lifecycle (#11483)
* fix(chat): stabilize rehydration scroll-to-bottom convergence

* fix(chat): preserve user escape hatch during initial settle

* refactor(chat): reduce scroll fix PR scope and remove debug plumbing

* fix(chat): redesign rehydration scroll lifecycle

* refactor(chat): extract scroll lifecycle into useScrollLifecycle hook

- Extract ~400 lines of scroll lifecycle logic from ChatView.tsx into
  a dedicated useScrollLifecycle hook, reducing ChatView scroll-related
  refs from ~17 to 0 and making the logic testable in isolation.

- Reduce INITIAL_LOAD_SETTLE_HARD_CAP_MS from 10s to 5s. If rehydration
  takes longer, there is likely a rendering performance issue worth
  investigating separately.

- Document the scrollToIndex reversal: PR #6780 removed scrollToIndex
  due to jitter from stale numeric indices. The "LAST" constant used
  here resolves at call time, avoiding that issue.

- All 6 existing scroll regression tests pass unchanged.

* fix(chat): harden scroll lifecycle pointer intent and settle phase fallback

* test(chat): stabilize ChatView scroll debug repro flake

* refactor(chat): simplify hydration scroll lifecycle

* fix(chat): start existing task at latest message bottom

---------

Co-authored-by: Roo Code <roomote@roocode.com>
2026-02-18 23:51:12 -07:00
..
__tests__ Reapply Batches 3-4: Skills, browser removal, provider removals (6 major-conflict cherry-picks) (#11475) 2026-02-14 22:06:24 -07:00
useAutoApprovalState.ts Reapply Batches 3-4: Skills, browser removal, provider removals (6 major-conflict cherry-picks) (#11475) 2026-02-14 22:06:24 -07:00
useAutoApprovalToggles.ts Reapply Batches 3-4: Skills, browser removal, provider removals (6 major-conflict cherry-picks) (#11475) 2026-02-14 22:06:24 -07:00
useCloudUpsell.ts Add config to control public sharing (#10105) 2025-12-15 21:58:15 -05:00
useEscapeKey.spec.ts Move @roo-code/cloud to the Roo-Code repo (#7503) 2025-08-28 11:18:45 -07:00
useEscapeKey.ts feat: add ESC key handling for modes, API provider, and indexing settings popovers (#6175) 2025-07-28 23:04:23 -04:00
useScrollLifecycle.ts fix(chat): redesign rehydration scroll lifecycle (#11483) 2026-02-18 23:51:12 -07:00
useTooManyTools.ts feat: warn users when too many MCP tools are enabled (#10772) 2026-01-18 09:22:09 -05:00