374 Commits
Author SHA1 Message Date
Shuaib Hasan Akib d82ac12be1 refactor(devtools): run router tree tests zoneless
Remove `provideZoneChangeDetection()` from the router tree spec and replace
`fixture.detectChanges()` with `await fixture.whenStable()`.

With zones, the single `detectChanges()` never ran the visualizer's render
effect, so the tree was never drawn. Running zoneless now covers rendering
and the initial snap to root, which relies on the previous fix.

Tested with `pnpm bazel test
//devtools/projects/ng-devtools/src/lib/devtools-tabs/router-tree:test_chromium`.
2026-11-12 08:15:51 -08:00
Shuaib Hasan Akib 242efd110f fix(devtools): stop zoom transition when disposing the tree visualizer
Snapping to a node starts a 500ms d3 zoom transition that was not
interrupted on dispose. If the tree visualizer is destroyed mid-transition,
d3-zoom keeps reading the size of the now detached SVG and throws
`NotSupportedError: Failed to read the 'value' property from 'SVGLength'`.

Interrupt any running transition in `dispose()`.

Tested with the router tree spec running zoneless (next commit), which fails
with the error above without this change.
2026-11-12 08:15:51 -08:00
Shuaib Hasan Akib 5f47c3c972 fix(devtools): avoid mutating recorded frames when merging a frame range
When a later frame has a directive that the first selected frame doesn't,
`mergeFrames` added that frame's directive object to the merged result
by reference. Merging the next frame then added its timings into the
recorded frame, so selecting three or more frames inflated the stored
change detection and lifecycle times, and they grew each time the range
was selected again.

Copy the directive before adding it to the merged result.

Tested by adding a spec that merges three frames and checks that the
input frames are unchanged.
2026-10-28 11:41:50 -07:00
Georgi Serev b1375e48a0 fix(devtools): directive explorer breadcrumbs height
- Fix a regression caused by #70688.
- Move `breadcrumbs/` one dir up where it should belong.
2026-10-12 15:29:25 -07:00
hawkgs 500d8709b7 refactor(devtools): remove leading underscores of private class members
Remove all prefixes of private members to match the currently followed convention.
Remaining places that still use underscores (excluded from the refactor):
- `tab-update/index.ts`
- `splitArea.directive.ts` (part of the old vendor code)
2026-10-09 17:14:37 -07:00
Shuaib Hasan Akib d60ee5e27b refactor(devtools): replace deprecated tree APIs in the component tree
`FlatTreeControl` from `@angular/cdk/tree` and `MatTreeFlattener` from
`@angular/material/tree` are deprecated in favor of the tree's
`levelAccessor`/`childrenAccessor` APIs.

The component tree (directive forest) isn't rendered with a CDK tree but
as a flat list in a virtual scroll viewport. It only used
`FlatTreeControl` to track which nodes are expanded, and
`MatTreeFlattener` to flatten the forest and compute the visible nodes.

Replace them with:
- An `ExpansionModel` that tracks expanded nodes with a
  `SelectionModel`, like `FlatTreeControl` did internally, and exposes
  the `expand`, `collapse`, `toggle`, `isExpanded` and `changed` members
  used by devtools.
- Local helpers in `ComponentDataSource` that flatten the forest in
  depth-first order and return the nodes whose ancestors are all
  expanded, matching the previous behavior.

Also add a spec covering which nodes are visible as nodes are expanded
and collapsed.
2026-10-02 10:59:10 -04:00
Shuaib Hasan Akib a36155d9ef refactor(devtools): import rxjs operators from the rxjs entry point
Since RxJS 7.2, all operators are exported from the main `rxjs` entry
point, and RxJS recommends importing them from there. `rxjs/operators`
is only kept for backward compatibility and is expected to be removed in
a future major version.

Switch the remaining `rxjs/operators` imports in devtools to `rxjs`,
merging them into the existing `rxjs` import where there is one. Unlike
the framework packages, which still support RxJS 6 through their peer
dependency range, devtools is bundled with the repository's RxJS 7, so
this is safe.

No runtime or bundle size changes: both entry points expose the same
tree-shakable operators.
2026-10-02 09:45:36 -04:00
Shuaib Hasan Akib 46c37e50b4 fix(devtools): clean up profiler component subscriptions on destroy
Cleans up `uploadedData` and message bus subscriptions when the profiler
is destroyed to prevent duplicate error dialogs and stale profiler results
from accumulating across profiler instances.

Adds coverage for subscription cleanup on destroy.
2026-10-01 13:37:45 -04:00
Andrew Scott 03795a9f5d fix(devtools): use MouseEvent for mouseover and mouseout listeners in tree visualizer
In @types/d3-selection >= 3.0.12, listener callbacks for mouseover and mouseout
events are strongly typed to receive MouseEvent. Because PointerEvent is a
subtype of MouseEvent, typing the listener parameter as PointerEvent causes
a TypeScript compilation error.

Update nodeMouseoverListeners and nodeMouseoutListeners in GraphRenderer and the
corresponding D3 event handlers in TreeVisualizer to use MouseEvent.
2026-09-29 15:35:57 -07:00
Luca ad548b9c00 fix(devtools): hide watch signal button when not supported by application
Hide the watch signal button in signal details when the host application
does not support `window.ng.toggleWatchSignal` (e.g. applications running
on Angular versions prior to the introduction of signal watch debugging).

Fixes #70948
2026-09-29 13:14:06 -07:00
Edu 36a0ab6ed8 fix(devtools): sync breakpoint UI state and allow removal after debugger detach
When a user cancels Chrome's debugging infobar while a signal breakpoint is active, `chrome.debugger.onDetach` clears the active breakpoints map in the background service worker. Previously, the DevTools panel UI was not notified of this event, leaving the breakpoint icon displayed as active, and subsequently clicking to disable it threw an error because the entry was already absent from `activeBreakpoints`.

This change:
1. Broadcasts a `signalBreakpointsCleared` message from `BreakpointManager` when `chrome.debugger.onDetach` fires so `SignalGraphPaneComponent` immediately clears its active breakpoints state.
2. Makes `BreakpointManager.removeBreakpoint` return early as a no-op if the breakpoint or tab entry is already absent.

Fixes #70949
2026-09-29 12:20:46 -07:00
Georgi Serev 1881f9dc0d feat(devtools): add ability to toggle control flow and defer blocks
Add options for toggling @for and @defer blocks in the settings.
2026-09-23 08:48:31 -07:00
Georgi Serev 86f4c88a43 refactor(devtools): use responsive split for the components tab
Drop the `ResizeObserver` in favor of `NgResponsiveSplit`;
Extend `NgResponsiveSplit` functionality to include width breakpoints;
2026-09-21 09:33:46 -07:00
Aleksander Bodurri 463cbea4fa test(devtools): remove unnecessary TestBed imports in directive forest spec
Remove the explicit 'imports' configuration in TestBed since the
component is resolved automatically. Simplify beforeEach accordingly.
2026-09-17 10:09:24 -07:00
Aleksander Bodurri 950603097b perf(devtools): stop Map copying in handleFilter
Before: handleFilter cloned the entire matchedNodes Map on every match inside the iteration loop.

After: handleFilter accumulates matches in a local Map and performs a single atomic update to matchedNodes at the end of the loop in O(n) time.
2026-09-17 10:09:24 -07:00
Georgi Serev 1750003024 fix(devtools): make tab buttons visually accessible on small viewports
Reuse breadcrumbs scroll behavior (in the form of a reusable component)
for the main tabs bar.
2026-09-16 15:05:53 +02:00
Georgi Serev fe94aae034 refactor(devtools): introduce a global backend config
- Unify the multiple scattered feature-specific flags into a single
global backend config
- Fix initial settings data exchange between the fe and be on prod
2026-09-16 14:12:42 +02:00
hawkgs 635ef1bd80 refactor(devtools): contain hydration overlays functionality on the be
Move the refresh mechanism of the hydration overlays to the backend,
delegating only the feature toggling to the frontend.
2026-09-09 16:10:25 +02:00
hawkgs 00ec65546b refactor(devtools): fix signal details UI
Fix different action buttons and value preview container size.
2026-09-01 09:33:35 -07:00
hawkgs 07605ba793 feat(devtools): implement CD analyzer (#70254)
Implement component highlighting on change detection cycles along with embedding
the component-specific data to the directive/component tree explorer.

Closes #59057

PR Close #70254
2026-08-25 10:35:42 -07:00
Cameron Smick 82a767535e feat(devtools): add "Watch signal" button to signal-details component
Add a "Watch signal" button to the signal-details component to allow users to "watch" changes to the associated signal.
2026-08-24 15:35:44 -07:00
Aleksander Bodurri 434acc506e refactor(devtools): update profiler instruction text for clearing recordings
I suspect this text used to be correct but became outdated after UI changes. These is no "refresh" button.
2026-08-24 10:34:37 -07:00
splincode d35c17d393 refactor: correct typos in comments, docs, and error messages
Fix misspellings found across multiple packages:

- `paramters` → `parameters` (utils.spec.ts)
- `directve` → `directive` (typecheck/context.ts)
- `subscriper` → `subscriber` (zone.js rxjs test)
- `swich` → `switch` (adev animation parser test)
- `subscribtion` → `subscription` (forms/abstract_model.ts)
- `lifecyle` → `lifecycle` (ng-devtools-backend hooks)
- `compatability` → `compatibility` (tree-visualizer.ts)
- `indentifier(s)` → `identifier(s)` (compiler-cli shared.ts, i18n_helpers.ts, declaration_only_emission_spec.ts)
- `identifer` → `identifier` (platform-browser shared_styles_host.ts)
- `prcess` → `process` (standalone-migration to-standalone.ts)
2026-08-17 14:57:04 -07:00
hawkgs 9711e86f2a refactor(devtools): collapse injected services section in the side pane by default
Collapse the section since it takes a significant portion of the vertical space,
whereas most of the times users are exploring the properties leading them to scroll.

Addiotionally, introduce some other minor UI improvements.
2026-08-17 13:30:46 -07:00
hawkgs f746463caa fix(devtools): breadcrumbs missing nav arrows
Show the missing nav arrows when you select a deeply nested component where
the breadcrumbs path is longer than the container. The nav arrows used to
appear only when the split is resized. Add some other minor improvements.
2026-08-17 13:29:05 -07:00
Aleksander Bodurri 2a2585708a fix(devtools): clarify disabled View Source tooltip and update demo app
Before: The View Source button tooltip in signal details static ('View source') even when disabled.

After: The tooltip explains 'Source location is not available for this node' when disabled.
2026-08-17 13:28:27 -07:00
Aleksander Bodurri a3a7764975 fix(devtools): prevent duplicate highlightComponent listener in injector tree
Move the message bus subscription out of afterRenderEffect into constructor initialization and clean up the listener on destroy using DestroyRef.
2026-08-17 10:37:40 -07:00
Edu 12b0acd498 feat(devtools): implement persistent breakpoints on signal consumers using CDP
Implements persistent breakpoints for Angular signal consumers (computeds and effects) in Angular DevTools using Chrome DevTools Protocol (CDP).

- Adds debugger permission to Chrome and Firefox extension manifests.
- Implements CDP breakpoint orchestration in background script.
- Updates SignalDetailsComponent and SignalGraphPaneComponent with label icon toggle and persistent state sync across reloads.
2026-08-14 08:26:55 -07:00
Georgi Serev 66c5ea7544 refactor(devtools): improve profiler ux
- Add info tooltips that describe the visualizations and other
parts of the UI
- Improve the frame selector by adding axes labels and a
horizontal line for frames exceeding 60 fps
- Use a precise frame rate calculations instead of approximations
- Introduce improvements to the details panel
- Improve the bar chart visualization
- And more
2026-08-11 10:00:02 -07:00
hawkgs e144e697ff refactor(devtools): substitute remaining Angie images with ng-angie
Substitute the remaining `<img>`s with the Angie component.
2026-07-31 08:36:09 -07:00