Skip to content

Commit 9c80c8e

Browse files
committed
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.
1 parent bab657a commit 9c80c8e

2 files changed

Lines changed: 723 additions & 507 deletions

File tree

0 commit comments

Comments
 (0)