Repository navigation
feat(router): show routed components in the Components tab - #267
Merged
Merged
Conversation
The Current view listed each outlet's routed component as plain text, so finding it in the component tree meant switching tabs and searching by name. The router report already carries the devtools id of the routed component's host element, and the component tree uses the same id for its routed badges. Each activated outlet with an id now has a Show in Components button. It opens the Components tab with that component selected and scrolled into view. The focus is set after the tab switch, because the focus signal resets when the tab changes. The button is hidden when the outlet has no id or the Components inspector is turned off.
Contributor
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
5 tasks done
Show in Components sent only the component id, so the Components tab looked for it on the page it already showed. With two app tabs, or after picking another page in the Router page picker, the click switched tabs and did nothing. The router now sends the page it shows along with the id. The Components tab switches to that page before selecting the component, and says when the component is no longer on the page.
…onents # Conflicts: # app/src/__tests__/router-panels.test.ts # extension/ui/assets/browser-agent-rpc-BXhoSh1z-3lTsX0b0.js # extension/ui/assets/browser-agent-rpc-BXhoSh1z-BdhmaYxc.js # extension/ui/assets/browser-agent-rpc-BXhoSh1z-C_twCiPD.js # extension/ui/assets/index-BCjCE1wD.js # extension/ui/assets/index-BEfrZ0QX.js # extension/ui/assets/index-Diz7ulJK.js # extension/ui/index.html
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What and why
The Router Current view listed each outlet's routed component as plain text, so finding that component in the tree meant switching tabs and searching for it by name. The router report already carries the devtools id of the routed component's host element, and the component tree uses it for its routed badges. The panel's
OutletInfotype left that id out.Each activated outlet with an id now has a Show in Components button. Its accessible name includes the component name, for example "Show in Components: Shell". Clicking it opens the Components tab with that component selected and scrolled into view. The button is hidden when the outlet has no id or the Components inspector is turned off.
How it was verified
pnpm commit:check: 1 commit message OKpnpm format:check: all files passpnpm typecheck: exit 0, noerror TSorerror NGlinespnpm test:panel: 30 files, 169 tests passed (5 new)inspectors/router.md, Current view) andpnpm docs:buildpassespnpm extension:build:extension/uirebuilt and committedscripts/panel-axe.mjson the static report, dark and light: all 28 views pass.Notes for reviewers
componentFocusis a linked signal that resets on tab change, so setting it first would lose it. A test covers this.devtoolsIdwas already in the router report.Summary by CodeRabbit