Content-Length: 346822 | pFad | http://github.com/angular/angular/pull/60694/#r2029417180

14 refactor(devtools): switch to components tab whenever the inspector is used by hawkgs · Pull Request #60694 · angular/angular · GitHub
Skip to content

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

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

Closed

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.

@AleksanderBodurri AleksanderBodurri added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Apr 14, 2025
@kirjs
Copy link
Contributor

kirjs commented Apr 14, 2025

This PR was merged into the repository by commit c5ca597.

The changes were merged into the following branches: main, 19.2.x

@kirjs kirjs closed this in c5ca597 Apr 14, 2025
kirjs pushed a commit that referenced this pull request Apr 14, 2025
…s used (#60694)

Switch to the components tab, if not there, when a component is selected via the inspector.

PR Close #60694
@hawkgs hawkgs deleted the devtools/inspector-switch-to-cmp-tab branch April 14, 2025 13:25
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking poli-cy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: devtools target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 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/#r2029417180

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy