Commit e0f7770
Prevent AI panel auto-scroll when user scrolls up to read
When the AI is streaming responses, the panel would continuously
auto-scroll to the bottom, making it impossible to read earlier parts
of the response.
This change detects when the user has manually scrolled up (more than
50px from bottom) and stops auto-scrolling until they scroll back near
the bottom.
- Add scroll event listener to detect manual user scrolling
- Track userHasScrolledUp state
- Only auto-scroll if user is at/near bottom
- Improves readability of long AI responses
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent fbb0c4d commit e0f7770
1 file changed
+37
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
32 | 63 | | |
33 | 64 | | |
34 | 65 | | |
35 | 66 | | |
36 | 67 | | |
37 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
38 | 72 | | |
39 | 73 | | |
40 | 74 | | |
41 | | - | |
| 75 | + | |
42 | 76 | | |
43 | 77 | | |
44 | 78 | | |
| |||
47 | 81 | | |
48 | 82 | | |
49 | 83 | | |
50 | | - | |
| 84 | + | |
51 | 85 | | |
52 | 86 | | |
53 | 87 | | |
| |||
0 commit comments