mattermost-plugin-playbooks icon indicating copy to clipboard operation
mattermost-plugin-playbooks copied to clipboard

[MM-40300] Add plugin tooltips to some markdown components

Open mickmister opened this issue 2 years ago • 7 comments

Summary

This PR adds the hasPluginTooltips markdown option to a few places where the plugin is rendering markdown.

The main case that should have this imo is the UpdatePost component. That's where I keep expecting it work with linked GitHub issues/PRs in the update posts. I don't think I'm familiar enough with these components to know which ones make sense to have this functionality.

I've applied this change to:

  • components/update_post.tsx
  • components/backstage/playbook_runs/playbook_run/update_card.tsx
  • components/post_text.tsx
  • components/retrospective_post.tsx
  • components/formatted_markdown.tsx
  • components/rhs/rhs_about.tsx

Places using markdown I did not apply the change to:

  • components/checklist_item/title.tsx

Ticket Link

https://mattermost.atlassian.net/browse/MM-40300

Checklist

~~- [ ] Telemetry updated~~ ~~- [ ] Gated by experimental feature flag~~ ~~- [ ] Unit tests updated~~

mickmister avatar Aug 24 '22 04:08 mickmister

@Phrynobatrachus I've fixed the issue with passing in the options into messageHtmlToComponent

Even after fixing that, it seems like there might be some rendering problem with <LinkTooltip>.

Do you happen to be testing with the GitHub plugin? There is some setup needed to activate the tooltips, including connecting your account to GitHub.

Alternatively, you can test with the demo plugin. Once installed and enabled, you can make a post with URL www.test.com to activate the tooltip. You can install the plugin from this release https://github.com/mattermost/mattermost-plugin-demo/releases/tag/v0.9.0

mickmister avatar Aug 25 '22 20:08 mickmister

Ah that's definitely what I was missing, thanks for the pointer. Will re-review shortly.

Phrynobatrachus avatar Aug 25 '22 20:08 Phrynobatrachus

The usage in post_text introduces a few inconsistencies, for example a link will pop the tooltip in a RHS run description but not the backstage view of the same, similar (opposite w/ respect to channels <-> backstage) with retrospective posts. I'd prefer that we either keep it only on the status updates or square those up.

Phrynobatrachus avatar Aug 25 '22 21:08 Phrynobatrachus

@Phrynobatrachus What's your opinion on adding it to all places listed in the description? Or any specific places that don't make sense? I think supporting any place that would expect to have any URLs linked makes sense

mickmister avatar Aug 25 '22 23:08 mickmister

I think supporting any place that would expect to have any URLs linked makes sense

I agree, I'm cool with trying that.

Phrynobatrachus avatar Aug 26 '22 13:08 Phrynobatrachus

@Phrynobatrachus I have all of the places that use messageHtmlToComponent using hasPluginTooltips besides components/checklist_item/title.tsx now. Maybe we should get a UX review on this?

mickmister avatar Aug 30 '22 22:08 mickmister

Gentle bump for @abhijit-singh. Here's screenshots of the usages.

Screenshot from 2022-10-25 14-22-17 Screenshot from 2022-10-25 14-22-40 Screenshot from 2022-10-25 14-23-13 Screenshot from 2022-10-25 14-24-36 Screenshot from 2022-10-25 14-26-31 Screenshot from 2022-10-25 14-26-43

Phrynobatrachus avatar Oct 25 '22 18:10 Phrynobatrachus