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

Reading Settings: Add 'Your homepage displays' site setting #71550

Merged
merged 8 commits into from
Jan 16, 2023

Conversation

mashikag
Copy link
Contributor

@mashikag mashikag commented Dec 28, 2022

Screen Shot 2023-01-14 at 11 48 30

Proposed Changes

  • Add Your homepage displays setting to the new Reading Settings page
    • Display it at the top of the Site settings section

    • Use the GET /sites/$site/dropdown-pages/ endpoint to populate the setting's dropdown options

    • A page selected in one of the dropdowns should be disabled in another dropdown. E.g.: I have selected About page for Your homepage displays dropdown. Then once I open up the Default posts page dropdown the About page should be disabled.

    • Display an explanation note as:

      Default homepage and posts page content and layout are determined by your active theme. Learn More.

      For now the "Learn more." link leads to https://wordpress.com/support/templates but there is a new support doc being written up that will replace it when the feature goes out to prod. The following ticket tracks the doc work: https://github.com/Automattic/en.support-docs-content/issues/1805

Testing Instructions

‼️ Be aware that unsetting the Default posts page does not work properly with the component for now due to the following backend issue: #72119

  • Apply jetpack's trunk to your sandbox
  • Sandbox public-api.wordpress.com
  • Go to http://calypso.localhost:3000/settings/reading/$site, e.g.: http://calypso.localhost:3000/settings/reading/simple-site.blog

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

Fixes #70409

@mashikag mashikag self-assigned this Dec 28, 2022
@matticbot
Copy link
Contributor

matticbot commented Dec 28, 2022

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

Sections (~799 bytes added 📈 [gzipped])

name              parsed_size           gzip_size
settings-reading      +3065 B  (+1.1%)     +799 B  (+0.9%)

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.

@mashikag mashikag force-pushed the add/reading-settings-your-homepage-displays branch from c4a1674 to 13c565b Compare January 12, 2023 10:09
@mashikag mashikag requested a review from a team January 14, 2023 12:30
@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 Jan 14, 2023
@mashikag mashikag marked this pull request as ready for review January 14, 2023 12:30
@mashikag mashikag force-pushed the add/reading-settings-your-homepage-displays branch from 1e3e55e to 355ed45 Compare January 16, 2023 08:56
Copy link
Contributor

@ivan-ottinger ivan-ottinger left a comment

Choose a reason for hiding this comment

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

The PR works as expected and the proposed changes look good to me. 👍🏼👍🏼

I am going to continue reviewing and testing the PR (also on other kinds of sites - not just Simple) once I am back from lunch and wanted to share the initial notes earlier:

  • I did not notice any JS, React or TS errors nor warnings.
  • The strings for translation look good.
  • There's one smaller issue with the usage of concat() method (please see the comment in the code below) - current output can be seen in the screenshot below as well - where the em dashes are not separated from the page title.
  • The page that is selected for the Home page gets disabled properly:

Markup on 2023-01-16 at 11:26:39

And thank you for ordering multiple elements (typed objects, returned object's properties, etc...) in alphabetical order. 🙂

Copy link
Contributor

@ivan-ottinger ivan-ottinger left a comment

Choose a reason for hiding this comment

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

Tested again after the latest changes. Everything is working as expected. 🙂👍🏼

Page title is now properly separated from dash with a space (for child pages):
Markup on 2023-01-16 at 18:00:33

Drop-downs display correctly on smaller screens.

Similarly as with other related PR, we were not able to test with Atomic, not Jetpack-connected sites - as /sites/%s/dropdown-pages/ endpoint is not available for them yet.

@mashikag mashikag merged commit 8278edd into trunk Jan 16, 2023
@mashikag mashikag deleted the add/reading-settings-your-homepage-displays branch January 16, 2023 17:27
@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 Jan 16, 2023
@a8ci18n
Copy link

a8ci18n commented Jan 16, 2023

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/7738377

Thank you @mashikag for including a screenshot in the description! This is really helpful for our translators.

@a8ci18n
Copy link

a8ci18n commented Jan 25, 2023

Translation for this Pull Request has now been finished.

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.

Reading Settings: Add “Your homepage displays” site setting
4 participants