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

Reader Recent Feed Overhaul: Match cog menu styles and update posts list styles #96748

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

allilevine
Copy link
Member

@allilevine allilevine commented Nov 25, 2024

Related to https://github.com/Automattic/loop/issues/222

Proposed Changes

  • Import base and DataViews styles to match the cog menu styles.
  • Update the posts list styles to incorporate the imported styles.
  • Use the site icon for the list media field in DataViews.
Before After
Screen Shot 2024-11-25 at 4 40 18 PM Screen Shot 2024-11-25 at 4 40 12 PM
Screen Shot 2024-11-25 at 4 40 49 PM Screen Shot 2024-11-25 at 4 40 31 PM

Why are these changes being made?

  • pe7F0s-2iv-p2

Testing Instructions

  • Go to /read?flags=reader/recent-feed-overhaul
  • Click on the cog icon (next to Search, under Recent).
  • The styles should match those in /sites and https://wordpress.github.io/gutenberg/?path=/docs/dataviews-dataviews--docs
  • Check that the posts list looks good at different screen sizes. Expected differences with staging:
    • The loading animation is centered
    • Selected items have blue text
    • Items are at least 52px tall

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)?

@allilevine allilevine self-assigned this Nov 25, 2024
@matticbot
Copy link
Contributor

matticbot commented Nov 25, 2024

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

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

  • notifications

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/reader-recent-feed-overhaul-cog-post-styles on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented Nov 25, 2024

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

App Entrypoints (~42 bytes removed 📉 [gzipped])

name                   parsed_size           gzip_size
entry-stepper              -1530 B  (-0.1%)      -42 B  (-0.0%)
entry-main                 -1530 B  (-0.1%)      -42 B  (-0.0%)
entry-subscriptions         -126 B  (-0.0%)      -24 B  (-0.0%)
entry-login                 -126 B  (-0.0%)      -24 B  (-0.0%)
entry-domains-landing       -126 B  (-0.0%)      -24 B  (-0.0%)
entry-browsehappy           -126 B  (-0.1%)      -24 B  (-0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~327 bytes removed 📉 [gzipped])

name    parsed_size           gzip_size
reader       +732 B  (+0.0%)     -327 B  (-0.1%)

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

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.

render: ( { item }: { item: ReaderPost } ) => {
return <RecentSeenField post={ getPostFromItem( item ) } />;
const post = getPostFromItem( item );
Copy link
Member Author

Choose a reason for hiding this comment

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

I removed the seen field and replaced it with an icon field that renders the icon in the DataViews mediaField.

@import '@wordpress/base-styles/breakpoints';
@import "@wordpress/base-styles/breakpoints";
@import "@wordpress/base-styles/mixins";
@import "@wordpress/dataviews/build-style/style.css";
Copy link
Member Author

Choose a reason for hiding this comment

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

We import these styles in other DataViews implementations on Dotcom.

border-top: 1px solid var( --studio-gray-0 );

&.is-selected + li {
border-top: 1px solid var( --studio-gray-0 );
Copy link
Member Author

Choose a reason for hiding this comment

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

This is preventing a blue border under the selected item.

}
}
.dataviews-view-list__item-wrapper {
background-color: #f7faff;
Copy link
Member Author

@allilevine allilevine Nov 25, 2024

Choose a reason for hiding this comment

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

This is changing the DataViews selected background color to the one in our design.

border-radius: 50%;
width: 24px;
height: 24px;
background-color: transparent;
Copy link
Member Author

Choose a reason for hiding this comment

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

This style changes the shape of the DataViews' media field.

max-width: 38px;
align-self: flex-end;
flex-shrink: 0;
.dataviews-view-list__item {
Copy link
Member Author

Choose a reason for hiding this comment

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

This style changes the padding of the DataViews items to match the design / maximize horizontal space.

@allilevine allilevine marked this pull request as ready for review November 25, 2024 21:55
@allilevine allilevine requested a review from a team as a code owner November 25, 2024 21:55
@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 Nov 25, 2024
Copy link
Contributor

@eoigal eoigal left a comment

Choose a reason for hiding this comment

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

WFM

Screen.Recording.2024-11-26.at.10.21.17.mov

@allilevine allilevine merged commit 98a5711 into trunk Nov 26, 2024
14 checks passed
@allilevine allilevine deleted the update/reader-recent-feed-overhaul-cog-post-styles branch November 26, 2024 13:59
@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 Nov 26, 2024
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.

3 participants