Skip to content

Stats-30 - Ensure correct logo and titles are displayed in the new header #102833

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

Draft
wants to merge 10 commits into
base: trunk
Choose a base branch
from

Conversation

Nikschavan
Copy link
Contributor

Related to STATS-30

Proposed Changes

Why are these changes being made?

Testing Instructions

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

@Nikschavan Nikschavan requested a review from Copilot April 24, 2025 11: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 Apr 24, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the header for the Stats view to ensure the correct logo and titles are displayed, addressing branding differences based on the environment. Key changes include:

  • Updating the icon import and adding the 'settings' icon for the right section in the header.
  • Introducing a conditional logo display using the new JetpackLogo component based on the isOdysseyStats flag.
  • Modifying the NavigationHeader component to accept new props (titleLogo and rightSection) to support the updated header design.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
client/my-sites/stats/site.jsx Adjusts header rendering to conditionally display a logo and icon.
client/components/navigation-header/navigation-header.tsx Updates the NavigationHeader API to support titleLogo and rightSection.
Files not reviewed (1)
  • client/components/navigation-header/navigation-header.scss: Language not supported
Comments suppressed due to low confidence (2)

client/my-sites/stats/site.jsx:537

  • [nitpick] Ensure that the constants STATS_PRODUCT_NAME and STATS_PRODUCT_NAME_IMPR correctly reflect the intended branding in each environment. It might be helpful to review their naming and definitions across the codebase for consistency.
title={ isOdysseyStats ? STATS_PRODUCT_NAME : STATS_PRODUCT_NAME_IMPR }

client/components/navigation-header/navigation-header.tsx:75

  • [nitpick] The use of both 'calypso-navigation-header' and 'navigation-header' as CSS classes may be redundant. Consider consolidating or clearly documenting the intent of each class to avoid confusion or conflicting styles.
className={ clsx( 'calypso-navigation-header', 'navigation-header', className, {

@matticbot
Copy link
Contributor

matticbot commented Apr 24, 2025

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

Sections (~280 bytes added 📈 [gzipped])

name   parsed_size           gzip_size
stats      +1191 B  (+0.1%)     +280 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.

@matticbot
Copy link
Contributor

matticbot commented Apr 24, 2025

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

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

  • help-center
  • notifications
  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug stats-30-ensure-sites-has-the-right-logo on your sandbox.

'calypso-navigation-header__screen-options-tab': hasScreenOptionsTab,
} ) }
{ ...rest }
>
<div className="calypso-navigation-header__head">{ headElement }</div>
<div className="calypso-navigation-header__body">
<div className="calypso-navigation-header__left-section">{ titleElement }</div>
<div className="calypso-navigation-header__right-section">{ children }</div>
{ rightSection && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Is introducing this rightSection a kind of YAP-ing mentioned by @kangzj in the task STATS-6 of creating the component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The rightSection still takes in the whole component as to what is to be displayed in that section. IMO, the wrapper for the right section is required in the component itself, as it acts as a slot and places the content in the correct location. Let me know your thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants