-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Show breadcrumbs in individual theme header #94038
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~619 bytes removed 📉 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~25884 bytes added 📈 [gzipped])
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 (~963 bytes removed 📉 [gzipped])
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. Generated by performance advisor bot at iscalypsofastyet.com. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eoigal Thanks! The default top padding on cc @javierarce in case you have a recommendation. |
@allilevine that was a good solution. I think we had a proposal to set the vertical distance to 24px, but since that would require changing at least the Plugins and the Domains pages, I think it's better to align Themes with Plugins for now. |
Thank you! |
I realized there's other paths to the theme page I need to allow for here. Putting this back in progress. |
4213ee7
to
09fcb97
Compare
const { backPath, locale, isLoggedIn, themeId } = this.props; | ||
this.props.recordTracksEvent( 'calypso_theme_sheet_back_click', { theme_name: themeId } ); | ||
|
||
// Use history back when coming from customize your store screen. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asked about removing this here: p1725572262533179-slack-C01SFMVEYAK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed: p1725630569410769/1725572262.533179-slack-C01SFMVEYAK
} | ||
|
||
page( localizeThemesPath( backPath, locale, ! isLoggedIn ) ); | ||
return localizeThemesPath( backPath, locale, ! isLoggedIn ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm returning a path for the breadcrumb instead of redirecting the page.
@@ -61,7 +61,7 @@ const StyledGridicon = styled( Gridicon )` | |||
color: var( --color-neutral-10 ); | |||
`; | |||
|
|||
const HelpBuble = styled( InfoPopover )` | |||
const HelpBubble = styled( InfoPopover )` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing a typo.
@@ -127,11 +132,13 @@ const Breadcrumb: React.FunctionComponent< Props > = ( props ) => { | |||
|
|||
return ( | |||
<StyledUl className="breadcrumbs"> | |||
{ items.map( ( item: { href?: string; label: string }, index: Key ) => ( | |||
{ items.map( ( item: Item, index: Key ) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replacing the type here with the type already defined above.
|
||
page( localizeThemesPath( backPath, locale, ! isLoggedIn ) ); | ||
handleBackLinkClick = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this function for the Tracks event.
@@ -1540,6 +1536,11 @@ class ThemeSheet extends Component { | |||
'is-removed': isRemoved, | |||
} ); | |||
|
|||
const navigationItems = [ | |||
{ label: translate( 'Themes' ), href: this.getBackLink(), onClick: this.handleBackLinkClick }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if "Back to themes" was better language for screen readers. But this matches "Plugins."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good and works well. I noticed two things, but I don't think they're blockers.
/plugins on mobile view uses "< Back" instead of breadcrumbs. I'm not sure if we want to copy that behavior.
The header has some extra margin at a specific width. See video:
Screen.Recording.2024-09-06.at.4.56.21.PM.mov
bb8f8b2
to
b63f448
Compare
@DustyReagan Thanks for catching these!
I noticed this but it comes from the
I pushed a change to fix this! If you can re-review I'd appreciate it. 🙏 I also noticed that there was a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I retested the new commit, and it looks good to me!
Fixes #92645
Proposed Changes
NavigationHeader
component for individual themes.Breadcrumb
andNavigationHeader
components to take anonClick
prop.Why are these changes being made?
Testing Instructions
Known issue: there's some variation in padding on the page. I'm aligning with the theme title.
Pre-merge Checklist