-
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
Site editor: Fix opening of save panel when using the save
shortcut
#59647
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
Nice one. I'd encourage a code sanity check, but I can't repro the referenced issue in this branch.
Size Change: +40 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
edit: I pushed the update. |
Ok, so there's a few confusing things when testing the PR. I just want to confirm that this is the right behavior that we want (also maybe we should compare with 6.4 to see what's the expected behavior)
It feels like there's a lot of inconsistencies and I'm not entirely sure if it's on purpose or not. cc @jasmussen @SaxonF |
I agree there are lots of inconsistencies but we have similar ones in post editor and I'm not sure if we should handle them separately or here(was leaning on follow up). For example in post editor if we have edits in more entities, the shortcut saves the main edited entity but not the other ones.
I think that's useful for when navigating in a different entity while in view mode. Maybe we could add one more check tied to the view mode to save directly if we're in the same page. We could do that here.
This is also related to: #38714, which suggests a preference for saving all entities at once(not only on shortcut use though). Design input is needed for sure about the way to move forward. |
Yeah, my main thing here is to check what we were doing in 6.4. If it's the same thing as this PR, let's ship and consider these separately. |
I have unfortunately not been that big of a part of the original discussion around the behavior, so it's very likely I'm missing nuance. My expectation would be that ⌘S only ever saves the page, because the expectation is that the shortcut saves the document I'm working on. If it opens the multi entity saving panel, it hasn't actually saved anything yet. Similarly, if it simply saves all the multi entities listed, without asking, then you're likely to get in trouble if you accidentally changed the site title without knowing, thinking you saved the page heading. To that end, I'd do either of the following two:
Which of the two to go with, I'd appreciate if someone with more historical knowledge of the shortcut can respond. |
What was the behavior in 6.4? |
Testing 6.4.3 just now: whether you have only local, or both local and global, in the site editor, ⌘S opens the multi entity saving panel. If you're in the post or page editor, ⌘S saves, and does so immediately. Saves the draft, or updates the page. If you're in the post or page editor and insert a site title, then change the site title, ⌘S still just saves or updates the local page, but does not open the multi entity saving panel — the "dot" to indicate there are such entities just remains. |
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.
Ok so it seems there's inconsistencies in here but also in 6.4 (post editor), so let's just merge this one as a fix for 6.5 and work towards @jasmussen's proposals for later.
This is what I would do. It's how the save button works currently and the state of a page may depend on other entities, like global styles for example. If we only save the page that isn't an accurate representation of what a user is seeing in front of them. |
…#59647) Co-authored-by: ntsekouras <[email protected]> Co-authored-by: jasmussen <[email protected]> Co-authored-by: youknowriad <[email protected]> Co-authored-by: SaxonF <[email protected]> Co-authored-by: annezazu <[email protected]> Co-authored-by: colorful-tones <[email protected]> Co-authored-by: sunil25393 <[email protected]>
I just cherry-picked this PR to the pick/wp-65-rc-2 branch to get it included in the next release: 00fcb56 |
…#59647) Co-authored-by: ntsekouras <[email protected]> Co-authored-by: jasmussen <[email protected]> Co-authored-by: youknowriad <[email protected]> Co-authored-by: SaxonF <[email protected]> Co-authored-by: annezazu <[email protected]> Co-authored-by: colorful-tones <[email protected]> Co-authored-by: sunil25393 <[email protected]>
What?
Fixes: #59472
This PR adjusts the checks for when to open the save panel in site editor when using the
save
keyboard shortcut.Right now when using the shortcut, the changes for the edited post are automatically saved by the
editor
global shortcut. So if we have changes only for the edited post there is no need to open the save panel at all.Additionally the current logic creates another bug which is if we make changes only to the edited post and use the shortcut, if we make more changes afterwards we cannot open the save panel by clicking the
save
button because the value we keep inedit site
store is wrong.Testing Instructions
save
shortcutsave
buttonview
modeTrunk
Screen.Recording.2024-03-06.at.5.06.04.PM.mov
This PR
thisPR.mov