Skip to content
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 create summary button. #567

Merged
merged 3 commits into from
Nov 20, 2023
Merged

Add create summary button. #567

merged 3 commits into from
Nov 20, 2023

Conversation

crspeller
Copy link
Member

@crspeller crspeller commented Nov 16, 2023

Summary

Adds a create summary button when the AI plugin is available.

The button offloads the logic of what to do afterwards to the AI plugin.

Note that the button positioning varies from the designs because we don't support buttons below the attachments.

Designs: https://mattermost.atlassian.net/wiki/spaces/WD/pages/2510323713/UX+Documentation+for+v1.0#Summarize-Calls-plugin-recordings

image

@crspeller crspeller added 1: UX Review Requires review by ux 2: Dev Review Requires review by a core committer labels Nov 16, 2023
const useCallsPostButtonClicked = () => {
return useSelector<GlobalState, CallsPostButtonClickedFunc>((state) => {
//@ts-ignore plugins state is a thing
return state['plugins-' + aiPluginID]?.callsPostButtonClicked;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is supplied by the AI plugin. That way all the logic for what to do when the button is clicked is handled on the AI plugin side.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it, I think this is the right way of integrating between plugins.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here as well.
But otherwise, totally agree with Claudio -- this is the way to do it!

Copy link
Collaborator

@streamer45 streamer45 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

const useCallsPostButtonClicked = () => {
return useSelector<GlobalState, CallsPostButtonClickedFunc>((state) => {
//@ts-ignore plugins state is a thing
return state['plugins-' + aiPluginID]?.callsPostButtonClicked;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it, I think this is the right way of integrating between plugins.

Copy link
Member

@cpoile cpoile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Just commenting about a better way to put the selectors to improve performance.

const useCallsPostButtonClicked = () => {
return useSelector<GlobalState, CallsPostButtonClickedFunc>((state) => {
//@ts-ignore plugins state is a thing
return state['plugins-' + aiPluginID]?.callsPostButtonClicked;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here as well.
But otherwise, totally agree with Claudio -- this is the way to do it!

Copy link
Contributor

@matthewbirtch matthewbirtch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented inline on a few minor adjustments to CSS.

For reference, I also updated the figma file with the states for this button. Sorry for not including that previously.

justify-content: center;
gap: 6px;
border-radius: 4px;
background: rgba(var(--center-channel-color-rgb), 0.04);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make these adjustments to the default state of the button

background: rgba(var(--center-channel-color-rgb), 0.08);
color: rgba(var(--center-channel-color-rgb), 0.64);
font-size: 12px;
font-weight: 600;
line-height: 16px

background: rgba(var(--center-channel-color-rgb), 0.04);

:hover {
background: rgba(var(--center-channel-color-rgb), 0.08);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this adjustment to the hover state:

background: rgba(var(--center-channel-color-rgb), 0.08);

}

:active {
background: rgba(var(--button-bg-rgb), 0.08);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this adjustment to the active state:

color: var(--button-bg);

@crspeller
Copy link
Member Author

@matthewbirtch

Updated with your changes.
Normal:
image

Hover:
image

Active:
image

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (56d5ec0) 5.49% compared to head (ec8280f) 5.77%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##            main    #567      +/-   ##
========================================
+ Coverage   5.49%   5.77%   +0.28%     
========================================
  Files         24      24              
  Lines       4532    4554      +22     
========================================
+ Hits         249     263      +14     
- Misses      4265    4273       +8     
  Partials      18      18              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@crspeller crspeller requested a review from cpoile November 18, 2023 00:11
Copy link
Contributor

@matthewbirtch matthewbirtch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @crspeller

Copy link
Member

@cpoile cpoile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@streamer45 streamer45 added 3: Reviews Complete All reviewers have approved the pull request and removed 1: UX Review Requires review by ux 2: Dev Review Requires review by a core committer labels Nov 20, 2023
@streamer45 streamer45 added this to the v0.22.0 / MM 9.4 milestone Nov 20, 2023
@streamer45
Copy link
Collaborator

@crspeller Feel free to merge as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants