-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add scrollToEndButtonBehavior
style options
#3926
Merged
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
compulim
requested review from
a-b-r-o-w-n,
beyackle,
corinagum,
cwhitten,
srinaath,
tdurnford and
tonyanziano
as code owners
June 3, 2021 01:48
corinagum
reviewed
Jun 3, 2021
corinagum
reviewed
Jun 3, 2021
corinagum
reviewed
Jun 3, 2021
packages/test/page-object/src/globals/pageElements/focusedActivity.js
Outdated
Show resolved
Hide resolved
corinagum
reviewed
Jun 3, 2021
packages/component/src/Middleware/ScrollToEndButton/createScrollToEndButtonMiddleware.ts
Outdated
Show resolved
Hide resolved
corinagum
reviewed
Jun 3, 2021
corinagum
reviewed
Jun 3, 2021
corinagum
reviewed
Jun 3, 2021
corinagum
reviewed
Jun 3, 2021
__tests__/html/scrollToEndButton.persistWhileCallingUseScrollTo.js
Outdated
Show resolved
Hide resolved
corinagum
reviewed
Jun 3, 2021
corinagum
reviewed
Jun 3, 2021
corinagum
reviewed
Jun 3, 2021
corinagum
reviewed
Jun 3, 2021
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.
Few comments / questions. Do you have time for 1:1?
corinagum
approved these changes
Jun 4, 2021
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.
Approved pending comments/questions :)
Co-authored-by: Corina <[email protected]>
Co-authored-by: Corina <[email protected]>
compulim
force-pushed
the
feat-more-messages-button
branch
from
June 4, 2021 11:32
07be9bd
to
a06696e
Compare
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.
Changelog Entry
Breaking changes
scrollToEndButtonBehavior
is introduced to control when the scroll to end button should show (formerly "new messages" button):styleOptions.hideScrollToEndButton
has been deprecated. To hide the scroll to end button, setstyleOptions.scrollToEndButtonBehavior
tofalse
;styleOptions.newMessageButtonFontSize
has been renamed tostyleOptions.scrollToEndButtonFontSize
to better reflect its purpose.Added
scrollToEndButtonBehavior
to control when the scroll to end button should show, removedhideScrollToEndButton
, and renamednewMessagesButtonFontSize
toscrollToEndButtonFontSize
, by @compulim, in PR #3926.scrollToEndButtonBehavior
:"unread"
;"unread"
will show when there are any unread and offscreen messages (default);"any"
will show when there are any offscreen messages;false
will always hide the button.scrollToEndButtonMiddleware
to customize the appearance of the scroll to end button.Description
A new style option is added to control how the scroll to end button should show (formerly "New messages" button).
Depends on the option, the button will be named "New messages" or "More messages" button.
With this PR, web developers can start customizing the look and behavior of the scroll to end button. It includes when their scroll to end button should show up. For example, they can always show their button regardless whether the scroll view is at the bottom or not.
Design
Despite we listed breaking changes (due to deprecations), we have migration code for all breaking changes and web developers do not need to change anything when upgrading Web Chat. There will be warnings to remind them to update their code.
Typing of middleware
Starting from this PR, we will add typings for our middleware, starting from
scrollToEndButtonMiddleware
.Currently, we have 3 types of middleware:
<li>
styleOptions.scrollToEndButtonBehavior
The option can be set to 3 different values:
"unread"
will show when there are any unread and offscreen messages (default)"any"
will show when there are any offscreen messagesfalse
will always hide the buttonIf unset, it will default to
"unread"
, which is the behavior of <= 4.13.0.scrollToEndButtonMiddleware
Sample code snippet to customize the appearance of the button. The code below will always show the scroll to end button regardless of scroll position (
atEnd
or not).Please refer to
scrollToEndButtonMiddleware.ts
for the full signature of the middleware.Specific Changes
CHANGELOG.md
Review Checklist
Accessibility reviewed (tab order, content readability, alt text, color contrast)Browser and platform compatibilities reviewedCSS styles reviewed (minimal rules, noz-index
)Documents reviewed (docs, samples, live demo)package.json
andpackage-lock.json
reviewedSecurity reviewed (no data URIs, check for nonce leak)