profiler
profiler copied to clipboard
Remove "Back to home" link on import error when using /from-post-message
When import fails, we show the following dialog.
When using /from-post-message, we know the user did not come from Firefox Profiler home. Can we remove the "Back to home" link in this case? If not, can we have a query param to disable navigating to home somehow?
This is important, as in embedded environment (I'm thinking VS Code), going to home on failure to open a profile is not really useful or expected.
┆Issue is synchronized with this Jira Task
I never really noticed that link, but I think it's rarely useful. I think the most common use cases are to load a profile directly from the browser, or to load a profile from a profile link that has been shared. In both of these cases, the user has not seen the home page before encountering the error message. If the user has tried to load a profile from disk using a drag&drop, it's still possible to drop a new profile file onto the error message, so going to the home page not useful either. I think the only case where going to the home page is useful would be when the user loaded a broken profile from a file, using the file picker. Then they might want to go to the homepage to access the file picker again.
A link to some documentation helping to understand the error message might make more sense.
Makes sense. In that case, we can maybe just remove the "Back to home" as in most cases that is not where the user is coming from in the first place. Link to documentation would be nice, but looks like we just show the raw JS error that occurs, and might not really have useful documentation for those?
What do you think about the link to home here at "Firefox Profiler"? For the VS Code/embedded usecase, we'd need to remove that as well.
To fix the initial description, it would be straightforward to update the code in https://github.com/firefox-devtools/profiler/blob/469bf5c6d42e49d94353d718b079c3d0dfad7adc/src/components/app/AppViewRouter.js#L121
Where the boolean could be something such as dataSource === 'from-file' for example.
You could also be interested in changing it here: https://github.com/firefox-devtools/profiler/blob/469bf5c6d42e49d94353d718b079c3d0dfad7adc/src/components/app/ProfileLoaderAnimation.js#L63-L65
I believe this check was introduced to remove the back home link when using from-url from Safari, but I think it could be better to use the same "dataSource === 'from-file' check.
For the link in the list of uploaded profiles, I'm not fully sure, ideally it could be a target="_blank" in that case. But I believe it's another issue, it could be handled separately.