-
Notifications
You must be signed in to change notification settings - Fork 2.7k
MM-35722: CRT, post click open thread #8342
MM-35722: CRT, post click open thread #8342
Conversation
Clicking on a post while having CRT on should open the thread in RHS, even for single messages. The difficulty in this is that posts may contain other elements that have onClick handlers, or even just links and buttons. In those cases we don't open the RHS. Added a isEligibleForClick utility function that tries to solve the above problem.
@koox00 Just played with this and noticed that if I click on a system join message, the screen goes blank. We should probably disable this feature on leave/join messages |
yes I just noticed too, will fix thx! |
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.
LGTM
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.
LGTM!
@koox00 we should test this in our threading sync with more content in the channels so we can all see how it feels. It seems ok with channels that only have a few threads, but I wonder how it might feel with full channels |
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.
@koox00 after playing with this a few times I think it's working quite well. The only thing I'm wondering is:
- Can we make sure links, link previews, permalink previews, attachments or other internal interactive elements do not open the RHS? Right now it looks like clicking anywhere on the link preview container opens the RHS and clicking on attachments also opens the RHS (as well as the gallery view)
Oh, thanks @matthewbirtch...
That was my concern as well, we cannot be 100% sure something won't "break" it in the future. |
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.
LGTM! Difficult problem to solve "correctly."
Besides any pending fine tuning, my only thought might be to put a maintenance PSA comment somewhere, maybe in post.jsx
?
// here be dragons
/**
* @see {isEligibleForClick} — When adding clickable targets within a root post, please add to/maintain CLICKABLE_ELEMENTS
*/
class Post ...
makeIsEligibleForClick takes as an argument a CSS selector string and returns a function to determine if the event's target is eligible to handle that particular onClick event. *The CSS selector argument matches elements that should not handle the event. Also standard HTMLElements that is very possible to have on click events on their own should not handle the event. See CLICKABLE_ELEMENTS.
@koox00 A couple things we noticed from the team testing session:
|
utils/utils.jsx
Outdated
* @param {string} selector - CSS selector of elements not eligible for click | ||
* @returns {function} | ||
*/ | ||
export function makeIsEligibleForClick(selector) { |
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.
Can we add a default of empty for this?
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.
Thanks @koox00
Tested, looks good to merge.
- Verified click on a post opens RHS thread.
Issue with dismissing profile popover has been filed separately. https://mattermost.atlassian.net/browse/MM-37291
Test server destroyed |
/update-branch |
@jgilliam17 if we don't have one can we file a ticket for the issues we discussed in planning where this takes effect even if menus/modals etc are open |
Can we repurpose the ticket I created for the profile popover? https://mattermost.atlassian.net/browse/MM-37291 |
@esethna see above |
@jgilliam17 sure let's just add details as needed for other cases |
/cherry-pick cloud |
Cherry pick is scheduled. |
* Naive post click open thread Clicking on a post while having CRT on should open the thread in RHS, even for single messages. The difficulty in this is that posts may contain other elements that have onClick handlers, or even just links and buttons. In those cases we don't open the RHS. Added a isEligibleForClick utility function that tries to solve the above problem. * Fixes: clicking on system messages * Minor change * Refactors isEligibleForClick to makeIsEligibleForClick makeIsEligibleForClick takes as an argument a CSS selector string and returns a function to determine if the event's target is eligible to handle that particular onClick event. *The CSS selector argument matches elements that should not handle the event. Also standard HTMLElements that is very possible to have on click events on their own should not handle the event. See CLICKABLE_ELEMENTS. * Fixes JSDoc @returns * Fixes tests * Fixes tests * Minor styling fixes Attachments should set cursor to default. Update your status button should be a button. makeIsEligibleForClick initial value for argument selector. * Fixes tests Co-authored-by: Mattermod <mattermod@users.noreply.github.com> (cherry picked from commit 6ed8a49)
* Naive post click open thread Clicking on a post while having CRT on should open the thread in RHS, even for single messages. The difficulty in this is that posts may contain other elements that have onClick handlers, or even just links and buttons. In those cases we don't open the RHS. Added a isEligibleForClick utility function that tries to solve the above problem. * Fixes: clicking on system messages * Minor change * Refactors isEligibleForClick to makeIsEligibleForClick makeIsEligibleForClick takes as an argument a CSS selector string and returns a function to determine if the event's target is eligible to handle that particular onClick event. *The CSS selector argument matches elements that should not handle the event. Also standard HTMLElements that is very possible to have on click events on their own should not handle the event. See CLICKABLE_ELEMENTS. * Fixes JSDoc @returns * Fixes tests * Fixes tests * Minor styling fixes Attachments should set cursor to default. Update your status button should be a button. makeIsEligibleForClick initial value for argument selector. * Fixes tests Co-authored-by: Mattermod <mattermod@users.noreply.github.com> (cherry picked from commit 6ed8a49) Co-authored-by: Kyriakos Z <3829551+koox00@users.noreply.github.com>
Documentation for: mattermost/mattermost-webapp#8342 Updated: - Messages > Work with Messages > Organizing Conversations using Collapsed Reply Threads (Beta) > Start or Reply to Threads - Updated Tip bullet point #1 to clarify that uses can click anywhere in a message in the center pane to view it/reply to it
Documentation for: mattermost/mattermost-webapp#8342 Updated: - Messages > Work with Messages > Organizing Conversations using Collapsed Reply Threads (Beta) > Start or Reply to Threads - Updated Tip bullet point #1 to clarify that uses can click anywhere in a message in the center pane to view it/reply to it
* Update conf.py * Update open-source-components.rst * Update release-lifecycle.rst * Reliable Websockets: default to true Documentation for: mattermost/mattermost#17890 Updated: - Set Up, Manage, Onboard, and Comply > Set Up Mattermost > Self-Managed Deployments > Configuration Settings > Experimental Settings only in config.json > Enable Reliable Websockets - Updated the default value of the config setting to ``true`` * PR didn't follow internal processes for submission * Re-added file deleted in error * Re-added the correct file that was deleted in error * MM-36779 - Add ChimeraOAuthProxyURL config option (#4928) * MM-36779 - Add ChimeraOAuthProxyURL config option Documentation for: mattermost/mattermost#17888 Updated: - Set Up, Manage, Onboard, and Comply > Set Up Mattermost > Self-Managed Deployments > Configuration Settings > Plugins (Beta) - Added the Chimera OAuth Proxy URL configuration setting * Added ChimeraOAuthProxyUrl to Telemetry * added note about the setting being available only via config.json * Update source/configure/configuration-settings.rst Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> * Update source/configure/configuration-settings.rst Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> * Reliable Websockets: default to true (#4918) Documentation for: mattermost/mattermost#17890 Updated: - Set Up, Manage, Onboard, and Comply > Set Up Mattermost > Self-Managed Deployments > Configuration Settings > Experimental Settings only in config.json > Enable Reliable Websockets - Updated the default value of the config setting to ``true`` * Added functionality to archive/unarchive teams from system console (#4927) * Added functionality to archive/unarchive teams from system console Documentation for: mattermost/mattermost-webapp#8129 Updated: - Set Up, Manage, Onboard, and Comply > Manage Mattermost > Self-Managed Deployments > Managing Team and Channel Members (E20) > Team Profile - Updated section to include details on how to archive/unarchive the team * Added archive/unarchive updates to Cloud-specific page * Updated LHS - Moved self-managed topic from all instances to self-managed - Added Cloud-specific topic * added mmctl equivalent for team restore * added mmctl equivalent for team restore (self-managed) * Update source/manage/cloud-team-and-channel.rst Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> * Update source/manage/team-channel-members.rst Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> * Update data-retention-policy.rst (#4937) * Update data-retention-policy.rst Adding docs for custom data retention policies. * Update data-retention-policy.rst * Update source/comply/data-retention-policy.rst Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update source/comply/data-retention-policy.rst Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update source/comply/data-retention-policy.rst Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update source/comply/data-retention-policy.rst Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update source/comply/data-retention-policy.rst Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update source/comply/data-retention-policy.rst Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update source/comply/data-retention-policy.rst Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update source/comply/data-retention-policy.rst Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update source/comply/data-retention-policy.rst Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update source/comply/data-retention-policy.rst Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update source/comply/data-retention-policy.rst Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update source/comply/data-retention-policy.rst Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update source/comply/data-retention-policy.rst Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update data-retention-policy.rst * Update data-retention-policy.rst * Update source/comply/data-retention-policy.rst Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update source/comply/data-retention-policy.rst Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update source/comply/data-retention-policy.rst Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update source/comply/data-retention-policy.rst Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update important-upgrade-notes.rst (#4811) * Update important-upgrade-notes.rst * Update important-upgrade-notes.rst * Update important-upgrade-notes.rst * Fix typos * MM-36547 Renamed 'Mute Channel' and 'Edit Channel Header' menus (#4941) Documentation for: mattermost/mattermost-webapp#8313 Updated: - Messaging > Manage Teams, Channels, and Members > Managing Channels > Creating a Direct or Group Message - Updated section to include mute, unmute, and edit header options for group and direct messages * MM-35722: CRT, post click open thread (#4942) Documentation for: mattermost/mattermost-webapp#8342 Updated: - Messages > Work with Messages > Organizing Conversations using Collapsed Reply Threads (Beta) > Start or Reply to Threads - Updated Tip bullet point #1 to clarify that uses can click anywhere in a message in the center pane to view it/reply to it * MM-35470 Disable config watching logic (#4951) * MM-35470 Disable config watching logic Documentation for: mattermost/mattermost#17913 Updated: - Set Up, Manage, Onboard, and Comply > Set Up Mattermost > Self-Managed Deployments > Configuration Settings - Updated introductory content to remove < v5.12 legacy note and add config watcher note and link to mmctl command * Update source/configure/configuration-settings.rst Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> * v5.38.0 Changelog (#4810) * Update self-managed-changelog.md * Update self-managed-changelog.md * Update self-managed-changelog.md * Update self-managed-changelog.md * Update self-managed-changelog.md * Update self-managed-changelog.md * Update self-managed-changelog.md * Apply suggestions from code review Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> * Update self-managed-changelog.md * Update self-managed-changelog.md * Update self-managed-changelog.md Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> Co-authored-by: Amy Blais <29708087+amyblais@users.noreply.github.com> Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Co-authored-by: Katie Wiersgalla <39744472+wiersgallak@users.noreply.github.com>
Summary
Clicking, anywhere on a post in the center channel while having CRT on should open the thread in RHS,
even for single messages.
The difficulty in this is that posts may contain other elements that
have
onClick
handlers, or even just links and buttons. In those cases weshould not open the RHS.
Added a
isEligibleForClick
utility function that tries to solve the aboveproblem.
Ticket Link
https://mattermost.atlassian.net/browse/MM-35722
Release Note