fix: sticky action scroll to bottom when edit message #5169
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe Your Changes
This pull request enhances the scroll handling logic in the
ThreadDetail
component to improve user experience by adding functionality to detect the presence of a scrollbar and updating related behaviors accordingly.Scroll Handling Enhancements:
hasScrollbar
to track whether the scroll container has a scrollbar. (web-app/src/routes/threads/$threadId.tsx
, web-app/src/routes/threads/$threadId.tsxR30)checkScrollState
function to determine the scroll position and the presence of a scrollbar, updating theisAtBottom
andhasScrollbar
states dynamically. (web-app/src/routes/threads/$threadId.tsx
, web-app/src/routes/threads/$threadId.tsxR49-R61)checkScrollState
into existing logic:web-app/src/routes/threads/$threadId.tsx
, [1] [2]streamingContent
is active. (web-app/src/routes/threads/$threadId.tsx
, web-app/src/routes/threads/$threadId.tsxR128-R134)hasScrollbar
alongsideisAtBottom
andisUserScrolling
. (web-app/src/routes/threads/$threadId.tsx
, [1] [2]UI Behavior Update:
isAtBottom
andhasScrollbar
, ensuring it only appears when scrolling is possible. (web-app/src/routes/threads/$threadId.tsx
, web-app/src/routes/threads/$threadId.tsxL218-R245)Fixes Issues
Self Checklist
Important
Enhance
ThreadDetail
scroll handling by tracking scrollbar presence and updating UI visibility logic.hasScrollbar
state to track scrollbar presence inThreadDetail
.checkScrollState
to updateisAtBottom
andhasScrollbar
states.checkScrollState
in initial render, thread ID change, and duringstreamingContent
.hasScrollbar
.isAtBottom
andhasScrollbar
.This description was created by
for 3955703. You can customize this summary. It will automatically update as commits are pushed.