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: Filter main feed based on sidebar selection #97123

Merged

Conversation

mehmoodak
Copy link
Member

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

Proposed Changes

  • Extends the Recent menu item on sidebar with the list of subscribed posts which have also made it consistent with the new designs.
  • Update the /following API calls to include the selected feed_id.

Why are these changes being made?

To enhance the filtering capabilities for feeds within the Reader's "stream" view.

Testing Instructions

  • Navigate to /read
  • Verify that filtering is working as expected
  • Navigate to /read?flags=reader%2Frecent-feed-overhaul and select the stream view
  • Verify that filtering is working as expected

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

@mehmoodak mehmoodak self-assigned this Dec 5, 2024
@matticbot
Copy link
Contributor

matticbot commented Dec 5, 2024

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

Sections (~249 bytes added 📈 [gzipped])

name                             parsed_size           gzip_size
plugins                              +1408 B  (+0.0%)     +345 B  (+0.0%)
jetpack-cloud-plugin-management      +1408 B  (+0.1%)     +345 B  (+0.1%)
home                                 +1408 B  (+0.1%)     +345 B  (+0.1%)
reader                               +1026 B  (+0.1%)     +249 B  (+0.1%)
write-flow                            +411 B  (+0.1%)      +62 B  (+0.0%)
link-in-bio-tld-flow                  +411 B  (+0.0%)      +62 B  (+0.0%)
build-flow                            +411 B  (+0.1%)      +62 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 (~105 bytes added 📈 [gzipped])

name                                                 parsed_size           gzip_size
async-load-design-blocks                                  +411 B  (+0.0%)      +62 B  (+0.0%)
async-load-calypso-components-web-preview-component       +411 B  (+0.1%)      +62 B  (+0.0%)
async-load-calypso-reader-sidebar                          -50 B  (-0.0%)      +43 B  (+0.2%)

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.

client/reader/sidebar/reader-sidebar-recent/index.tsx Outdated Show resolved Hide resolved
client/reader/stream/index.jsx Outdated Show resolved Hide resolved
client/state/reader-ui/sidebar/selectors.js Outdated Show resolved Hide resolved
client/state/reader-ui/sidebar/selectors.ts Show resolved Hide resolved
client/state/reader/analytics/actions.js Show resolved Hide resolved
@mehmoodak mehmoodak marked this pull request as ready for review December 5, 2024 16:45
@mehmoodak mehmoodak requested a review from a team as a code owner December 5, 2024 16:45
@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
@matticbot
Copy link
Contributor

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

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

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug loop-236/view-posts-of-the-selected-site-in-old-reader on your sandbox.

Copy link
Contributor

@holdercp holdercp left a comment

Choose a reason for hiding this comment

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

Overall I think this looks good and we can roll forward with this.

I did stub out another approach that addresses some of the issues like the feeds overwriting each other if selections are made in quick succession. Here's the branch if you want to take a look. It's just prototype code but might be a direction we could take.

I fixed some TS errors that were related to the analytics calls, and I also suggest we remove the VSCode debug configs from this PR to keep this one tidy.

.vscode/launch.json Outdated Show resolved Hide resolved
client/reader/sidebar/reader-sidebar-recent/index.tsx Outdated Show resolved Hide resolved
client/reader/sidebar/index.jsx Show resolved Hide resolved
client/reader/stream/index.jsx Outdated Show resolved Hide resolved
@mehmoodak mehmoodak requested review from a team as code owners December 6, 2024 02:12
@mehmoodak mehmoodak force-pushed the loop-236/view-posts-of-the-selected-site-in-old-reader branch from 9a485ca to 214e072 Compare December 6, 2024 02:14
@mehmoodak mehmoodak removed request for a team December 6, 2024 02:19
@mehmoodak mehmoodak removed the request for review from a team December 6, 2024 02:19
Copy link
Contributor

@holdercp holdercp 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 working well!

  • Feed is filtering by selection
  • I can't trigger the "overriding feeds" issue 👍

client/reader/sidebar/index.jsx Show resolved Hide resolved
@mehmoodak mehmoodak merged commit e95a5b9 into trunk Dec 6, 2024
11 checks passed
@mehmoodak mehmoodak deleted the loop-236/view-posts-of-the-selected-site-in-old-reader branch December 6, 2024 16:24
@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 6, 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.

4 participants