Repository navigation
feat(extension): reveal the selected component in Elements and open its source - #223
Draft
erkamyaman wants to merge 1 commit into
Draft
erkamyaman wants to merge 1 commit into
erkamyaman wants to merge 1 commit into
Conversation
…ts source Selection only went from the Elements panel to Components. The Components detail now shows the component's file and line from Angular's dev debugInfo, and, inside the Chrome extension, Reveal in Elements selects its host element and Open source opens the file in Sources, falling back to the class definition. Refs pangular-inspector#164
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
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
Selection only went one way, from the Elements panel to Components. This adds the other direction for #164.
component-source.tsreadsɵcmp.debugInfo(filePath, 1-basedlineNumber, dev builds only) intodetail.source, and installs__pangularHostOf/__pangularClassOfhelpers scoped to the page id, only when the components inspector is on. No DOM writes.panel-actions.jshandlespangular:reveal-element(inspect(host)) andpangular:open-source(matches the file againstgetResources()and callsopenResource, falling back toinspect(class)). Ids and page ids are validated, and only the UI frame on our origin can send.file:line(debugInfo first, then the source scan), plus Reveal in Elements and Open source buttons, only inside the extension with a connected page (not Angular Native or a static report). Failures show in a status line.Refs #164
How it was verified
pnpm commit:check,pnpm format:check,pnpm typecheck,pnpm skills:checkpnpm test:devtools(1182) andpnpm test:panel(114)pnpm docs:build,pnpm test:axepnpm extension:buildandextension/uicommittedManual test
pnpm build --configuration development && node dist/pangular-inspector/server/server.mjs, reload the unpackedextension/, open http://localhost:4000, then DevTools > Pangular Inspector > Components.src/app/...ts:Nand the two buttons. Reveal in Elements should select its host in Elements..tsfile at theexport classline in Sources. If it's one line off, adjustline - 1inextension/panel-actions.js; if compiled JS opens,getResources()doesn't list source-mapped files and the class fallback ran.Decisions to confirm
actions: they don't change app state, add no RPC or agent tool. They need the components inspector on.