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

My Home: Fix inconsistencies between the different cards on mobile #97070

Merged
merged 13 commits into from
Dec 10, 2024

Conversation

m1r0
Copy link
Member

@m1r0 m1r0 commented Dec 4, 2024

Resolves #97066

Proposed Changes

  • Fix some styling inconsistencies for the cards on the My Home screen, focusing mostly on mobile.
  • Refactor the code and move the generic styling to an already existing class - customer-home__card. This is for cards only. Tasks (another card variant) have a more specific styling so I've skipped those.
  • Use consistent breakpoints and switch to a mobile-first approach by refactoring the breakpoint-deprecated calls.
  • Slightly update the style of the "Get Help" card to make it more consistent with the others.
  • Fix some tasks having no padding on mobile (potentially related to Bug: My Home Black Friday card loses padding on <600px screens #96936).

Why are these changes being made?

Because once you see these issues, it's hard to unsee them. 🙂

Testing Instructions

  • Checkout the branch and go to http://calypso.localhost:3000/home/YOUR-DOMAIN
  • Compare the cards with http://wordpress.com/home/YOUR-DOMAIN and make sure there is an improvement (not aiming for perfection 🙂) in the paddings and style consistency on tablet and mobile. The desktop version should be mostly the same with very slight changes (mostly the "Get Help" card).
  • To test cards/tasks from other views, sandbox public-api.wordpress.com, and update the get_view function in the wp-content/lib/home/views.php file to return another view. You could use the following snippet as an example:
$views = VIEWS_SIMPLE_AND_ATOMIC_TIME_SENSITIVE;
foreach ( $views as $view ) {
	return get_cards_for_view( maybe_inject_high_priority_promos( $view ), $blog_id, $user_id, $dev );
} 
  • Test the other view defined at the beginning (lines 43-94) of the wp-content/lib/home/views.php file.
  • Test on different browsers.

Screenshots

[Mobile Portrait] BEFORE

SCR-20241205-qxpe

[Mobile Portrait] AFTER

SCR-20241205-qzsv

[Mobile Landscape] BEFORE

SCR-20241205-qxwv


[Mobile Landscape] AFTER

SCR-20241205-raak


[Mobile Task Card] BEFORE

SCR-20241205-rcng

[Mobile Task Card] AFTER

SCR-20241205-rcgk

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@matticbot
Copy link
Contributor

matticbot commented Dec 4, 2024

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/my-home-inconsistencies on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented Dec 4, 2024

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~77 bytes added 📈 [gzipped])

name                             parsed_size           gzip_size
home                                  +198 B  (+0.0%)      +62 B  (+0.0%)
checkout                               +34 B  (+0.0%)      +15 B  (+0.0%)
reader                                 +14 B  (+0.0%)      +12 B  (+0.0%)
plugins                                +14 B  (+0.0%)      +12 B  (+0.0%)
jetpack-cloud-plugin-management        +14 B  (+0.0%)      +12 B  (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~15 bytes added 📈 [gzipped])

name                                             parsed_size           gzip_size
async-load-calypso-my-sites-checkout-modal             +34 B  (+0.0%)      +15 B  (+0.0%)
async-load-calypso-blocks-editor-checkout-modal        +34 B  (+0.0%)      +15 B  (+0.0%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@m1r0 m1r0 changed the title My Home: Fix inconsistencies between the different my-home cards My Home: Fix inconsistencies between the different cards Dec 5, 2024
@m1r0 m1r0 changed the title My Home: Fix inconsistencies between the different cards My Home: Fix inconsistencies between the different cards on mobile Dec 5, 2024
@m1r0 m1r0 force-pushed the fix/my-home-inconsistencies branch from fa86c0c to 846b69d Compare December 5, 2024 16:59
@m1r0 m1r0 self-assigned this Dec 5, 2024
@m1r0 m1r0 marked this pull request as ready for review December 5, 2024 17:57
@m1r0 m1r0 requested a review from a team December 5, 2024 17:58
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 5, 2024
@merkushin merkushin self-requested a review December 9, 2024 17:03
@merkushin
Copy link
Member

merkushin commented Dec 9, 2024

I think the staging notice has more padding than for other cards (though it is better than "before"):

As an example of "normal" padding:

Copy link
Member

@merkushin merkushin left a comment

Choose a reason for hiding this comment

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

Looks much better now, especially on mobile.

The only inconsistency I found, I described here: #97070 (comment).
Though, I'm not sure if it is intentional or not. It looks like a special card.

@m1r0 m1r0 force-pushed the fix/my-home-inconsistencies branch from 364d0ab to d5c108e Compare December 10, 2024 10:46
@m1r0
Copy link
Member Author

m1r0 commented Dec 10, 2024

Thanks for the review, Dmitry!

The only inconsistency I found, I described here: #97070 (comment).
Though, I'm not sure if it is intentional or not. It looks like a special card.

Good catch! I've fixed that card as well.

image image

@m1r0 m1r0 merged commit 64f6288 into trunk Dec 10, 2024
11 checks passed
@m1r0 m1r0 deleted the fix/my-home-inconsistencies branch December 10, 2024 13:52
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 10, 2024
@m1r0 m1r0 linked an issue Dec 10, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants