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

Preferences modal redesign #28329

Merged
merged 19 commits into from
Jan 29, 2021
Merged

Preferences modal redesign #28329

merged 19 commits into from
Jan 29, 2021

Conversation

ntsekouras
Copy link
Contributor

@ntsekouras ntsekouras commented Jan 19, 2021

Description

Resolves: #24965

This is a first stab at changing the Preferences modal. Design was based from this comment: #24965 (comment).

This PR requires feedback about design and technical implementation, regarding the usage of these components or creating new ones. Please don't focus too much on small code details for now, as this is in draft status.

Notes

We don't have a responsive component for handling the desired design(both large and smaller viewports), so it seems to me that the usage of different components cannot be avoided. For the larger viewports I used TabPanel component with a couple of new css rules and worked just fine.

For the smaller viewports I used the Navigation component, which is also used in FSE navigation menu. Alternatively a new component must be created, unless there is one that I'm not aware of.

In this PR Block manager is NOT moved in Preferences, since it needs to be refactored with the panels design in the issue's mockup and also creates some extra issues with the sticky styling in combination with the Modal. I believe it will make this PR unnecessarily bigger and can be done in a follow up.

I haven't touched the tests yet (fixing and creating new ones and updating utils) and haven't taken care of the active tab sync between the viewports.

Feedback/help needed

  1. For the small viewports version there is not enough feedback so I think this design is still open for iterations, especially regarding a11y.
  2. I'll will definitely need some help for style polishing, if the current direction of this PR seems to be the way to go.

Screenshots

Gifs are from starting plan with the Block Manager which will be moved in a follow up.

Larger Viewports

webPref

Smaller viewports

mobilePref

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

@ntsekouras ntsekouras added [Type] Enhancement A suggestion for improvement. General Interface Parts of the UI which don't fall neatly under other labels. Needs Design Feedback Needs general design feedback. Needs Technical Feedback Needs testing from a developer perspective. labels Jan 19, 2021
@ntsekouras ntsekouras requested a review from a team January 19, 2021 14:30
@ntsekouras ntsekouras self-assigned this Jan 19, 2021
@github-actions
Copy link

github-actions bot commented Jan 19, 2021

Size Change: +80.9 kB (+6%) 🔍

Total Size: 1.37 MB

Filename Size Change
build/a11y/index.js 1.14 kB +2 B (0%)
build/annotations/index.js 3.77 kB -27 B (-1%)
build/api-fetch/index.js 3.4 kB -16 B (0%)
build/autop/index.js 2.84 kB -3 B (0%)
build/block-directory/index.js 9.07 kB -5 B (0%)
build/block-editor/index.js 123 kB +1.22 kB (+1%)
build/block-editor/style-rtl.css 12 kB +33 B (0%)
build/block-editor/style.css 12 kB +33 B (0%)
build/block-library/blocks/archives/editor-rtl.css 61 B -135 B (-69%) 🏆
build/block-library/blocks/archives/editor.css 60 B -136 B (-69%) 🏆
build/block-library/blocks/audio/editor-rtl.css 58 B -136 B (-70%) 🏆
build/block-library/blocks/audio/editor.css 58 B -136 B (-70%) 🏆
build/block-library/blocks/audio/style-rtl.css 103 B -122 B (-54%) 🏆
build/block-library/blocks/audio/style.css 103 B -122 B (-54%) 🏆
build/block-library/blocks/block/editor-rtl.css 161 B -122 B (-43%) 🎉
build/block-library/blocks/block/editor.css 161 B -122 B (-43%) 🎉
build/block-library/blocks/button/editor-rtl.css 475 B -101 B (-18%) 👏
build/block-library/blocks/button/editor.css 474 B -103 B (-18%) 👏
build/block-library/blocks/button/style-rtl.css 453 B -99 B (-18%) 👏
build/block-library/blocks/button/style.css 451 B -101 B (-18%) 👏
build/block-library/blocks/buttons/editor-rtl.css 227 B -118 B (-34%) 🎉
build/block-library/blocks/buttons/editor.css 227 B -119 B (-34%) 🎉
build/block-library/blocks/buttons/style-rtl.css 297 B -122 B (-29%) 🎉
build/block-library/blocks/buttons/style.css 297 B -122 B (-29%) 🎉
build/block-library/blocks/calendar/style-rtl.css 208 B -111 B (-35%) 🎉
build/block-library/blocks/calendar/style.css 208 B -111 B (-35%) 🎉
build/block-library/blocks/categories/editor-rtl.css 84 B -126 B (-60%) 🏆
build/block-library/blocks/categories/editor.css 83 B -126 B (-60%) 🏆
build/block-library/blocks/categories/style-rtl.css 79 B -129 B (-62%) 🏆
build/block-library/blocks/categories/style.css 79 B -129 B (-62%) 🏆
build/block-library/blocks/code/style-rtl.css 90 B -126 B (-58%) 🏆
build/block-library/blocks/code/style.css 90 B -126 B (-58%) 🏆
build/block-library/blocks/columns/editor-rtl.css 190 B -110 B (-37%) 🎉
build/block-library/blocks/columns/editor.css 190 B -109 B (-36%) 🎉
build/block-library/blocks/columns/style-rtl.css 421 B -108 B (-20%) 🎉
build/block-library/blocks/columns/style.css 421 B -107 B (-20%) 🎉
build/block-library/blocks/cover/editor-rtl.css 392 B -132 B (-25%) 🎉
build/block-library/blocks/cover/editor.css 393 B -129 B (-25%) 🎉
build/block-library/blocks/cover/style-rtl.css 1.25 kB -55 B (-4%)
build/block-library/blocks/cover/style.css 1.25 kB -54 B (-4%)
build/block-library/blocks/embed/editor-rtl.css 486 B -108 B (-18%) 👏
build/block-library/blocks/embed/editor.css 486 B -109 B (-18%) 👏
build/block-library/blocks/embed/style-rtl.css 375 B -114 B (-23%) 🎉
build/block-library/blocks/embed/style.css 375 B -114 B (-23%) 🎉
build/block-library/blocks/file/editor-rtl.css 199 B -115 B (-37%) 🎉
build/block-library/blocks/file/editor.css 198 B -115 B (-37%) 🎉
build/block-library/blocks/file/style-rtl.css 248 B -104 B (-30%) 🎉
build/block-library/blocks/file/style.css 248 B -104 B (-30%) 🎉
build/block-library/blocks/freeform/editor-rtl.css 2.45 kB -98 B (-4%)
build/block-library/blocks/freeform/editor.css 2.45 kB -99 B (-4%)
build/block-library/blocks/gallery/editor-rtl.css 679 B -104 B (-13%) 👏
build/block-library/blocks/gallery/editor.css 679 B -104 B (-13%) 👏
build/block-library/blocks/gallery/style-rtl.css 1.07 kB -106 B (-9%)
build/block-library/blocks/gallery/style.css 1.06 kB -106 B (-9%)
build/block-library/blocks/group/editor-rtl.css 318 B -115 B (-27%) 🎉
build/block-library/blocks/group/editor.css 317 B -115 B (-27%) 🎉
build/block-library/blocks/group/style-rtl.css 57 B -133 B (-70%) 🏆
build/block-library/blocks/group/style.css 57 B -133 B (-70%) 🏆
build/block-library/blocks/heading/editor-rtl.css 129 B -119 B (-48%) 🎉
build/block-library/blocks/heading/editor.css 129 B -119 B (-48%) 🎉
build/block-library/blocks/heading/style-rtl.css 76 B -136 B (-64%) 🏆
build/block-library/blocks/heading/style.css 76 B -136 B (-64%) 🏆
build/block-library/blocks/html/editor-rtl.css 281 B -103 B (-27%) 🎉
build/block-library/blocks/html/editor.css 281 B -104 B (-27%) 🎉
build/block-library/blocks/image/editor-rtl.css 717 B -84 B (-10%) 👏
build/block-library/blocks/image/editor.css 716 B -84 B (-10%) 👏
build/block-library/blocks/image/style-rtl.css 477 B -92 B (-16%) 👏
build/block-library/blocks/image/style.css 478 B -92 B (-16%) 👏
build/block-library/blocks/latest-comments/editor-rtl.css 159 B -118 B (-43%) 🎉
build/block-library/blocks/latest-comments/editor.css 158 B -117 B (-43%) 🎉
build/block-library/blocks/latest-comments/style-rtl.css 269 B -113 B (-30%) 🎉
build/block-library/blocks/latest-comments/style.css 269 B -113 B (-30%) 🎉
build/block-library/blocks/latest-posts/editor-rtl.css 137 B -117 B (-46%) 🎉
build/block-library/blocks/latest-posts/editor.css 137 B -117 B (-46%) 🎉
build/block-library/blocks/latest-posts/style-rtl.css 523 B -111 B (-18%) 👏
build/block-library/blocks/latest-posts/style.css 522 B -112 B (-18%) 👏
build/block-library/blocks/list/editor-rtl.css 65 B -138 B (-68%) 🏆
build/block-library/blocks/list/editor.css 65 B -138 B (-68%) 🏆
build/block-library/blocks/list/style-rtl.css 63 B -138 B (-69%) 🏆
build/block-library/blocks/list/style.css 63 B -138 B (-69%) 🏆
build/block-library/blocks/media-text/editor-rtl.css 191 B -120 B (-39%) 🎉
build/block-library/blocks/media-text/editor.css 191 B -120 B (-39%) 🎉
build/block-library/blocks/media-text/style-rtl.css 535 B -107 B (-17%) 👏
build/block-library/blocks/media-text/style.css 532 B -108 B (-17%) 👏
build/block-library/blocks/more/editor-rtl.css 434 B -111 B (-20%) 🎉
build/block-library/blocks/more/editor.css 434 B -111 B (-20%) 🎉
build/block-library/blocks/navigation-link/editor-rtl.css 392 B -111 B (-22%) 🎉
build/block-library/blocks/navigation-link/editor.css 394 B -110 B (-22%) 🎉
build/block-library/blocks/navigation-link/style-rtl.css 704 B -101 B (-13%) 👏
build/block-library/blocks/navigation-link/style.css 702 B -101 B (-13%) 👏
build/block-library/blocks/navigation/editor-rtl.css 1.38 kB -108 B (-7%)
build/block-library/blocks/navigation/editor.css 1.37 kB -109 B (-7%)
build/block-library/blocks/navigation/style-rtl.css 183 B -106 B (-37%) 🎉
build/block-library/blocks/navigation/style.css 183 B -106 B (-37%) 🎉
build/block-library/blocks/nextpage/editor-rtl.css 395 B -112 B (-22%) 🎉
build/block-library/blocks/nextpage/editor.css 395 B -112 B (-22%) 🎉
build/block-library/blocks/paragraph/editor-rtl.css 109 B -127 B (-54%) 🏆
build/block-library/blocks/paragraph/editor.css 109 B -127 B (-54%) 🏆
build/block-library/blocks/paragraph/style-rtl.css 273 B -119 B (-30%) 🎉
build/block-library/blocks/paragraph/style.css 273 B -119 B (-30%) 🎉
build/block-library/blocks/post-author/editor-rtl.css 209 B -120 B (-36%) 🎉
build/block-library/blocks/post-author/editor.css 209 B -120 B (-36%) 🎉
build/block-library/blocks/post-author/style-rtl.css 183 B -120 B (-40%) 🎉
build/block-library/blocks/post-author/style.css 184 B -119 B (-39%) 🎉
build/block-library/blocks/post-comments-form/style-rtl.css 249 B -109 B (-30%) 🎉
build/block-library/blocks/post-comments-form/style.css 249 B -109 B (-30%) 🎉
build/block-library/blocks/post-content/editor-rtl.css 139 B -123 B (-47%) 🎉
build/block-library/blocks/post-content/editor.css 139 B -123 B (-47%) 🎉
build/block-library/blocks/post-excerpt/editor-rtl.css 73 B -133 B (-65%) 🏆
build/block-library/blocks/post-excerpt/editor.css 73 B -133 B (-65%) 🏆
build/block-library/blocks/post-featured-image/editor-rtl.css 338 B -115 B (-25%) 🎉
build/block-library/blocks/post-featured-image/editor.css 338 B -115 B (-25%) 🎉
build/block-library/blocks/post-featured-image/style-rtl.css 100 B -123 B (-55%) 🏆
build/block-library/blocks/post-featured-image/style.css 100 B -123 B (-55%) 🏆
build/block-library/blocks/preformatted/style-rtl.css 63 B -130 B (-67%) 🏆
build/block-library/blocks/preformatted/style.css 63 B -130 B (-67%) 🏆
build/block-library/blocks/pullquote/editor-rtl.css 183 B -121 B (-40%) 🎉
build/block-library/blocks/pullquote/editor.css 183 B -121 B (-40%) 🎉
build/block-library/blocks/pullquote/style-rtl.css 316 B -112 B (-26%) 🎉
build/block-library/blocks/pullquote/style.css 316 B -112 B (-26%) 🎉
build/block-library/blocks/query-loop/editor-rtl.css 90 B -127 B (-59%) 🏆
build/block-library/blocks/query-loop/editor.css 89 B -127 B (-59%) 🏆
build/block-library/blocks/query-loop/style-rtl.css 315 B -112 B (-26%) 🎉
build/block-library/blocks/query-loop/style.css 317 B -112 B (-26%) 🎉
build/block-library/blocks/query-pagination-numbers/editor-rtl.css 122 B -121 B (-50%) 🏆
build/block-library/blocks/query-pagination-numbers/editor.css 121 B -119 B (-50%) 🏆
build/block-library/blocks/query-pagination/editor-rtl.css 270 B -120 B (-31%) 🎉
build/block-library/blocks/query-pagination/editor.css 262 B -117 B (-31%) 🎉
build/block-library/blocks/query-pagination/style-rtl.css 168 B -120 B (-42%) 🎉
build/block-library/blocks/query-pagination/style.css 168 B -120 B (-42%) 🎉
build/block-library/blocks/query/editor-rtl.css 159 B -120 B (-43%) 🎉
build/block-library/blocks/query/editor.css 160 B -119 B (-43%) 🎉
build/block-library/blocks/quote/editor-rtl.css 61 B -134 B (-69%) 🏆
build/block-library/blocks/quote/editor.css 61 B -134 B (-69%) 🏆
build/block-library/blocks/quote/style-rtl.css 169 B -115 B (-40%) 🎉
build/block-library/blocks/quote/style.css 169 B -116 B (-41%) 🎉
build/block-library/blocks/rss/editor-rtl.css 201 B -106 B (-35%) 🎉
build/block-library/blocks/rss/editor.css 202 B -107 B (-35%) 🎉
build/block-library/blocks/rss/style-rtl.css 290 B -104 B (-26%) 🎉
build/block-library/blocks/rss/style.css 290 B -103 B (-26%) 🎉
build/block-library/blocks/search/editor-rtl.css 165 B -120 B (-42%) 🎉
build/block-library/blocks/search/editor.css 165 B -120 B (-42%) 🎉
build/block-library/blocks/search/style-rtl.css 342 B -112 B (-25%) 🎉
build/block-library/blocks/search/style.css 344 B -112 B (-25%) 🎉
build/block-library/blocks/separator/editor-rtl.css 99 B -130 B (-57%) 🏆
build/block-library/blocks/separator/editor.css 99 B -130 B (-57%) 🏆
build/block-library/blocks/separator/style-rtl.css 236 B -116 B (-33%) 🎉
build/block-library/blocks/separator/style.css 236 B -116 B (-33%) 🎉
build/block-library/blocks/shortcode/editor-rtl.css 504 B -99 B (-16%) 👏
build/block-library/blocks/shortcode/editor.css 504 B -99 B (-16%) 👏
build/block-library/blocks/site-logo/editor-rtl.css 201 B -120 B (-37%) 🎉
build/block-library/blocks/site-logo/editor.css 201 B -120 B (-37%) 🎉
build/block-library/blocks/site-logo/style-rtl.css 117 B -121 B (-51%) 🏆
build/block-library/blocks/site-logo/style.css 117 B -121 B (-51%) 🏆
build/block-library/blocks/social-link/editor-rtl.css 164 B -119 B (-42%) 🎉
build/block-library/blocks/social-link/editor.css 165 B -118 B (-42%) 🎉
build/block-library/blocks/social-links/editor-rtl.css 711 B -100 B (-12%) 👏
build/block-library/blocks/social-links/editor.css 712 B -98 B (-12%) 👏
build/block-library/blocks/social-links/style-rtl.css 1.37 kB -110 B (-7%)
build/block-library/blocks/social-links/style.css 1.37 kB -109 B (-7%)
build/block-library/blocks/spacer/editor-rtl.css 302 B -114 B (-27%) 🎉
build/block-library/blocks/spacer/editor.css 302 B -114 B (-27%) 🎉
build/block-library/blocks/spacer/style-rtl.css 48 B -136 B (-74%) 🏆
build/block-library/blocks/spacer/style.css 48 B -136 B (-74%) 🏆
build/block-library/blocks/subhead/editor-rtl.css 99 B -124 B (-56%) 🏆
build/block-library/blocks/subhead/editor.css 99 B -124 B (-56%) 🏆
build/block-library/blocks/subhead/style-rtl.css 80 B -130 B (-62%) 🏆
build/block-library/blocks/subhead/style.css 80 B -130 B (-62%) 🏆
build/block-library/blocks/table/editor-rtl.css 489 B -104 B (-18%) 👏
build/block-library/blocks/table/editor.css 489 B -104 B (-18%) 👏
build/block-library/blocks/table/style-rtl.css 386 B -115 B (-23%) 🎉
build/block-library/blocks/table/style.css 386 B -115 B (-23%) 🎉
build/block-library/blocks/tag-cloud/editor-rtl.css 118 B -119 B (-50%) 🏆
build/block-library/blocks/tag-cloud/editor.css 118 B -117 B (-50%) 🏆
build/block-library/blocks/tag-cloud/style-rtl.css 94 B -127 B (-57%) 🏆
build/block-library/blocks/tag-cloud/style.css 94 B -127 B (-57%) 🏆
build/block-library/blocks/template-part/editor-rtl.css 680 B -114 B (-14%) 👏
build/block-library/blocks/template-part/editor.css 679 B -115 B (-14%) 👏
build/block-library/blocks/text-columns/editor-rtl.css 95 B -125 B (-57%) 🏆
build/block-library/blocks/text-columns/editor.css 95 B -125 B (-57%) 🏆
build/block-library/blocks/text-columns/style-rtl.css 166 B -117 B (-41%) 🎉
build/block-library/blocks/text-columns/style.css 166 B -117 B (-41%) 🎉
build/block-library/blocks/verse/editor-rtl.css 62 B -132 B (-68%) 🏆
build/block-library/blocks/verse/editor.css 62 B -132 B (-68%) 🏆
build/block-library/blocks/verse/style-rtl.css 87 B -128 B (-60%) 🏆
build/block-library/blocks/verse/style.css 87 B -128 B (-60%) 🏆
build/block-library/blocks/video/editor-rtl.css 504 B -113 B (-18%) 👏
build/block-library/blocks/video/editor.css 503 B -114 B (-18%) 👏
build/block-library/blocks/video/style-rtl.css 193 B -110 B (-36%) 🎉
build/block-library/blocks/video/style.css 193 B -111 B (-37%) 🎉
build/block-library/editor-rtl.css 9.06 kB -140 B (-2%)
build/block-library/editor.css 9.05 kB -137 B (-1%)
build/block-library/index.js 144 kB +381 B (0%)
build/block-library/style-rtl.css 8.62 kB -37 B (0%)
build/block-library/style.css 8.61 kB -43 B (0%)
build/block-library/theme-rtl.css 748 B -112 B (-13%) 👏
build/block-library/theme.css 748 B -112 B (-13%) 👏
build/block-serialization-default-parser/index.js 1.88 kB -5 B (0%)
build/blocks/index.js 48.3 kB +184 B (0%)
build/components/index.js 275 kB +102 kB (+59%) 🆘
build/components/style-rtl.css 15.5 kB +63 B (0%)
build/components/style.css 15.5 kB +64 B (0%)
build/compose/index.js 11.2 kB -85 B (-1%)
build/core-data/index.js 16.8 kB +1.58 kB (+10%) ⚠️
build/data-controls/index.js 830 B +1 B (0%)
build/data/index.js 8.8 kB -183 B (-2%)
build/deprecated/index.js 768 B -1 B (0%)
build/dom/index.js 4.93 kB -17 B (0%)
build/edit-navigation/index.js 11.1 kB -37 B (0%)
build/edit-post/index.js 307 kB +360 B (0%)
build/edit-post/style-rtl.css 6.79 kB +276 B (+4%)
build/edit-post/style.css 6.78 kB +275 B (+4%)
build/edit-site/index.js 24.1 kB -127 B (-1%)
build/edit-site/style-rtl.css 4.04 kB +22 B (+1%)
build/edit-site/style.css 4.04 kB +22 B (+1%)
build/edit-widgets/index.js 20 kB -3.61 kB (-15%) 👏
build/edit-widgets/style-rtl.css 3.2 kB +28 B (+1%)
build/edit-widgets/style.css 3.2 kB +24 B (+1%)
build/editor/index.js 41.8 kB -102 B (0%)
build/element/index.js 4.62 kB -8 B (0%)
build/format-library/index.js 6.76 kB +2 B (0%)
build/format-library/style-rtl.css 637 B +17 B (+3%)
build/format-library/style.css 639 B +18 B (+3%)
build/hooks/index.js 2.27 kB -2 B (0%)
build/i18n/index.js 3.74 kB +173 B (+5%) 🔍
build/is-shallow-equal/index.js 699 B +2 B (0%)
build/keyboard-shortcuts/index.js 2.54 kB -5 B (0%)
build/keycodes/index.js 1.93 kB -9 B (0%)
build/list-reusable-blocks/index.js 3.15 kB -2 B (0%)
build/media-utils/index.js 5.33 kB +16 B (0%)
build/notices/index.js 1.85 kB -3 B (0%)
build/nux/index.js 3.41 kB -15 B (0%)
build/plugins/index.js 2.54 kB +1 B (0%)
build/primitives/index.js 1.42 kB -13 B (-1%)
build/redux-routine/index.js 2.84 kB +2 B (0%)
build/reusable-blocks/index.js 2.92 kB -5 B (0%)
build/rich-text/index.js 13.4 kB -96 B (-1%)
build/token-list/index.js 1.27 kB +2 B (0%)
build/url/index.js 3.02 kB -3 B (0%)
build/viewport/index.js 1.86 kB +1 B (0%)
build/warning/index.js 1.14 kB +1 B (0%)
ℹ️ View Unchanged
Filename Size Change
build/blob/index.js 665 B 0 B
build/block-directory/style-rtl.css 1.01 kB 0 B
build/block-directory/style.css 1.01 kB 0 B
build/block-library/common-rtl.css 1.01 kB 0 B
build/block-library/common.css 1.01 kB 0 B
build/block-serialization-spec-parser/index.js 3.06 kB 0 B
build/date/index.js 31.8 kB 0 B
build/dom-ready/index.js 571 B 0 B
build/edit-navigation/style-rtl.css 938 B 0 B
build/edit-navigation/style.css 944 B 0 B
build/editor/editor-styles-rtl.css 543 B 0 B
build/editor/editor-styles.css 545 B 0 B
build/editor/style-rtl.css 3.89 kB 0 B
build/editor/style.css 3.89 kB 0 B
build/escape-html/index.js 735 B 0 B
build/html-entities/index.js 623 B 0 B
build/list-reusable-blocks/style-rtl.css 629 B 0 B
build/list-reusable-blocks/style.css 628 B 0 B
build/nux/style-rtl.css 731 B 0 B
build/nux/style.css 727 B 0 B
build/priority-queue/index.js 790 B 0 B
build/server-side-render/index.js 2.77 kB 0 B
build/shortcode/index.js 1.7 kB 0 B
build/wordcount/index.js 1.22 kB 0 B

compressed-size-action

@gziolo gziolo added the Needs Accessibility Feedback Need input from accessibility label Jan 19, 2021
@jasmussen
Copy link
Contributor

Really nice and simple PR that takes a giant ticket and gets it going. Well done!

Screenshot 2021-01-20 at 08 25 17

When opening, focus goes from the modal, to the close button, to the tabs on the left. The tabs on the left are navigated with the arrow keys. All good. But the tab needs a focus style:

Screenshot 2021-01-20 at 08 27 37

I'd recommend just using the same standard focus style we use everywhere else:

Screenshot 2021-01-20 at 08 28 26

I don't recall what control we have of the width of the modal, but I'd love to see it be just a teensy bit wider than this by default.

Screenshot 2021-01-20 at 08 28 56

It doesn't feel like we have established a well thought out hierarchy of heading sizes. "Preferences" is a H1, "Choose your own experience" is a H2. The order is correct, but there's something about the font sizes that looks not as considered as it could be. This is perhaps best solved as a separate issue, but it's something that would benefit this effort.

We don't actually use this gray active style anywhere else:

Screenshot 2021-01-20 at 08 44 29

We sort of will, when #27331 gets a bit further (see toggled color swatch). But otherwise the most used pattern is to have this blue indicator:

Screenshot 2021-01-20 at 08 42 42

I don't necessarily think that blue indicator is the best to use here either. Another problem is that "General" doesn't align to "Preferences", because of the big box padding.

I tried a quick stab at an alternative, but that's also not great:

Screenshot 2021-01-20 at 08 49 13

I think we can probably go with the gray background for now, and we can explore if/when we get a better pattern. But let's add a 2px border radius to the gray square, and make the non-active menu items be normal font weight:

Screenshot 2021-01-20 at 08 50 36

Finally, there's a different spacing between Title/Helptext and switch on this screen:

Screenshot 2021-01-20 at 08 25 58

Compared to this screen:

Screenshot 2021-01-20 at 08 26 00

That's a lot of small things, but it should be quick to address! Let me know if I can help.

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

This is very cool.
I left some comments but the code is very good in general.

width: 400px;
padding-left: $grid-unit-30;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels like there's too much CSS needed for this. Were the base components styles (TabPanel and Navigation) not enough to achieve the desired result? Do we want to move some of these styles to the generic component or are these specific to the Preferences modal? Do we need the styles to be different from the original ones that come from the UI components?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately there will be more css changes :) - I wanted to get the first feedback. Navigation component was built for FSE with a dark theme so it's not fitting really well here. But since we're proceeding with this approach I'll explore the best place to put/change styles.

Copy link
Contributor

Choose a reason for hiding this comment

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

Navigation component was built for FSE with a dark theme so it's not fitting really well here.

Yeah, for instance this makes me wonder if the Navigation component need to have dark styles :). Ideally, it just works no matter its container background, alternatively it could support both with a prop. isLight/isDark

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what I'm thinking as well!

Copy link
Member

Choose a reason for hiding this comment

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

I think @ItsJonQ already had a light / dark version of this, which is going to be used (as light) in the global styles case.

Copy link

Choose a reason for hiding this comment

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

For context, light/dark mode is built into the Navigator component from the new component system.

The one we currently have in @wordpress/components isn't using that yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Regarding the css in Tabs, I think it's okay to leave it here, based on Joen's comments:

We don't actually use this gray active style anywhere else
I think we can probably go with the gray background for now, and we can explore if/when we get a better pattern.

Regarding the Navigation css, I'm not sure how to properly integrate it in the component with @emotion (css-in-js).
Help with that and a sanity check on css rules would be really appreciated! @jasmussen, @ItsJonQ

@ntsekouras
Copy link
Contributor Author

Thanks for reviewing @jasmussen and @youknowriad! I think the approach is validated roughly :) in both design and code perspectives, so I'll proceed on exploring in depth and polish this PR.

@ItsJonQ
Copy link

ItsJonQ commented Jan 20, 2021

Haii! I took a quick look. Micro adjustments adjust (suggestions by @jasmussen ), an issue I've spotted would be the Modal header disappearing when scrolling down a long list:

Screen Shot 2021-01-20 at 12 08 07 PM

From what I can see, it looks like there's a structural issue with the Modal setup.

The entire Modal frame is scrollable, and the header/content are rendered inside.
The Header is stuck at the top using position:sticky rather than having something like this:

<Frame>
  <Header>
  <Content>
</Frame>

(with <Content /> being scrollable rather than the entire frame)

I may be wrong, but this feels like a deeper issue with the Modal component rather than this specific implementation.


This aside. To achieve a more comfortable width (as @jasmussen had suggested) we could add the following CSS to .edit-post-preferences-modal

    width: calc(100% - 32px);
    max-width: 920px;

Of course, adjust the numbers as needed.

@ntsekouras
Copy link
Contributor Author

Hey @ItsJonQ - thanks for checking!

From what I can see, it looks like there's a structural issue with the Modal setup.

I noticed that too as I struggle to make the sticky parts in block manager and it's quite difficult to handle (at least for me)..
I think it's better to leave block manager outside of this first iteration and create a follow up for the move to Preferences and refactor it to have Panels.

@ntsekouras ntsekouras added the [Package] E2E Test Utils /packages/e2e-test-utils label Jan 21, 2021
@ntsekouras ntsekouras marked this pull request as ready for review January 21, 2021 13:16
@jasmussen
Copy link
Contributor

Alright, I pushed some polish to use inherit instead of initial, so we can support IE. I also made the dialog wider on the medium breakpoint:

Screenshot 2021-01-27 at 10 36 02

Two thoughts:

  • We need for this navigation component to be smarter about its context. Its color values appear to currently be hardcoded to work in a dark left-FSE-menu environment. If they are to be used outside of that, the colors or the component should probably be smarter, so we don't need to override them in this way.
  • I tried my best to get the gray chevron to inherit its parent colors. The CSS should work as is, but they keep being gray. Not sure how to fix that, and it isn't critical for this one to land. It's also something that could be refactored away if, for example, the navigation component defaulted to a light mode, and got a dark mode prop for its FSE menu usage.

This PR is good to go, I'd say! Nice work.

@hedgefield
Copy link

hedgefield commented Jan 27, 2021

This looks great, and if @jasmussen says it looks good, I trust his judgement! Looks like there are a few tests failing, but other than that, anything blocking that needs to be done to get this ready? Is it realistic to get this in for the 5.7 deadline on friday? I'll get a11y to look at this this afternoon as well.

