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

Site Logo: Discard unsaved changes when removing the last Site Logo block #37900

Open
stacimc opened this issue Jan 12, 2022 · 2 comments
Open
Labels
[Block] Site Logo Affects the Site Logo Block [Type] Enhancement A suggestion for improvement.

Comments

@stacimc
Copy link
Contributor

stacimc commented Jan 12, 2022

What problem does this address?

When you insert a Site Logo block, you can make changes to the image used for the site logo as well as the site icon (if you have the Use as site icon option toggled). If you remove the block before saving, these changes are retained -- so if you click 'Save' on the post, you will be prompted to save changes to the Logo and/or Icon. We should discard unsaved changes instead.

To reproduce:

  • Open a post and insert a Site Logo block.
  • Upload a new image into the block.
  • Remove the block.
  • Click 'Update' on the post and see that you are prompted to save changes to the Site Logo.

#35892 implemented a fix for this, but it did not behave reliably in the Site Editor and caused a bug with the site history (#37760) so it was removed in #37895. We should be careful to test that a fix for this does not reintroduce the history bug.

What is your proposed solution?

When a Site Logo block is removed, if it is the last Site Logo block in the post, we should discard any unsaved changes.

@Mamaduka
Copy link
Member

I think "Discard changes" in multi-entity saving UI could be useful for this - #36185.

@stacimc
Copy link
Contributor Author

stacimc commented Jan 12, 2022

Thanks for the link! The "Discard changes" UI will definitely improve the situation by adding a way to manually discard those changes, but I think in the case where the block with unsaved changes is removed, I would still expect those changes to be discarded automatically.

If I make updates to the Logo but change my mind and remove the block before saving, it may come as a surprise to still see 'Logo' in the pre-saving UI if I later save the post. Because the block has been removed the changes are not visible anywhere on the page, so it won't be clear what effect saving will have if I don't de-select and choose to Discard changes in the subsequent step.

Actually, I think this should be expanded beyond Site Logo to other blocks that are used to edit site entities: Site Title and Site Tagline at least, I'm not sure if there are others. The same slightly odd saving pattern exists there.

@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Site Logo Affects the Site Logo Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants