Skip to content

feat(my-account): full-site takeover template and custom nav menu#3974

Merged
dkoo merged 34 commits into
trunkfrom
feat/my-account-site-takeover
May 21, 2025
Merged

feat(my-account): full-site takeover template and custom nav menu#3974
dkoo merged 34 commits into
trunkfrom
feat/my-account-site-takeover

Conversation

@dkoo

@dkoo dkoo commented May 13, 2025

Copy link
Copy Markdown
Contributor

All Submissions:

Changes proposed in this Pull Request:

This PR builds on the Newspack UI styles implemented in #3951. It implements a custom no-header/no-footer page template for My Account pages while logged in, as well as a custom template part, styles, and JS for the My Account nav menu.

Closes NPPD-107 and NPPD-106.

mobile, menu closed Screenshot 2025-05-13 at 12 33 06 PM mobile, menu open Screenshot 2025-05-13 at 12 33 00 PM
mobile, horizontal orientation (menu and content are separately scrollable) Screenshot 2025-05-13 at 5 28 26 PM desktop Screenshot 2025-05-13 at 12 32 35 PM

Some notes:

  • The custom no-header/no-footer page template is based on the no-header-footer.php template from Newspack Theme but implemented separately in this plugin so that it's not reliant on the Newspack Theme being active. I'm open to discussing alternative approaches, but this seemed cleanest to me.
  • The site logo shown in the desktop nav menu is the image chosen as the "Site icon" in the Customizer (also filterable via newspack_my_account_site_logo_url hook).
  • The designs include an area for custom links above the Sign Out link, but the UI to add custom links is out of scope of this project. They can be added in code via a newspack_my_account_navigation_footer_items filter hook.
  • (for @Automattic/newspack-design) Since this isn't the "true" full-screen takeover experience (where the My Account pages functions as an app overlay on the regular site), I took some liberty with adding a mobile "account" icon button on the right side of the fixed topbar element to toggle the menu open. Does the placement and behavior make sense?

How to test the changes in this Pull Request:

  1. Check out this branch and rebuild assets
  2. Make sure define( 'NEWSPACK_MY_ACCOUNT_VERSION', '1.0.0' ); is defined in wp-config.php
  3. Add a site icon image in Customize > Site Identity
  4. Log into My Account with a reader account and confirm that all My Account pages render without a site header/footer while logged in
  5. Test look and behavior of the menu at various breakpoints and screen sizes
  6. (Bonus) add some custom menu links using a filter and ensure that the links render above the "Sign out" link at the bottom of the menu sidebar:
add_filter(
	'newspack_my_account_navigation_footer_items',
	function() {
		return [
			[
				'url'   => 'https://automattic.com',
				'label' => __( 'Automattic', 'newspack-plugin' ),
			],
			[
				'url'   => 'https://newspack.com',
				'label' => __( 'Newspack', 'newspack-plugin' ),
			],
		];
	}
);

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@dkoo dkoo requested a review from a team as a code owner May 13, 2025 21:11
@dkoo dkoo self-assigned this May 13, 2025
@dkoo dkoo added [Status] Needs Review The issue or pull request needs to be reviewed [Status] Needs Design Review labels May 13, 2025
@dkoo dkoo requested a review from a team May 13, 2025 21:12
@thomasguillot

Copy link
Copy Markdown
Contributor

Screenshot 2025-05-15 at 10 59 48@2x

It looks broken if it's the Block Theme but I guess it's because right now the theme doesn't even support WC.

@dkoo

dkoo commented May 15, 2025

Copy link
Copy Markdown
Contributor Author

@thomasguillot maybe we can tackle Block Theme support in a separate PR? We may need to tweak the page template to accommodate it, too.

@dkoo

dkoo commented May 15, 2025

Copy link
Copy Markdown
Contributor Author

@thomasguillot e55fc8f fixes hover styles for the Sign Out button:

Screenshot 2025-05-15 at 11 32 49 AM

@thomasguillot

Copy link
Copy Markdown
Contributor

maybe we can tackle Block Theme support in a separate PR?

Sounds good.

@miguelpeixe miguelpeixe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice! All works well in my testing. Left a couple of minor requests below.

