-
Notifications
You must be signed in to change notification settings - Fork 453
Refine message on fenix 2654 #5816
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
Open
fatadel
wants to merge
4
commits into
firefox-devtools:main
Choose a base branch
from
fatadel:refine-message-on-fenix-2654
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -223,6 +223,7 @@ type PopupInstallPhase = | |
| | 'popup-enabled' | ||
| | 'suggest-enable-popup' | ||
| // Other browsers: | ||
| | 'firefox-android' | ||
| | 'suggest-chrome-extension' | ||
| | 'other-browser'; | ||
|
|
||
|
|
@@ -233,21 +234,25 @@ class HomeImpl extends React.PureComponent<HomeProps, HomeState> { | |
| let popupInstallPhase = 'other-browser'; | ||
|
|
||
| if (_isFirefox()) { | ||
| popupInstallPhase = 'checking-webchannel'; | ||
|
|
||
| // Query the browser to see if the menu button is available. | ||
| queryIsMenuButtonEnabled().then( | ||
| (isMenuButtonEnabled) => { | ||
| this.setState({ | ||
| popupInstallPhase: isMenuButtonEnabled | ||
| ? 'popup-enabled' | ||
| : 'suggest-enable-popup', | ||
| }); | ||
| }, | ||
| () => { | ||
| this.setState({ popupInstallPhase: 'webchannel-unavailable' }); | ||
| } | ||
| ); | ||
| if (_isAndroid()) { | ||
| popupInstallPhase = 'firefox-android'; | ||
| } else { | ||
| popupInstallPhase = 'checking-webchannel'; | ||
|
|
||
| // Query the browser to see if the menu button is available. | ||
| queryIsMenuButtonEnabled().then( | ||
| (isMenuButtonEnabled) => { | ||
| this.setState({ | ||
| popupInstallPhase: isMenuButtonEnabled | ||
| ? 'popup-enabled' | ||
| : 'suggest-enable-popup', | ||
| }); | ||
| }, | ||
| () => { | ||
| this.setState({ popupInstallPhase: 'webchannel-unavailable' }); | ||
| } | ||
| ); | ||
| } | ||
| } else if (_isChromium()) { | ||
| popupInstallPhase = 'suggest-chrome-extension'; | ||
| // TODO: Check if the extension is installed and show the recording | ||
|
|
@@ -269,6 +274,8 @@ class HomeImpl extends React.PureComponent<HomeProps, HomeState> { | |
| return this._renderEnablePopupInstructions(false); | ||
| case 'popup-enabled': | ||
| return this._renderRecordInstructions(FirefoxPopupScreenshot); | ||
| case 'firefox-android': | ||
| return this._renderFenixInstructions(); | ||
| case 'suggest-chrome-extension': | ||
| return this._renderChromeInstructions(); | ||
| case 'other-browser': | ||
|
|
@@ -381,6 +388,56 @@ class HomeImpl extends React.PureComponent<HomeProps, HomeState> { | |
| ); | ||
| } | ||
|
|
||
| _renderFenixInstructions() { | ||
| return ( | ||
| <InstructionTransition key={0}> | ||
| <div className="homeInstructions" data-testid="home-fenix-instructions"> | ||
| {/* Grid container: homeInstructions */} | ||
| {/* Left column: img */} | ||
| <img | ||
| className="homeSectionScreenshot" | ||
| src={PerfScreenshot} | ||
| alt="screenshot of profiler.firefox.com" | ||
| /> | ||
| {/* Right column: instructions */} | ||
| <div> | ||
| <DocsButton /> | ||
| <Localized | ||
| id="Home--fenix-instructions" | ||
| elems={{ | ||
| a: <a href="https://www.firefox.com/en-US/browsers/desktop/" />, | ||
| }} | ||
| > | ||
| <p> | ||
| Recording performance profiles currently requires{' '} | ||
| <a href="https://www.firefox.com/en-US/browsers/desktop/"> | ||
| Firefox for Desktop | ||
| </a> | ||
| . However, existing profiles can be viewed in any modern desktop | ||
| browser. | ||
| </p> | ||
| </Localized> | ||
| <Localized | ||
| id="Home--profile-firefox-android-instructions" | ||
| elems={{ | ||
| a: ( | ||
| <a href="https://profiler.firefox.com/docs/#/./guide-profiling-android-directly-on-device?id=profiling-firefox-for-android-directly-on-device" /> | ||
| ), | ||
| }} | ||
| > | ||
| <p> | ||
| You can also profile Firefox for Android. For more information, | ||
| please consult this documentation:{' '} | ||
| <a>Profiling Firefox for Android directly on device</a>. | ||
| </p> | ||
| </Localized> | ||
| </div> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This wording is more suitable for the desktop message, since it says "You can also profile Firefox for Android.". Instead, I would prefer to have a new ftl key with a better wording suited specifically for Firefox for Android. Maybe something like: |
||
| {/* end of grid container */} | ||
| </div> | ||
| </InstructionTransition> | ||
| ); | ||
| } | ||
|
|
||
| _renderChromeInstructions() { | ||
| const chromeExtensionUrl = | ||
| 'https://chromewebstore.google.com/detail/firefox-profiler/ljmahpnflmbkgaipnfbpgjipcnahlghn'; | ||
|
|
@@ -700,6 +757,10 @@ function _isChromium(): boolean { | |
| return Boolean(navigator.userAgent.match(/Chrome\/\d+\.\d+/)); | ||
| } | ||
|
|
||
| function _isAndroid(): boolean { | ||
| return Boolean(navigator.userAgent.match(/\bAndroid\b/i)); | ||
| } | ||
|
|
||
| export const Home = explicitConnect< | ||
| OwnHomeProps, | ||
| StateHomeProps, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Ah, it looks like we have 2 different instructions now that kinda say the opposite things. Since we have a Localized component below that says it's possible to profile on an Android device, "Recording performance profiles currently requires Firefox for Desktop" is no longer true. Can we move the android on device profiling above, and add the remote profiling instruction below?
For the wording of remote profiling, maybe something like: