Skip to content
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

[DevTools Bug]: provide an icon to Edge devtools? #26352

Closed
yanlingwang23 opened this issue Mar 8, 2023 · 12 comments
Closed

[DevTools Bug]: provide an icon to Edge devtools? #26352

yanlingwang23 opened this issue Mar 8, 2023 · 12 comments
Labels

Comments

@yanlingwang23
Copy link

yanlingwang23 commented Mar 8, 2023

Website or app

Website: https://reactjs.org/

Repro steps

  1. open developer tools in Edge

  2. go to settings -> experiment -> enable Focus Mode -> reload DevTools

  3. we can see the react extension is loaded as below in devtools:
    image

  4. since the react extension doesn't provide the icon when it's created, devtools fallback to use the default icon to represent the extension. However, we've received couple of requests from users that they'd like to see the icon in the panel.
    for instance:
    image

Wondering if it's possible to provide an icon to Edge in the chrome.devtools.panels.create()?
Thank you for your support.

How often does this bug happen?

Every time

DevTools package (automated)

No response

DevTools version (automated)

No response

Error message (automated)

No response

Error call stack (automated)

No response

Error component stack (automated)

No response

GitHub query string (automated)

No response

@github-actions
Copy link

github-actions bot commented Mar 8, 2023

@yanlingwang23: We're sorry you've seen this error. ❤️

It looks like you forgot to specify a valid URL. (This means that we will not be able to reproduce the problem you're reporting.)

Please help us by providing a link to a CodeSandbox (https://codesandbox.io/s/new), a repository on GitHub, or a minimal code example that reproduces the problem. (Screenshots or videos can also be helpful if they help provide context on how to repro the bug.)

Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

Issues without repros are automatically closed but we will re-open if you update with repro info.

@github-actions
Copy link

github-actions bot commented Mar 8, 2023

Thank you for providing repro steps! Re-opening issue now for triage.

@captainbrosset
Copy link

captainbrosset commented Mar 10, 2023

I was looking at the code a little bit yesterday and, as Yanling said, the React extension does not include an icon when calling chrome.devtools.panels.create() (source).

The icon was probably omitted from this line of code because Firefox was, so far, the only browser to support DevTools panel icons, but also supported using the icon defined in the manifest file if the panel icon was missing.

Now, Edge DevTools also supports icons on DevTools panels (only when Focus Mode is enabled), but does so only if the icon is passed in the create() function call.

So it'd be great if React would pass an icon there, and remove the emoji in the panel title. This way, both Firefox and Edge (Focus Mode) would have the nice icon on the DevTools panel.

@harrygz889
Copy link
Contributor

harrygz889 commented Apr 1, 2023

Hi! I'm interested in working on this as a first contribution.

Is the intention to pass the icon to create() only when Focus Mode is enabled, or to unconditionally pass the icon if the browser isEdge?

@DiegoCascavita
Copy link

After looking into the issue, I found that the reason the icon was omitted is because Firefox was the only browser to support DevTools panel icons, but also supported using the icon defined in the manifest file if the panel icon was missing. However, Edge DevTools now also supports icons on DevTools panels (only when Focus Mode is enabled), but does so only if the icon is passed in the create() function call.

To solve this issue, I propose that we add an icon URL as the second argument to the chrome.devtools.panels.create() function and replace the emoji in the panel title with the desired text

@yanlingwang23
Copy link
Author

Hi Diego, thanks for looking into this. Yes, you are right about the icon. But we're good with the current panel title since we still have the default UI that does not support the icon. I think Harry is working on this and has a PR out, I've left a few comments there. Thank you all for looking into this issue.

@shubham-singh-748
Copy link

is it still open if yes i want to work on this

@harryzumwalt-wk
Copy link

@yanlingwang23 Thanks for the feedback. I have updated the PR.

@chaithraramesh31
Copy link

@harryzumwalt-wk Would it be possible for you to show me how you are working on this issue? I'm new to open source contributions and would like to learn more about the process.

@harrygz889
Copy link
Contributor

harrygz889 commented Apr 7, 2023

@chaithraramesh31 You can look at the PR linked in this issue to see the work I’ve done. I recommend reading the contribution docs that are referenced in the README. There is also this video, which shows how some of the key internals work.

@itsnoa04
Copy link

itsnoa04 commented Apr 7, 2023

if this is taken can you guys change the tag to good-first-issue (taken)

mondaychen pushed a commit that referenced this issue Apr 11, 2023
<!--
  Thanks for submitting a pull request!
We appreciate you spending the time to work on these changes. Please
provide enough information so that others can review your pull request.
The three fields below are mandatory.

Before submitting a pull request, please make sure the following is
done:

1. Fork [the repository](https://github.com/facebook/react) and create
your branch from `main`.
  2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
TestName` is helpful in development.
5. Run `yarn test --prod` to test in the production environment. It
supports the same options as `yarn test`.
6. If you need a debugger, run `yarn test --debug --watch TestName`,
open `chrome://inspect`, and press "Inspect".
7. Format your code with
[prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

Learn more about contributing:
https://reactjs.org/docs/how-to-contribute.html
-->

## Summary
Addresses #26352.

This PR explicitly passes an icon to `chrome.devtools.panels.create()`,
so that edge devtools will display the icon when in [Focus
Mode](https://learn.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/experimental-features/focus-mode).

<!--
Explain the **motivation** for making this change. What existing problem
does the pull request solve?
-->

## How did you test this change?
Passing test suite (`yarn test` & `yarn test --prod`) ✅ 
Passing lint (`yarn linc`) ✅ 
Passing type checks (`yarn flow`) ✅ 

**Visual Testing**

Before Changes             | After Changes
:-------------------------:|:-------------------------:

![](https://user-images.githubusercontent.com/15645169/229591145-fe99df06-e2e3-4f21-ae31-f770d584ca6c.png)
|
![](https://user-images.githubusercontent.com/15645169/229591594-26c6cbaf-f345-4367-b234-8f3c8ab3ccb1.png)
<!--
Demonstrate the code is solid. Example: The exact commands you ran and
their output, screenshots / videos if the pull request changes the user
interface.
How exactly did you verify that your PR solves the issue you wanted to
solve?
  If you leave this empty, your PR will very likely be closed.
-->
@mondaychen
Copy link
Contributor

Resolved with #26543
Thanks for the contribution @harrygz889

kassens pushed a commit to kassens/react that referenced this issue Apr 17, 2023
<!--
  Thanks for submitting a pull request!
We appreciate you spending the time to work on these changes. Please
provide enough information so that others can review your pull request.
The three fields below are mandatory.

Before submitting a pull request, please make sure the following is
done:

1. Fork [the repository](https://github.com/facebook/react) and create
your branch from `main`.
  2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
TestName` is helpful in development.
5. Run `yarn test --prod` to test in the production environment. It
supports the same options as `yarn test`.
6. If you need a debugger, run `yarn test --debug --watch TestName`,
open `chrome://inspect`, and press "Inspect".
7. Format your code with
[prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

Learn more about contributing:
https://reactjs.org/docs/how-to-contribute.html
-->

## Summary
Addresses facebook#26352.

This PR explicitly passes an icon to `chrome.devtools.panels.create()`,
so that edge devtools will display the icon when in [Focus
Mode](https://learn.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/experimental-features/focus-mode).

<!--
Explain the **motivation** for making this change. What existing problem
does the pull request solve?
-->

## How did you test this change?
Passing test suite (`yarn test` & `yarn test --prod`) ✅ 
Passing lint (`yarn linc`) ✅ 
Passing type checks (`yarn flow`) ✅ 

**Visual Testing**

Before Changes             | After Changes
:-------------------------:|:-------------------------:

![](https://user-images.githubusercontent.com/15645169/229591145-fe99df06-e2e3-4f21-ae31-f770d584ca6c.png)
|
![](https://user-images.githubusercontent.com/15645169/229591594-26c6cbaf-f345-4367-b234-8f3c8ab3ccb1.png)
<!--
Demonstrate the code is solid. Example: The exact commands you ran and
their output, screenshots / videos if the pull request changes the user
interface.
How exactly did you verify that your PR solves the issue you wanted to
solve?
  If you leave this empty, your PR will very likely be closed.
-->
EdisonVan pushed a commit to EdisonVan/react that referenced this issue Apr 15, 2024
<!--
  Thanks for submitting a pull request!
We appreciate you spending the time to work on these changes. Please
provide enough information so that others can review your pull request.
The three fields below are mandatory.

Before submitting a pull request, please make sure the following is
done:

1. Fork [the repository](https://github.com/facebook/react) and create
your branch from `main`.
  2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
TestName` is helpful in development.
5. Run `yarn test --prod` to test in the production environment. It
supports the same options as `yarn test`.
6. If you need a debugger, run `yarn test --debug --watch TestName`,
open `chrome://inspect`, and press "Inspect".
7. Format your code with
[prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

Learn more about contributing:
https://reactjs.org/docs/how-to-contribute.html
-->

## Summary
Addresses facebook#26352.

This PR explicitly passes an icon to `chrome.devtools.panels.create()`,
so that edge devtools will display the icon when in [Focus
Mode](https://learn.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/experimental-features/focus-mode).

<!--
Explain the **motivation** for making this change. What existing problem
does the pull request solve?
-->

## How did you test this change?
Passing test suite (`yarn test` & `yarn test --prod`) ✅ 
Passing lint (`yarn linc`) ✅ 
Passing type checks (`yarn flow`) ✅ 

**Visual Testing**

Before Changes             | After Changes
:-------------------------:|:-------------------------:

![](https://user-images.githubusercontent.com/15645169/229591145-fe99df06-e2e3-4f21-ae31-f770d584ca6c.png)
|
![](https://user-images.githubusercontent.com/15645169/229591594-26c6cbaf-f345-4367-b234-8f3c8ab3ccb1.png)
<!--
Demonstrate the code is solid. Example: The exact commands you ran and
their output, screenshots / videos if the pull request changes the user
interface.
How exactly did you verify that your PR solves the issue you wanted to
solve?
  If you leave this empty, your PR will very likely be closed.
-->
bigfootjon pushed a commit that referenced this issue Apr 18, 2024
<!--
  Thanks for submitting a pull request!
We appreciate you spending the time to work on these changes. Please
provide enough information so that others can review your pull request.
The three fields below are mandatory.

Before submitting a pull request, please make sure the following is
done:

1. Fork [the repository](https://github.com/facebook/react) and create
your branch from `main`.
  2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
TestName` is helpful in development.
5. Run `yarn test --prod` to test in the production environment. It
supports the same options as `yarn test`.
6. If you need a debugger, run `yarn test --debug --watch TestName`,
open `chrome://inspect`, and press "Inspect".
7. Format your code with
[prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

Learn more about contributing:
https://reactjs.org/docs/how-to-contribute.html
-->

## Summary
Addresses #26352.

This PR explicitly passes an icon to `chrome.devtools.panels.create()`,
so that edge devtools will display the icon when in [Focus
Mode](https://learn.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/experimental-features/focus-mode).

<!--
Explain the **motivation** for making this change. What existing problem
does the pull request solve?
-->

## How did you test this change?
Passing test suite (`yarn test` & `yarn test --prod`) ✅
Passing lint (`yarn linc`) ✅
Passing type checks (`yarn flow`) ✅

**Visual Testing**

Before Changes             | After Changes
:-------------------------:|:-------------------------:

![](https://user-images.githubusercontent.com/15645169/229591145-fe99df06-e2e3-4f21-ae31-f770d584ca6c.png)
|
![](https://user-images.githubusercontent.com/15645169/229591594-26c6cbaf-f345-4367-b234-8f3c8ab3ccb1.png)
<!--
Demonstrate the code is solid. Example: The exact commands you ran and
their output, screenshots / videos if the pull request changes the user
interface.
How exactly did you verify that your PR solves the issue you wanted to
solve?
  If you leave this empty, your PR will very likely be closed.
-->

DiffTrain build for commit 5426af3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants