Commit c3568d2
authored
fix(comments): reduce sidebar jitter when clicking comments (SD-2034) (#2250)
* fix(comments): reduce sidebar jitter when clicking comments (SD-2034)
Clicking a comment near the bottom of the sidebar caused the scrollbar
to flash because totalHeight oscillated during collision avoidance
recalculation and height remeasurements. Three fixes:
- Add CSS transition on section-wrapper min-height so height changes
are smooth instead of causing abrupt scrollbar appearance/disappearance
- Increase ESTIMATED_HEIGHT from 80 to 110 to better match actual
comment card sizes, reducing visual overlap before measurement
- Fix scroll-to-comment: increase delay from 100ms to 400ms so the
comment-placeholder CSS transition (300ms) completes before checking
visibility, and use rect.bottom instead of rect.top for the lower
bound check
* fix(comments): handle tall cards in scroll-to-comment visibility check
When a comment card is taller than the viewport, the rect.bottom check
always fails, causing scrollIntoView to fire on every click. Fall back
to checking only rect.top for cards that exceed the available height.1 parent d74f18d commit c3568d2
1 file changed
Lines changed: 10 additions & 3 deletions
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
| 326 | + | |
326 | 327 | | |
327 | 328 | | |
328 | 329 | | |
329 | 330 | | |
330 | 331 | | |
331 | 332 | | |
332 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
333 | 338 | | |
334 | 339 | | |
335 | 340 | | |
336 | 341 | | |
337 | | - | |
| 342 | + | |
338 | 343 | | |
339 | 344 | | |
340 | 345 | | |
| |||
499 | 504 | | |
500 | 505 | | |
501 | 506 | | |
| 507 | + | |
| 508 | + | |
502 | 509 | | |
503 | 510 | | |
0 commit comments