@ntsekouras
Copy link
Contributor Author

Hey @hedgefield - the failing e2e tests are a Core regression tracked here: https://core.trac.wordpress.org/ticket/50025

@noisysocks noisysocks removed the Needs Design Feedback Needs general design feedback. label Jan 28, 2021
@noisysocks
Copy link
Member

noisysocks commented Jan 28, 2021

Removing Needs Design Feedback as @jasmussen seems happy. (Mind you, doesn't Joen always seem happy? 🙂)

Hey @hedgefield - the failing e2e tests are a Core regression tracked here: https://core.trac.wordpress.org/ticket/50025

This should be fixed now. I restarted the tests, let's see how it goes 🤞

Copy link
Member

@noisysocks noisysocks left a comment

Choose a reason for hiding this comment

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

Code looks good. I spotted two small issues:

  1. The checkbox controls animate when switching tabs. Probably need to put a key="" on the current tab content.

    2021-01-28 12 10 55

  2. On mobile, the section heading and Back button appear as a light grey which is very difficult to see.

    Screen Shot 2021-01-28 at 12 18 13

@ntsekouras ntsekouras changed the title Try/change preferences Change preferences redesign Jan 28, 2021
@ntsekouras ntsekouras changed the title Change preferences redesign Preferences modal redesign Jan 28, 2021
@jasmussen
Copy link
Contributor

(Mind you, doesn't Joen always seem happy? 🙂)

I try! I really do 😄

I pushed a fix to make the back button and heading legible on mobile. The root cause is that the navigation component appears to be designed specifically for use in the dark side menu, to a point that changing this color and its inheritance is pretty difficult. So we really should separately make that component more color agnostic.

@ntsekouras
Copy link
Contributor Author

ntsekouras commented Jan 28, 2021

The checkbox controls animate when switching tabs. Probably need to put a key="" on the current tab content.

Investigating this but they are not in a map to add a key. And this seems to happen only between blocks and appearance tabs 🤔

--edit
I added keys to the affected sections and it's fine now. It seems to me that this was due to React reconciliation.

@jasmussen
Copy link
Contributor

I think the animated checkboxes are acceptable. I suspect it's because the CSS animation that happens starts/invokes when the item itself comes into being.

@noisysocks
Copy link
Member

It seems to me that this was due to React reconciliation.

Yes without the key React has know way of knowing that they're separate panels and so will update the existing checkbox in the DOM instead of destroying it / creating a new checkbox.

Copy link
Member

@noisysocks noisysocks left a comment

Choose a reason for hiding this comment

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

Love it! 👏

@noisysocks noisysocks merged commit 1524fee into master Jan 29, 2021
WordPress 5.7 Must Haves automation moved this from Needs Review to Done Jan 29, 2021
@noisysocks noisysocks deleted the try/change-preferences branch January 29, 2021 00:39
@github-actions github-actions bot added this to the Gutenberg 9.9 milestone Jan 29, 2021
@mtias
Copy link
Member

mtias commented Jan 29, 2021

Nice work all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
General Interface Parts of the UI which don't fall neatly under other labels. Needs Accessibility Feedback Need input from accessibility [Package] E2E Test Utils /packages/e2e-test-utils [Type] Enhancement A suggestion for improvement.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Iterating on the "Options" settings
8 participants