-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: get rid of Simplebar (vanilla js based scrollbar) #2900
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vanbasten17
force-pushed
the
refactor/update-simplebar
branch
2 times, most recently
from
September 6, 2024 14:56
183fe0c
to
b8b676e
Compare
Iru89
reviewed
Sep 17, 2024
packages/botonic-react/src/webchat/devices/scrollbar-controller.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be better to use ref in the components instead of ids
Iru89
added a commit
that referenced
this pull request
Oct 3, 2024
This is a continuation of: #2900 Several things done here: * Remove `scrollable-content` generic component and create it for each scrollable div. * Add notable refs (`webchatRef`, `chatAreaRef`, `headerRef`) in `WebchatContext` to be accessed from different parts of the coee * Remove JS commented code already migrated to TS. * Reduce `util/dom.js` in favour of using new hooks. * Migrate from JS to TS: * `device-adapter` * `scrollbar-controller` * `webchat-resizer` * Simplify `WebchatHeader` component * New hooks: * `useScrollToBottom`: centralize logic for scrolling to the end of scrollable messages list container * `useVirtualKeyboardDetection`: detect whether virtual keyboard is open or not (iOS/Safari) * `useWebchatDimensions`: recalculation of webchat / chat area heights * Create a new component `WebchatChatArea` * Set textarea fontsize to 16px to be consistent with the rest of styles and avoid auto-focusing issues on iOS. --------- Co-authored-by: Oriol Raventos <[email protected]>
…rywhere where used
…e before refactoring into hooks
This is a continuation of: #2900 Several things done here: * Remove `scrollable-content` generic component and create it for each scrollable div. * Add notable refs (`webchatRef`, `chatAreaRef`, `headerRef`) in `WebchatContext` to be accessed from different parts of the coee * Remove JS commented code already migrated to TS. * Reduce `util/dom.js` in favour of using new hooks. * Migrate from JS to TS: * `device-adapter` * `scrollbar-controller` * `webchat-resizer` * Simplify `WebchatHeader` component * New hooks: * `useScrollToBottom`: centralize logic for scrolling to the end of scrollable messages list container * `useVirtualKeyboardDetection`: detect whether virtual keyboard is open or not (iOS/Safari) * `useWebchatDimensions`: recalculation of webchat / chat area heights * Create a new component `WebchatChatArea` * Set textarea fontsize to 16px to be consistent with the rest of styles and avoid auto-focusing issues on iOS. --------- Co-authored-by: Oriol Raventos <[email protected]>
Iru89
force-pushed
the
refactor/update-simplebar
branch
from
October 3, 2024 09:04
fd82e47
to
64b9c00
Compare
Test Results1 tests 1 ✅ 2s ⏱️ Results for commit 64b9c00. ♻️ This comment has been updated with latest results. |
Iru89
approved these changes
Oct 3, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR include this other one PR#2903
Work done so far
scrollbar
webchat property customization: We don't want to support this feature anymore. This was done before in order to have "nice" styles in Internet Explorer and similar browsers. As IE is not supported anymore, we can remove this.Current state
As per the list described above, the functionality should be the same as before. The important thing to notice here is that WE DON'T RELY ANYMORE on simplebar selectors
'.simplebar-content'
and'.simplebar-content-wrapper'
, so bots using them should be adapted.Next steps