-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Move left sidebar state to redux #26003
Conversation
Size Change: +186 B (0%) Total Size: 1.19 MB
ℹ️ View Unchanged
|
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.
This all makes sense to me. We could also use selectors to handle the "interdependent" behavior of the inserter and the navigation sidebar if we'd like. What do you think @Copons
We already have a PR merged which saves the active menu into the store: #25906 and we had a change by Jacopo here: #25957 Changes look good and I see all the benefits of moving more state into the store. Could you do a rebase and make sure we only one have solution living the codebase? 😄 (Moving forward with your solution) |
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 requested changes should be fairly straightforward, but overall this works well and I'm totally into this solution!
I've even proposed something like this in a comment in the other PR: #25906 (comment) 🙂
As @david-szabo97 said: please rebase and replace the old state introduced in #25906 with this.
Also, please keep the logic introduced in #25957: when closing the navigation, we should revert the active menu to root
(see reasons).
We could also use selectors to handle the "interdependent" behavior of the inserter and the navigation sidebar if we'd like.
@jeyip Could you please clarify this?
I think I'm misunderstanding what you're saying, but the reducer already makes inserter and navigation interdependent, by automatically closing one when we open the other. 🤔
ac740c6
to
7209ca4
Compare
I believe I had already incorporated
Additionally, I just moved the logic which sets the menu back to "root" when closing it from the navigation toggle component into the reducer. It's nice how much the reducer simplifies things! |
My mistake! You understood me perfectly @Copons.
|
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've pushed a minor update that replaces hardcoded menu names with their corresponding constants.
This works well for me so I'm approving the PR, but please double check if I've accidentally caused regressions. 🙂
@Copons thanks for that! Love the change. I'll do another round of testing and then merge. |
14f0121
to
9d66759
Compare
dbbdf2b
to
66a93a2
Compare
Description
Instead of prop drilling the sidebar state, this tries moving it to redux, and it also tries separating "navigation" from "inserter" state. cc @Copons (I think you mentioned this here.)
How has this been tested?
Screenshots
Types of changes
Checklist: