-
Notifications
You must be signed in to change notification settings - Fork 8
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
base: main
Are you sure you want to change the base?
Conversation
|
super.connectedCallback(); | ||
} | ||
|
||
handleInitialPageLoad() { |
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.
handleInitialPageLoad
doesn't seem to be used.
@@ -68,6 +69,13 @@ class MasSideNav extends LitElement { | |||
} | |||
`; | |||
|
|||
navigateToSplash() { | |||
const url = new URL(window.location.href); |
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.
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' |
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.
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.
This PR improves URL handling and navigation between splash screen and content navigation, specifically introduces the following criteria:
page=welcome
searchParam is added to URL (query and path are kept for context).page=welcome
is removed from URL.?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: