-
Notifications
You must be signed in to change notification settings - Fork 3k
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
@swm/global nav menu v2 #29104
@swm/global nav menu v2 #29104
Conversation
@ Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@ Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Getting help from C+ here for review |
src/components/IFrame.js
Outdated
return; | ||
} | ||
|
||
setOldDotURL(`${BASE_IFRAME_URL}/${newOldDotURL}`); |
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.
When the user clicks a link that navigates to a different OldDot page inside the iframe:
- A link is clicked
- OldDot inside the iframe will navigate to a different page
- NewDot detect the URL change inside iframe
- The callback is triggered and a navigation happens inside NewDot
routeName
andparams
change- The URL of the iframe is set to the URL to which the embedded OldDot has already navigated to
So to avid the step #6, we can check if the URL of the iframe is the same as the one mapped to the routeName
before setting oldDotURL
I actually don't know if resetting the src
of the iframe to same URL will cause the iframe to reload. If it doesn't, then we can keep the current code
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 did some testing and it turns out that we need to remount the iframe anyway. Keeping the iframe and navigating inside it will interfere with the browser history.
I did it in a way to remount as little as possible.
Maybe there is a way to prevent iframe from interfering with the browser history without remounting but I can't see anything at this moment. That's probably something worth investigating in the future
src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator.js
Outdated
Show resolved
Hide resolved
Okay, so the URL object is encoding unsafe characters like I am assuming that we are not going to change the expenisfy.com urls so I am going to look for the best way to work with the URLs while keeping the unsafe characters. It feels like just concatenating strings may be an easy way to generate more bugs 😄 |
@adamgrzybowski Thank you for investigating this 🙇
So the URL we get inside the callback for the |
I don't know what is inside the callback because I can't get olddot running inside the iframe. But I am assuming this is working fine. The encoded URL happens when we are generating a URL for the iframe. In the function |
ah this one function addNewDotParams(url) {
const urlObj = new URL(url);
urlObj.searchParams.append('isInNewDot', true);
urlObj.searchParams.append('isDarkMode', true);
return urlObj.toString();
} @adamgrzybowski were you able to find a solution for this issue 😄 ? |
@hayata-suenaga As I mentioned in the update, I added decodeURIComponent to reverse encoding to safe form. function addNewDotParams(url) {
const urlObj = new URL(url);
urlObj.searchParams.append('isInNewDot', true);
urlObj.searchParams.append('isDarkMode', true);
return decodeURIComponent(urlObj.toString());
} |
c61560d
to
da480e3
Compare
is this ready for review? |
@hayata-suenaga Haven't we removed the global nav? I am not sure what should happen with this PR |
ah sorry I thought @wojciech.boman is working on this PR. I asked him to finish this PR (but removing code related to global nav while keeping the code related to the logic for navigation synchronization) |
Should this PR be closed? Or do we still want to keep some of it? |
I think we can close this PR now but this PR has a navigation sync logic between NewDot and OldDot contained. I don't think we're embedding any OldDot pages anytime soon, so I think we can close this and then reopen it or copy part of the code if necessary in the future. |
@hayata-suenaga Would there be any compensation for the review work done here? |
Details
WIP
The description will be updated.
Fixed Issues
$
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop