Content-Length: 304715 | pFad | http://github.com/angular/angular/pull/60694

9A refactor(devtools): switch to components tab whenever the inspector is used by hawkgs · Pull Request #60694 · angular/angular · GitHub
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

refactor(devtools): switch to components tab whenever the inspector is used #60694

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hawkgs
Copy link
Member

@hawkgs hawkgs commented Apr 2, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the new behavior?

Switch to the Components tab, if on a different tab, when a component is selected via the inspector.

cc @dgp1130

Does this PR introduce a breaking change?

  • Yes
  • No

…s used

Switch to the components tab, if not there, when a component is selected via the inspector.
@pullapprove pullapprove bot requested a review from mgechev April 2, 2025 10:41
@hawkgs hawkgs requested review from AleksanderBodurri and removed request for mgechev April 2, 2025 10:41
@ngbot ngbot bot added this to the Backlog milestone Apr 2, 2025
@hawkgs hawkgs requested a review from dgp1130 April 4, 2025 12:25
@@ -95,6 +95,13 @@ export class DevToolsTabsComponent {
this.routes.set(routes || []);
});

// Change the tab to Components, if an element is selected via the inspector.
this._messageBus.on('selectComponent', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Just for my understanding, when is this event emitted? How does a user select a component outside of the UI? Is there an ng global API which triggers this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess my description was not very clear. Basically, when you are on a different tab from Components, using the inspector, which is available for use irrespective of the tab you're on, doesn't redirect you to the Components tab. The PR makes the behavior identical to Chrome DevTools element inspector where using the inspector from the Network tab, for example, will redirect you back to Elements.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I didn't realize the inspector button was available on different tabs, makes sense that we should switch to the Components tab when used.

(Related: Maybe it shouldn't be available on other tabs? 🤔)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's handy. Personally, I find myself occasionally using the element inspector from tabs different from Elements. Plus, it's consistent with Chrome DevTools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/angular/angular/pull/60694

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy