-
Notifications
You must be signed in to change notification settings - Fork 64
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
[MM-54367] Apply scope to the menu class #213
[MM-54367] Apply scope to the menu class #213
Conversation
I found that the |
webapp/src/widget/menu.scss
Outdated
.Menu, | ||
.SubMenuOption .SubMenu { | ||
.TodoMenu, | ||
.SubTodoMenuOption .SubTodoMenu { |
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.
I see changes in the code for Menu
->TodoMenu
. Is there any change for SubMenuOption
->SubTodoMenuOption
needed?
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.
I think it's not needed now. I added it for the future use-case.
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.
If there is no class name being used in the components SubTodoMenuOption
or SubTodoMenu
, then I think they should be removed from the scss file to avoid confusion. Likely, yagni
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.
@mickmister I removed the unused classnames.
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 for catching this and implementing the fix @kyeongsoosoo 👍
The changes LGTM. I just have one non-blocking suggestion to remove the class names from the scss file that are not being used in the React code SubTodoMenuOption
and SubTodoMenu
webapp/src/widget/menuWrapper.tsx
Outdated
@@ -19,7 +19,7 @@ const MenuWrapper = React.memo((props: Props) => { | |||
const [open, setOpen] = useState(Boolean(props.isOpen)); | |||
|
|||
if (!Array.isArray(props.children) || props.children.length !== 2) { | |||
throw new Error('MenuWrapper needs exactly 2 children'); | |||
throw new Error('TodoMenuWrapper needs exactly 2 children'); |
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.
The component should probably be renamed to TodoMenuWrapper
if we change this error message
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.
I reverted it back to MenuWrapper
to keep it the same as the other components.
webapp/src/widget/menu.scss
Outdated
.Menu, | ||
.SubMenuOption .SubMenu { | ||
.TodoMenu, | ||
.SubTodoMenuOption .SubTodoMenu { |
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.
If there is no class name being used in the components SubTodoMenuOption
or SubTodoMenu
, then I think they should be removed from the scss file to avoid confusion. Likely, yagni
.status-dropdown-menu { | ||
> .Menu { | ||
> .TodoMenu { |
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.
Unrelated to this PR, but it seems wrong to assume that the plugin's TodoMenu
component will always be a next-level descendant of the element that has status-dropdown-menu
class name
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.
I thought it would be okay because position
is applied separately to the TodoMenu classname.
https://github.com/mattermost/mattermost-plugin-todo/blob/a309a7ab63f0ea0ec7b91e7f46b22045e84ee08e/webapp/src/widget/menu.scss#L7-L10
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.
Right, but .status-dropdown-menu
is managed by the core webapp. At any point, the webapp could restructure itsrlf and do one of:
- Remove that class name altogether
- Change its component structure to have a component in between
.status-dropdown-menu
and the plugin's component
Both of these would make it so our plugin styles don't get used. The alternative is to not have the >
in the 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.
@mickmister @kyeongsoosoo
The issue has been solved in this PR. The UI does not get hampered through this fix, but the user is still able to resize the LHS while the channel menu is opened.
Steps to reproduce:-
- Open the channel menu.
- Try to resize the LHS.
The user is able to resize the LHS which contrasts the expected result in the issue.
@AayushChaudhary0001 I think the issue you point out may be unrelated to this PR. If the issue the PR intends to fix is fixed by this PR, can you please approve it? We can make a separate issue for the main repository if there's an unrelated issue |
@kyeongsoosoo Heads up that there are some linting issues to resolve on the PR |
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #213 +/- ##
======================================
Coverage 6.42% 6.42%
======================================
Files 11 11
Lines 1712 1712
======================================
Hits 110 110
Misses 1594 1594
Partials 8 8 ☔ View full report in Codecov by Sentry. |
/update-branch |
@mickmister Could you help me re-run the test? I fixed the linting issue. |
@kyeongsoosoo Thanks for providing a fix 👍 |
@mickmister Yes, I am approving this PR and we can create a different issue for this, but in the description of the PR, the expected result in the mentioned ticket should be similar to what has been tested, so kindly update that. |
@kyeongsoosoo Merging this, as it's obvious the issue that this plugin was causing is fixed. Is it your understanding that mattermost/mattermost#24455 is solved, or is there additional work to be done in the main repo to completely resolve the issue? |
@mickmister Sorry for the late reply. |
Summary
Related conversation: https://community.mattermost.com/core/pl/cfk9y3o8jpy9tn4dhz4cd4ioqr
I found that the Todo plugin's css affects the entire
Menu
component.I applied scope to the
Menu
component.Ticket Link
Fixes mattermost/mattermost#24455
Jira https://mattermost.atlassian.net/browse/MM-54367