Skip to content

54370 site icon post review#6109

Closed
kebbet wants to merge 66 commits intoWordPress:trunkfrom
kebbet:54370-site-icon-post-review
Closed

54370 site icon post review#6109
kebbet wants to merge 66 commits intoWordPress:trunkfrom
kebbet:54370-site-icon-post-review

Conversation

@kebbet
Copy link

@kebbet kebbet commented Feb 14, 2024

https://core.trac.wordpress.org/ticket/54370

Work In Progess. Feel free to help out.

@github-actions
Copy link

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

aaronjorbin and others added 5 commits February 21, 2024 12:52
Co-authored-by: Erik <11491369+kebbet@users.noreply.github.com>
Co-authored-by: Erik <11491369+kebbet@users.noreply.github.com>
Co-authored-by: Erik <11491369+kebbet@users.noreply.github.com>
Co-authored-by: Erik <11491369+kebbet@users.noreply.github.com>
@aaronjorbin
Copy link
Member

Reverting and moving backward won't help get this in the best shape for the final release. Cropping is now fixed. Going to spend some time today getting things finalized for commit

Copy link
Author

@kebbet kebbet left a comment

Choose a reason for hiding this comment

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

Some notes on the current state of the PR.

.site-icon-preview-inline.settings .home-icon {
width: 58px;
height: 58px;
border-radius: 12.95px;
Copy link
Author

Choose a reason for hiding this comment

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

Can all pixel values be changed to be integers?

width: 200%;
height: 200%;
transform: translateX(-25%) translateY(-25%);
/* background: linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.3) 100%), var( --site-icon-url ) 50%/cover no-repeat; */
Copy link
Author

Choose a reason for hiding this comment

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

Remove unused code?

flex-shrink: 0;
z-index: 1;
border-radius: 9.824px;
box-shadow: 0 1.517px 3.034px 0 rgba(0, 0, 0, 0.1), 0 4.552px 4.552px 0 rgba(0, 0, 0, 0.09), 0 10.621px 6.828px 0 rgba(0, 0, 0, 0.05), 0 19.724px 7.586px 0 rgba(0, 0, 0, 0.01), 0 30.345px 8.345px 0 rgba(0, 0, 0, 0);
Copy link
Author

Choose a reason for hiding this comment

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

Can box-shadows be simplifed to use one shadow statement, this is really messy.

border-top: 1px solid rgba(255, 255, 255, 0.2);
border-left: 1px solid rgba(255, 255, 255, 0.2);
background: linear-gradient(180deg, #dcdcde 0%, #bdbdbd 100%);
box-shadow: 0 10px 22px 0 rgba(0, 0, 0, 0.2), 0 40px 40px 0 rgba(0, 0, 0, 0.17), 0 89px 53px 0 rgba(0, 0, 0, 0.1), 0 158px 63px 0 rgba(0, 0, 0, 0.03), 0 247px 69px 0 rgba(0, 0, 0, 0);
Copy link
Author

Choose a reason for hiding this comment

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

See above.

flex: 1 0 0;
border-radius: 4px;
background: #f6f7f7;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 5px 5px 0 rgba(0, 0, 0, 0.03), 0 12px 7px 0 rgba(0, 0, 0, 0.02), 0 22px 9px 0 rgba(0, 0, 0, 0.01), 0 34px 9px 0 rgba(0, 0, 0, 0);
Copy link
Author

Choose a reason for hiding this comment

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

See above.

border-radius: 12.95px;
}

.site-icon-preview-inline.settings:after {
Copy link
Author

@kebbet kebbet Feb 21, 2024

Choose a reason for hiding this comment

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

This background is not updated when a new icon is selected. Use an img-tag or similar instead? And when using solid colors as site icons it is hard to see the icon. Maybe add a opacity to this background, or even skip it.
And using a black site icon makes the shadow disappear.

bild

bild

bild

bild

bild

height: 44px;
flex-shrink: 0;
z-index: 1;
border-radius: 9.824px;
Copy link
Author

Choose a reason for hiding this comment

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

Make it 10px

<?php
/* translators: %s: Site Icon size in pixels. */
printf( __( 'Site Icons should be square and at least %s pixels.' ), '<strong>512 &times; 512</strong>' );
printf( __( 'Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. They should be square and at least %s pixels.' ), '<strong>512 &times; 512</strong>' );
Copy link
Author

Choose a reason for hiding this comment

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

Maybe wrap size string in a <code>-tag instead to align with other descriptive texts on the page?

bild

@kebbet
Copy link
Author

kebbet commented Feb 21, 2024

In src/wp-admin/css/site-icon.css, the CSS rulesets with the following selectors target also elements within the media modal dialog in the crop step, thus breaking the layout:

* .site-icon-preview .favicon-preview

* .site-icon-preview .favicon, .site-icon-preview .browser-title

* .site-icon-preview

This is how the media modal dialog looks like on current trunk:

trunk

Notice the layout of hte previews in the sidebar is broken.

This is how it is supposed to look, screenshot from WordPress 6.4: notice the previews are separated and vertically stacked:

6 4

This needs to be addressed.

@kebbet
Copy link
Author

kebbet commented Feb 21, 2024

Reverting and moving backward won't help get this in the best shape for the final release. Cropping is now fixed. Going to spend some time today getting things finalized for commit

Thanks for clarifying and fixing cropping.

@kebbet
Copy link
Author

kebbet commented Feb 21, 2024

First, have a look at the admin bar when the Site Title option is changed in options-general.php. Is it possible to use the same mechanism in the preview of the site icon? Basically update the tab name, while typing in the Site Title field above?

@kebbet
Copy link
Author

kebbet commented Feb 22, 2024

With the latest changes from me, this is how the section looks like

bild
bild
bild
bild

RTL
bild

@afercia
Copy link
Contributor

afercia commented Feb 22, 2024

Reverting and moving backward won't help get this in the best shape for the final release.

I kindly disagree. The design changes are outside of the scope of this PR. I'm not sure insisting broadening the scope of this PR is ideal. More importantly, given we're in Beta 2, I'm not sure it's any wise. At this point of the release cycle any change should be as small and self-contained as possible and only focused to fix bugs.

While I agree that updating the design with a more modern browser interface is a nice to have, that's not required for this functionality to work. Also, if updating the design of the preview is desired, I'd like to remind everyone that it would need to be be updated also in other two places;

  • in the media modal dialog sidebar
  • in the customizer

I'm not sure providing a different design only in the General Settings page would be ideal and help users as it would be clearly inconsistent and confusing. Extending the design changes to the media modal and customizer in this PR would be really out of scope and make this PR way larger than it was meant to be.

Lastly, @kebbet reported valid concerns about the latest changes that, in my opinion, would need more time to be addressed. As I see it, Beta 2 is not the best timing for such changes. I'd like to make clear that I'm nog against a design update, but that should go in a separate PR so that such changes can be better evaluated to establish if they fit with the release cycle process.

@WordPress WordPress deleted a comment from sofialeena Feb 22, 2024
@swissspidy
Copy link
Member

Hi all 👋

Just chiming in here since I see this ticket / PR has been open for a while now with a lot of activity, so I am just wondering if there's anything I can help with to ensure this is in a good shape to land in time for the next beta.

Could someone perhaps summarize the goals and contents of this pull request for me, maybe with a before/after comparison? Even just updating the PR title & description would be helpful.

Or maybe put another way: what are the issues with the current version in trunk that should be addressed in this release?

Thanks in advance 🙏


In the meantime, since I saw a comment about coding standards, missing whitespace, etc.: Please note that we have tools like Prettier, just use e.g. npx prettier --write src/js/_enqueues/admin/site-icon.js to format code according to the WP coding standards. Works with CSS too :)

Also, if the changes in the PR are too big to review in one go, perhaps they could be split into multiple PRs?

npx prettier@npm:wp-prettier@latest --write src/js/_enqueues/admin/site-icon.js

npx prettier@npm:wp-prettier@latest --write src/wp-admin/css/site-icon.css
@aaronjorbin
Copy link
Member

I've gone back and forth on this for the last few hours. On one hand, the new design more closely resembles the block editor and the current browser UI is outdated. On the other, the new design does not feel ready as it came in very late in the release cycle and as James notes, it hasn't considered edge cases. The improvements that are reflected in the screenshots seem to resolve the known issues, but I'm unsure. I also worry about integrating in this in three different places and then doing further interaction.

As I've mentioned multiple times, I think what's going to provide the best experience for the users of WordPress is an experience that is consistent across the different UIs. Iterating on the UI in the three different places is cumbersome at best and bug-inducing at worst.

Unless there is an objection, I think the path forward is:

  1. Rip out the new design and restore the battle-tested UI that is already in place in the customizer.
  2. Revisit the UI in 6.6. With any major desired UI changes coming well before beta 1.
  3. Port the alt text and description improvements to the customizer in a separate ticket. I would consider this a bug fix for a feature in 6.5 even though that UI isn't directly being touched(@swissspidy, would you agree?)

RE: Prettier. That command doesn't format correctly. I used
npx prettier@npm:wp-prettier@latest --write src/js/_enqueues/admin/site-icon.js and npx prettier@npm:wp-prettier@latest --write src/wp-admin/css/site-icon.css. Thanks!

@swissspidy
Copy link
Member

Thanks for the update & context @aaronjorbin! That sounds like a sensible path forward to me.

I see you just opened #6165 in the meantime. Would you like the group to review that one now? Just noting it's still in draft.

@aaronjorbin
Copy link
Member

I opened that PR so that it's ready if this path forward is desired without further clouding this one. The only differences are

1: I fixed the jshint issues that prettier caused 🤦
2: 984a20c is the commit that restores the old UI. Reviews of that are welcome; it's more red than green.

@kebbet kebbet closed this Aug 11, 2024
@kebbet kebbet deleted the 54370-site-icon-post-review branch August 11, 2024 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants