-
Notifications
You must be signed in to change notification settings - Fork 4
feat/pipes-inspector : introducing pipes inspector #28
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,243 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { Component, input, signal, effect } from '@angular/core'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import type { DevframeRpcClient } from 'devframe/client'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| interface PipeInfo { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| className: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| file: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| line: number; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isStandalone: boolean; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isPure: boolean; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Component({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| selector: 'app-pipes-inspector', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| template: ` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="toolbar"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <input | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type="text" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| placeholder="Filter pipes…" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [value]="filter()" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (input)="filter.set($any($event.target).value)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <button (click)="refresh()">Refresh</button> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @if (loading()) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <p class="muted">Scanning pipes…</p> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } @else if (filtered().length === 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <p class="muted">No pipes found.</p> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } @else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <ul class="pipe-list" role="list"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @for (p of filtered(); track p.file + p.name) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <li class="pipe-item" [class.expanded]="isSelected(p)"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <button class="pipe-toggle" [attr.aria-expanded]="isSelected(p)" (click)="select(p)"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="name-row"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span class="badge" [class.impure]="!p.isPure">{{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| p.isPure ? 'pure' : 'impure' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }}</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span class="name">{{ p.name }}</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @if (!p.isStandalone) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span class="badge module">module</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="file">{{ p.file }}:{{ p.line }}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </button> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @if (isSelected(p)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div class="inline-detail"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <dl> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <dt>Class</dt> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <dd>{{ p.className }}</dd> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <dt>File</dt> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <dd>{{ p.file }}:{{ p.line }}</dd> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <dt>Standalone</dt> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <dd>{{ p.isStandalone ? 'Yes' : 'No' }}</dd> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <dt>Pure</dt> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <dd>{{ p.isPure ? 'Yes' : 'No' }}</dd> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </dl> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </li> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </ul> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| styles: ` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .toolbar { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| display: flex; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gap: 8px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| margin-bottom: 16px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| input { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| flex: 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| padding: 8px 12px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: #18181b; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border: 1px solid #27272a; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-radius: 6px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #e4e4e7; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-size: 14px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| outline: none; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| input:focus { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-color: var(--accent); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| button { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| padding: 8px 16px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: #3f3f46; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border: none; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-radius: 6px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #e4e4e7; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cursor: pointer; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-size: 13px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| button:hover { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: #52525b; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .muted { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #71717a; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-size: 14px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .pipe-list { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| list-style: none; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| padding: 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| display: flex; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| flex-direction: column; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gap: 8px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .pipe-item { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: #18181b; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border: 1px solid #27272a; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-radius: 8px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| padding: 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| transition: border-color 0.15s; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .pipe-item:has(.pipe-toggle:hover) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-color: var(--accent); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .pipe-item.expanded { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-color: var(--accent); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .pipe-toggle { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| display: block; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| width: 100%; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| padding: 12px 16px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: none; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border: none; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: inherit; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| text-align: left; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cursor: pointer; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font: inherit; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .name-row { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| display: flex; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| align-items: center; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gap: 8px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .name { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-family: monospace; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-size: 15px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: var(--accent); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-weight: 600; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .badge { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-size: 11px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| padding: 2px 8px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-radius: 4px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: #14532d; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #4ade80; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-weight: 600; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| text-transform: uppercase; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| letter-spacing: 0.05em; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .badge.impure { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: #7c2d12; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #fdba74; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .badge.module { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: #3f3f46; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #a1a1aa; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .file { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-size: 12px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #71717a; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| margin-top: 2px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .inline-detail { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| padding: 0 16px 12px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-top: 1px solid #27272a; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| margin-top: 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| padding-top: 12px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dl { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| display: grid; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| grid-template-columns: auto 1fr; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gap: 4px 12px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-size: 13px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dt { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #71717a; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dd { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #e4e4e7; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export class PipesInspector { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rpc = input<DevframeRpcClient | null>(null); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pipes = signal<PipeInfo[]>([]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| filter = signal(''); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| loading = signal(false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| selected = signal<PipeInfo | null>(null); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| filtered = signal<PipeInfo[]>([]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| constructor() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| effect(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const q = this.filter().toLowerCase(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const all = this.pipes(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| this.filtered.set( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| q | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ? all.filter( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (p) => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| p.name.toLowerCase().includes(q) || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| p.className.toLowerCase().includes(q) || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| p.file.includes(q), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| : all, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| effect(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const client = this.rpc(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (client) this.refresh(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| async refresh() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const client = this.rpc(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!client) return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| this.loading.set(true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const my = client.scope('ng-devtools'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const pipes = (await my.rpc.call('get-pipes')) as PipeInfo[]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| this.pipes.set(pipes); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const sel = this.selected(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (sel) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const refreshed = pipes.find((p) => p.name === sel.name && p.file === sel.file); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| this.selected.set(refreshed ?? null); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } finally { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| this.loading.set(false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+217
to
+233
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win Handle
Proposed fix }
+ } catch {
+ // RPC not available
} finally {📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isSelected(pipe: PipeInfo): boolean { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const sel = this.selected(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return sel !== null && sel.name === pipe.name && sel.file === pipe.file; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| select(pipe: PipeInfo) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| this.selected.set(this.isSelected(pipe) ? null : pipe); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| export type Tab = | ||
| 'dashboard' | 'components' | 'pipes' | 'routes' | 'signals' | 'injectors' | 'store' | 'forms'; | ||
|
|
||
| export type Tabs = { | ||
| id: Tab; | ||
| label: string; | ||
| }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: santoshyadavdev/angular-devtools
Length of output: 3683
🏁 Script executed:
Repository: santoshyadavdev/angular-devtools
Length of output: 25749
🤖 get_repo_knowledge executed:
get_repo_knowledge santoshyadavdev/angular-devtools /tmp/coderabbit-repo-knowledge/santoshyadavdev-angular-devtools-c1f3cdb3/conventionsLength of output: 10559
🏁 Script executed:
Repository: santoshyadavdev/angular-devtools
Length of output: 13459
Lowercase the file path before filtering.
filter()is lowercased, butp.fileis compared unchanged. A scanned path with uppercase characters can fail to match a lowercase query.Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents