Skip to content

chore: refactor and remove duplicates - #48

Merged
santoshyadavdev merged 2 commits into
mainfrom
refactor-duplicate-code
Sep 28, 2026
Merged

santoshyadavdev merged 2 commits into
mainfrom
refactor-duplicate-code

Conversation

@santoshyadavdev

@santoshyadavdev santoshyadavdev commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Added consistent locale-specific time formatting across inspector and timeline views.
    • Improved source-file discovery used by project analysis, with support for limiting traversal depth.
  • Refactor
    • Standardized RPC calls and text clipping across the app, reducing inconsistent handling of failures and long text.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Essentials

Run ID: 3f41773a-8d37-4d5d-827c-3e6035f76754

📥 Commits

Reviewing files that changed from the base of the PR and between f0ccc91 and 02254f8.

⛔ Files ignored due to path filters (2)
  • extension/ui/assets/index-BO7DtGyn.css is excluded by !**/assets/index-[0-9a-z_-][0-9a-z_-][0-9a-z_-][0-9a-z_-][0-9a-z_-][0-9a-z_-][0-9a-z_-][0-9a-z_-].css
  • extension/ui/assets/index-BPVPMcLi.js is excluded by !**/assets/index-[0-9a-z_-][0-9a-z_-][0-9a-z_-][0-9a-z_-][0-9a-z_-][0-9a-z_-][0-9a-z_-][0-9a-z_-].js
📒 Files selected for processing (36)
  • app/src/format.ts
  • app/src/pages/analog-inspector.ts
  • app/src/pages/coming-soon.ts
  • app/src/pages/component-tree.ts
  • app/src/pages/di-inspector.ts
  • app/src/pages/forms-timeline.ts
  • app/src/pages/forms-types.ts
  • app/src/pages/live-route.ts
  • app/src/pages/network-inspector.ts
  • app/src/pages/pipes-inspector.ts
  • app/src/pages/route-timeline.ts
  • app/src/pages/router-types.ts
  • app/src/pages/signal-inspector.ts
  • app/src/pages/store-inspector.ts
  • app/src/rpc.ts
  • app/src/styles/_base.scss
  • extension/ui/assets/browser-agent-rpc-BXhoSh1z-BQdhADiM.js
  • extension/ui/index.html
  • packages/ng-devtools/src/forms-actions.ts
  • packages/ng-devtools/src/forms.ts
  • packages/ng-devtools/src/http.ts
  • packages/ng-devtools/src/hub.ts
  • packages/ng-devtools/src/router.ts
  • packages/ng-devtools/src/rpc/forms-source.ts
  • packages/ng-devtools/src/rpc/get-components.ts
  • packages/ng-devtools/src/rpc/get-ngrx-store.ts
  • packages/ng-devtools/src/rpc/get-pipes.ts
  • packages/ng-devtools/src/rpc/get-providers.ts
  • packages/ng-devtools/src/rpc/get-routes.ts
  • packages/ng-devtools/src/rpc/get-signals.ts
  • packages/ng-devtools/src/rpc/pipe-explain.ts
  • packages/ng-devtools/src/rpc/pipe-lint.ts
  • packages/ng-devtools/src/rpc/server-routes.ts
  • packages/ng-devtools/src/rpc/source-scan.ts
  • packages/ng-devtools/src/serialize.ts
  • packages/ng-devtools/src/text.ts
💤 Files with no reviewable changes (6)
  • app/src/pages/pipes-inspector.ts
  • app/src/pages/component-tree.ts
  • app/src/pages/signal-inspector.ts
  • app/src/pages/di-inspector.ts
  • app/src/pages/live-route.ts
  • app/src/pages/coming-soon.ts

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

This change adds shared app format and RPC helpers, consolidates filesystem traversal for source scanners, and centralizes package text-formatting helpers. It also moves shared styles into the base stylesheet, updates type-only imports, and refreshes extension UI asset references.

Changes

App shared utilities and styles

Layer / File(s) Summary
Shared time, RPC, and style helpers
app/src/format.ts, app/src/rpc.ts, app/src/styles/_base.scss
Adds shared time formatting and RPC helpers. Adds shared spinner keyframes and visually hidden styles.
Page adoption and local style removal
app/src/pages/analog-inspector.ts, app/src/pages/coming-soon.ts, app/src/pages/component-tree.ts, app/src/pages/di-inspector.ts, app/src/pages/forms-timeline.ts, app/src/pages/forms-types.ts, app/src/pages/live-route.ts, app/src/pages/network-inspector.ts, app/src/pages/pipes-inspector.ts, app/src/pages/route-timeline.ts, app/src/pages/router-types.ts, app/src/pages/signal-inspector.ts, app/src/pages/store-inspector.ts
Pages use shared time or RPC helpers where applicable. Local spinner keyframes and visually hidden rules are removed from page styles.

Shared source traversal

Layer / File(s) Summary
Shared filesystem walker
packages/ng-devtools/src/rpc/source-scan.ts
Adds walkFiles to visit files recursively, skip symlinks and ignored directories, enforce an optional depth limit, and stop when a visitor returns false.
Source entity scanner migration
packages/ng-devtools/src/rpc/forms-source.ts, packages/ng-devtools/src/rpc/get-components.ts, packages/ng-devtools/src/rpc/get-ngrx-store.ts, packages/ng-devtools/src/rpc/get-pipes.ts, packages/ng-devtools/src/rpc/get-providers.ts, packages/ng-devtools/src/rpc/get-routes.ts, packages/ng-devtools/src/rpc/get-signals.ts
Source entity scanners delegate file discovery to walkFiles. Existing file filters remain, and NgRx store and provider detection are organized into per-file scanning functions.
Route and pipe-lint discovery
packages/ng-devtools/src/rpc/pipe-lint.ts, packages/ng-devtools/src/rpc/server-routes.ts
Pipe lint and server-route discovery use walkFiles, retaining their file filters and applying file-count and depth limits.

Shared package text helpers

Layer / File(s) Summary
Shared text helper
packages/ng-devtools/src/text.ts
Adds clip to truncate text and append an ellipsis when the text exceeds the limit.
Package helper reuse
packages/ng-devtools/src/forms-actions.ts, packages/ng-devtools/src/forms.ts, packages/ng-devtools/src/router.ts, packages/ng-devtools/src/serialize.ts, packages/ng-devtools/src/rpc/pipe-explain.ts
Forms actions, forms details, router exports, and serialization reuse clip. Pipe explanations import the shared code formatter.

Type-only imports

Layer / File(s) Summary
Type-only import declarations
packages/ng-devtools/src/http.ts, packages/ng-devtools/src/hub.ts
Moves HTTP types, Subscription, and InitHubOptions into type-only imports. Runtime imports remain unchanged.

Extension UI bundle references

Layer / File(s) Summary
Hashed asset references
extension/ui/index.html, extension/ui/assets/browser-agent-rpc-BXhoSh1z-BQdhADiM.js
Updates the UI HTML asset references and the browser-agent RPC module’s imported bundle path.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor

Suggested labels: enhancement

Suggested reviewers: erkamyaman

Merge Risk: ⚪ Minimal · up to 02254

The refactor preserves the reviewed behavior, with no identified issue requiring a fix before merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.51% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 37 functions across 28 files. (2 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the pull request. The changes refactor shared helpers and remove duplicated implementations across formatting, RPC, text clipping, and source traversal.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 13.51% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 37 functions across 28 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

A rabbit checks the files at dawn
And finds the shared helpers tucked in
It clips a line, then hops along
Through source paths, quiet and thin
New bundle links greet the morning sun

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit e822344

Command Status Duration Result
nx affected -t test build ✅ Succeeded 18s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-09-28 20:12:05 UTC

@coderabbitai coderabbitai Bot added the enhancement New feature or request label Sep 28, 2026
@santoshyadavdev
santoshyadavdev merged commit 3eef699 into main Sep 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant