-
Notifications
You must be signed in to change notification settings - Fork 354
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
[LIVE-2943] Feat/add back forward buttons to web platform player #625
[LIVE-2943] Feat/add back forward buttons to web platform player #625
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: ae151d6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
a039d3f
to
62b87e1
Compare
Codecov Report
@@ Coverage Diff @@
## release #625 +/- ##
===========================================
+ Coverage 47.91% 47.92% +0.01%
===========================================
Files 617 620 +3
Lines 27578 27870 +292
Branches 7126 7177 +51
===========================================
+ Hits 13215 13358 +143
- Misses 13296 13393 +97
- Partials 1067 1119 +52
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Screenshots: ✅
There are no changes in the screenshots for this PR. If this is expected, you are good to go. |
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.
LGTM just a question for the ref
apps/ledger-live-desktop/src/renderer/components/WebPlatformPlayer/index.jsx
Outdated
Show resolved
Hide resolved
We also need a changeset for this PR |
apps/ledger-live-desktop/src/renderer/components/WebPlatformPlayer/TopBar.jsx
Show resolved
Hide resolved
} = config; | ||
|
||
const [canGoBack, setCanGoBack] = React.useState(false); | ||
const [canGoForward, setCanGoForward] = React.useState(false); |
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.
it appears that canGoBack === canGoForward
is kept true at any point in time, so you only need one state?
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 need to keep track of both cases, to enable or disable the "forward" or "backward" button accordingly.
Furthermore, canGoBack === canGoForward
is not true at all time. Sometimes you can go back but not forward, and some other times you can go forward but not back. And sometimes you can do both
apps/ledger-live-desktop/src/renderer/components/WebPlatformPlayer/index.jsx
Outdated
Show resolved
Hide resolved
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.
is it possible to have a unit test that instrument this to be able to test end to end?
We have to test all our PRs. and Desktop offers way to implement this. maybe a mock page could be used to record the events and assert it works? 🙏 would be super beneficial for non regression in future.
78c0e1a
to
e4a223b
Compare
After further investigation and tests, we currently don't have a proper testing framework to easily build and reliably maintain such tests. cf. this PR as a non conclusive attempt to add such tests in the current framework |
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.
small changes and we can merge this
apps/ledger-live-desktop/src/renderer/components/WebPlatformPlayer/TopBar.jsx
Outdated
Show resolved
Hide resolved
apps/ledger-live-desktop/src/renderer/components/WebPlatformPlayer/TopBar.jsx
Outdated
Show resolved
Hide resolved
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.
LGTM
bb376a6
to
b8e31a7
Compare
f940aab
to
ae151d6
Compare
* add possibility to go back and forward * use arrow icon * move webview specific callbacks to TopBar * disable nav buttons when nav not possible * Add shouldDisplayNavigation to TopBarConfig * Use webview ref as prop instead of ref current value * add comments for events listened to * small code style changes * Add changeset
* add possibility to go back and forward * use arrow icon * move webview specific callbacks to TopBar * disable nav buttons when nav not possible * Add shouldDisplayNavigation to TopBarConfig * Use webview ref as prop instead of ref current value * add comments for events listened to * small code style changes * Add changeset
* [LIVE-2943] Feat/add back forward buttons to web platform player (#625) * add possibility to go back and forward * use arrow icon * move webview specific callbacks to TopBar * disable nav buttons when nav not possible * Add shouldDisplayNavigation to TopBarConfig * Use webview ref as prop instead of ref current value * add comments for events listened to * small code style changes * Add changeset * use navigation is buy/sell screen * Revert "use navigation is buy/sell screen" This reverts commit 647b892. * handle Buy Sell live app in exchange screen * add changeset * Revert "[LIVE-2943] Feat/add back forward buttons to web platform player (#625)" This reverts commit 3caf8e1.
📝 Description
Add the back and forward buttons to the web platform player, allowing to easily back and forth in a Live app and also between live apps (like with the Buy / Sell live-app that redirect to other live apps)
Possible to display or hide navigation through a new property in the
TopBarConfig
prop.For now, only enables the navigation on the dedicated Ledger Card entry
The navigation on the Buy / Sell screen will be enabled by this PR -> #923
❓ Context
✅ Checklist
📸 Demo
b.mov
🚀 Expectations to reach
We can go back and forward on live apps.
Please make sure you follow these Important Steps.
Pull Requests must pass the CI and be internally validated in order to be merged.