Comment thread includes/plugins/woocommerce/my-account/class-my-account-ui-v1.php Outdated
Comment thread includes/plugins/woocommerce/my-account/class-my-account-ui-v1.php Outdated
@dkoo dkoo requested a review from miguelpeixe May 21, 2025 20:34
@github-actions github-actions Bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels May 21, 2025
@dkoo dkoo merged commit 5cf8403 into trunk May 21, 2025
11 checks passed
@dkoo dkoo deleted the feat/my-account-site-takeover branch May 21, 2025 20:36
@github-actions

Copy link
Copy Markdown

Hey @dkoo, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label.

If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label.

Thank you! ❤️

matticbot pushed a commit that referenced this pull request May 23, 2025
# [6.7.0-alpha.1](v6.6.2...v6.7.0-alpha.1) (2025-05-23)

### Bug Fixes

* **404-images:** use JS without modifying content ([#3963](#3963)) ([9f5646b](9f5646b))
* add missing namespace ([#3980](#3980)) ([6d58793](6d58793))
* **emails:** add missing HTML markup in the change-email-cancel template ([#3981](#3981)) ([040ae30](040ae30))
* **ga4:** fire login/registration activities via SSO ([#3965](#3965)) ([8c97515](8c97515))
* hide modal content gate when modal checkout is opened ([#3953](#3953)) ([a503973](a503973))
* **jetpack:** handle the related posts max age option ([#3964](#3964)) ([8aad2b8](8aad2b8))
* make sure fix duplcate fields apply filters ([#3971](#3971)) ([f361a4e](f361a4e))
* namespace Lite Site ([#3975](#3975)) ([e4665ae](e4665ae))
* sync correction status with parent post status ([#3978](#3978)) ([dcd5a12](dcd5a12))

### Features

* add compatibility to network in custom bylines ([#3972](#3972)) ([199a993](199a993))
* add icons repository and remove custom icons ([#3883](#3883)) ([e56d2e0](e56d2e0))
* **analytics:** "My Account" dashboard interactions ([#3949](#3949)) ([22e9590](22e9590))
* **donations:** update notice style and type ([#3962](#3962)) ([3f60ef3](3f60ef3))
* **email-change:** remove env constant requirement ([#3943](#3943)) ([4158bf1](4158bf1))
* **my-account:** apply Newspack UI styles to My Account w/ env constant ([#3951](#3951)) ([e4aa5a2](e4aa5a2))
* **my-account:** full-site takeover template and custom nav menu ([#3974](#3974)) ([5cf8403](5cf8403))
* **woocommerce:** log error notices ([#3952](#3952)) ([1654007](1654007))
@matticbot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 6.7.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Jun 2, 2025
# [6.7.0](v6.6.4...v6.7.0) (2025-06-02)

### Bug Fixes

* **404-images:** use JS without modifying content ([#3963](#3963)) ([9f5646b](9f5646b))
* add missing namespace ([#3980](#3980)) ([6d58793](6d58793))
* **emails:** add missing HTML markup in the change-email-cancel template ([#3981](#3981)) ([040ae30](040ae30))
* **ga4:** fire login/registration activities via SSO ([#3965](#3965)) ([8c97515](8c97515))
* hide modal content gate when modal checkout is opened ([#3953](#3953)) ([a503973](a503973))
* **jetpack:** handle the related posts max age option ([#3964](#3964)) ([8aad2b8](8aad2b8))
* make sure fix duplcate fields apply filters ([#3971](#3971)) ([f361a4e](f361a4e))
* namespace Lite Site ([#3975](#3975)) ([e4665ae](e4665ae))
* prevent auto-publishing corrections when scheduling posts ([#4006](#4006)) ([7531832](7531832))
* sync correction status with parent post status ([#3978](#3978)) ([dcd5a12](dcd5a12))

### Features

* add compatibility to network in custom bylines ([#3972](#3972)) ([199a993](199a993))
* add icons repository and remove custom icons ([#3883](#3883)) ([e56d2e0](e56d2e0))
* **analytics:** "My Account" dashboard interactions ([#3949](#3949)) ([22e9590](22e9590))
* **donations:** update notice style and type ([#3962](#3962)) ([3f60ef3](3f60ef3))
* **email-change:** remove env constant requirement ([#3943](#3943)) ([4158bf1](4158bf1))
* **my-account:** apply Newspack UI styles to My Account w/ env constant ([#3951](#3951)) ([e4aa5a2](e4aa5a2))
* **my-account:** full-site takeover template and custom nav menu ([#3974](#3974)) ([5cf8403](5cf8403))
* **woocommerce:** log error notices ([#3952](#3952)) ([1654007](1654007))
@matticbot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 6.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants