chore(autofix): Refactor seer drawer into shared components#109854
chore(autofix): Refactor seer drawer into shared components#109854
Conversation
The seer drawer component has a lot of duplicate custom components. This change refactors it to 1. share components 2. use scraps where possible
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Auto-scroll initial value inverted from original behavior
- Changed shouldAutoScrollRef initial value from true to false to match original behavior where auto-scroll was disabled by default.
Or push these changes by commenting:
@cursor push 2a63f68b07
Preview (2a63f68b07)
diff --git a/static/app/components/events/autofix/v1/body.tsx b/static/app/components/events/autofix/v1/body.tsx
--- a/static/app/components/events/autofix/v1/body.tsx
+++ b/static/app/components/events/autofix/v1/body.tsx
@@ -100,7 +100,7 @@
const scrollContainerRef = useRef<HTMLDivElement>(null);
const lastScrollTopRef = useRef(0);
- const shouldAutoScrollRef = useRef(true);
+ const shouldAutoScrollRef = useRef(false);
const handleScroll = useCallback(() => {
const container = scrollContainerRef.current;| const scrollContainerRef = useRef<HTMLDivElement>(null); | ||
|
|
||
| const lastScrollTopRef = useRef(0); | ||
| const shouldAutoScrollRef = useRef(true); |
There was a problem hiding this comment.
Auto-scroll initial value inverted from original behavior
Medium Severity
shouldAutoScrollRef is initialized to true, but the old code initialized userScrolledRef to true which meant auto-scroll was disabled by default (the effect checked !userScrolledRef.current). When renaming and inverting the semantics, the handler logic and effect condition were correctly inverted, but the initial value was not — it needs to be false to match the original behavior. This causes the drawer to aggressively scroll to the bottom on every data change as soon as it opens, rather than letting the user read content from the top.



The seer drawer component has a lot of duplicate custom components. This change refactors it to