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

MWPW-165152: Splash screen / content nav URL handling #129

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Axelcureno
Copy link
Member

@Axelcureno Axelcureno commented Jan 11, 2025

This PR improves URL handling and navigation between splash screen and content navigation, specifically introduces the following criteria:

  • When URL has no hashes or searchParams, user is taken to Splash screen (assumes there is no data query).
  • When a hash is part of the URL, user is taken to content navigation (for querying or searching content directly).
  • When user clicks on "Home" in side nav, user is taken to splash screen and page=welcome searchParam is added to URL (query and path are kept for context).
  • when user clicks on "Go To Content" in Splash screen, user is taken to content navigation screen and page=welcome is removed from URL.
  • When Studio URL has ?page=welcome, user is taken directly to Splash screen (assuming it's intended).

This allows querying data within studio with URL params bypassing splash screen while letting the user navigate to splash screen when intended.

Resolves MWPW-165152

Test URLs:

Copy link

aem-code-sync bot commented Jan 11, 2025

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

Copy link

aem-code-sync bot commented Jan 11, 2025

Page Scores Audits Google
📱 /studio.html PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /studio.html PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

super.connectedCallback();
}

handleInitialPageLoad() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

handleInitialPageLoad doesn't seem to be used.

@@ -68,6 +69,13 @@ class MasSideNav extends LitElement {
}
`;

navigateToSplash() {
const url = new URL(window.location.href);
Copy link
Collaborator

Choose a reason for hiding this comment

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

with the state manager, the history/url management should be consolidated into a single location as a side-effect or reaction to state update.
I think it should be in navigateToPage.

const pageParam = url.searchParams.get('page');

const initialPage =
pageParam === 'welcome'
Copy link
Collaborator

Choose a reason for hiding this comment

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

in the absence of search query in the URL, the pageParam should be set to welcome so that the welcome page has always the same url.

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.

2 participants