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

Hosting config: Use two equal columns #90592

Merged
merged 6 commits into from May 13, 2024
Merged

Conversation

dsas
Copy link
Contributor

@dsas dsas commented May 10, 2024

Related to https://github.com/Automattic/dotcom-forge/issues/7078

Proposed Changes

The hosting config cards have been re-sorted into columns and both columns are now displayed with equal widths.

Testing Instructions

  1. Use calypso live link
  2. Go to /hosting-config
  3. For a browser width >1280px you should see two equal columns, for lower browser widths you should see narrower columns.
  4. Essentially it should look like the mock in the linked issue, albeit the order of the boxes may change depending upon what your site has enabled etc
Before After
Screenshot 2024-05-10 at 17 05 50 Screenshot 2024-05-10 at 17 06 29

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

The hosting config cards have been re-sorted into columns and both
columns are now displayed with equal widths.
@dsas dsas self-assigned this May 10, 2024
@matticbot
Copy link
Contributor

matticbot commented May 10, 2024

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

Sections (~108 bytes added 📈 [gzipped])

name      parsed_size           gzip_size
hosting       +1405 B  (+0.1%)     +108 B  (+0.0%)
settings        +39 B  (+0.0%)      +10 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.

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.

Copy link
Member

@DustyReagan DustyReagan left a comment

Choose a reason for hiding this comment

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

Looks great!

Copy link
Contributor

@Aurorum Aurorum left a comment

Choose a reason for hiding this comment

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

Just wondering if it’s not better to display more icons or centre align them rather than the (IMO) oddly-spaced icons here?

E7AE5137-5595-4505-A278-7815BB5A97A9

@taipeicoder
Copy link
Contributor

Just wondering if it’s not better to display more icons or centre align them rather than the (IMO) oddly-spaced icons here?

+1.

There's also a horizontal scrolling issue on mobile, I'll improve the CSS a bit and merge it!

Screenshot 2024-05-13 at 10 57 19 AM

Copy link
Contributor

@fushar fushar left a comment

Choose a reason for hiding this comment

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

Unfortunately this breaks the existing page (flags=-layout/dotcom-nav-redesign-v2) which uses narrower page width. The section cards look too narrow:

image

Perhaps we should also use full-width page for the existing page? We're gonna launch the feature soon anyway. 😄

--- a/client/my-sites/hosting/main.js
+++ b/client/my-sites/hosting/main.js
@@ -310,7 +310,7 @@ const Hosting = ( props ) => {
 	const banner = shouldShowUpgradeBanner ? getUpgradeBanner() : getAtomicActivationNotice();

 	return (
-		<Main wideLayout className="hosting">
+		<Main fullWidthLayout className="hosting">
 			{ ! isLoadingSftpData && <ScrollToAnchorOnMount offset={ HEADING_OFFSET } /> }
 			<PageViewTracker path="/hosting-config/:site" title="Hosting" />
 			<DocumentHead title={ translate( 'Hosting' ) } />

@taipeicoder
Copy link
Contributor

@fushar could you explain a bit more how the changes breaks the layout? The columns are narrower, but I didn't see anything breaking.

With flag Without flag
Screenshot 2024-05-13 at 12 21 23 PM Screenshot 2024-05-13 at 12 21 49 PM

@fushar
Copy link
Contributor

fushar commented May 13, 2024

@fushar could you explain a bit more how the changes breaks the layout?

Oops sorry, I meant it looks weird (to me) that we are using two-column layout with narrow page width. But you're right that nothing in that page breaks. Maybe I'm just not used to seeing hosting config page that way 🙈

Now I believe this PR is fine.

Copy link
Contributor

@fushar fushar left a comment

Choose a reason for hiding this comment

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

Now that I think about it.... is the intention to have the cards from both columns "aligned"? That's what I'm under impression reading the original issue. However, in this PR, the cards in right column are misaligned with the left column, making the page hard to read.

Design Actual
image image

cc: @davemart-in @lucasmendes-design

@taipeicoder
Copy link
Contributor

Now that I think about it.... is the intention to have the cards from both columns "aligned"? That's what I'm under impression reading the original issue. However, in this PR, the cards in right column are misaligned with the left column, making the page hard to read.

Design Actual
image image
cc: @davemart-in @lucasmendes-design

Updated the code using CSS grid, give it a look 🙂

Copy link
Contributor

@fushar fushar left a comment

Choose a reason for hiding this comment

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

Thanks, looking perfect now!

<SidebarCards
hasStagingSitesFeature={ hasStagingSitesFeature }
isAdvancedHostingDisabled={ ! hasSftpFeature || ! isSiteAtomic }
isBasicHostingDisabled={ ! hasAtomicFeature || ! isSiteAtomic }
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is the only prop needed for <SidebarCards />

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! Forgot to remove it in the cleanup.

@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

  • blaze-dashboard
  • command-palette-wp-admin
  • odyssey-stats

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/hosting-config-cards on your sandbox.

@taipeicoder taipeicoder merged commit 6241a94 into trunk May 13, 2024
11 checks passed
@taipeicoder taipeicoder deleted the update/hosting-config-cards branch May 13, 2024 07:35
@lucasmendes-design
Copy link

LGTM. Thanks folks :)

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.

None yet

7 participants