Skip to content

feat(mcp): surface template-view callers in explore blast radius#960

Open
Johnny-Tsai wants to merge 1 commit into
colbymchenry:mainfrom
Johnny-Tsai:pr/explore-view-callers
Open

feat(mcp): surface template-view callers in explore blast radius#960
Johnny-Tsai wants to merge 1 commit into
colbymchenry:mainfrom
Johnny-Tsai:pr/explore-view-callers

Conversation

@Johnny-Tsai

Copy link
Copy Markdown

What

In the codegraph_explore blast-radius section, list template-view callers (.cshtml / .razor / .vue / .svelte / .astro) in their own slot instead of letting them compete with same-language code callers under a single flat cap.

Why

Caller files were listed under one FILE_CAP (4) before +N more. Template views are cross-layer callers — a change to a JS/TS helper ripples into the views that use it — but they're typically far fewer than the same-language code callers, so they got drowned out and vanished into +N more.

Concretely: a JS helper used by 4 .js files and 22 .cshtml views would render 0 views, hiding the answer to "which views depend on this?". This showed up on a real .NET MVC ERP, where view callers of shared JS helpers are exactly what you need to see before editing.

How

Split nonTest callers into viewFiles (by extension) and codeFiles, each capped independently. Code callers keep the existing in … phrasing; views get an appended ; N view(s): … slot. Pure side-by-side display change — no graph/edge changes.

Testing

Added a case to explore-blast-radius.test.ts: a helper with more than FILE_CAP code callers plus a .vue view now surfaces the view in its own dedicated slot rather than burying it behind the code-caller +N more. Existing blast-radius tests still pass.

Note: the most natural fixture would use a .cshtml view calling JS from an inline <script>, which depends on the Razor <script> indexing in #959. This PR uses .vue (already supported) to keep it self-contained; the same display path covers .cshtml once #959 lands.

🤖 Generated with Claude Code

The blast-radius section listed caller files under a single flat cap
(FILE_CAP), so template views (.cshtml/.razor/.vue/.svelte/.astro) —
which are cross-layer callers a JS/TS change ripples into — were easily
drowned out by the more numerous same-language code callers and vanished
into "+N more". A JS helper used by 4 .js files and 22 views would show
0 views, hiding the answer to "which views depend on this?".

Split view files into their own slot so they always surface alongside
(not competing with) the code callers, each capped independently.

Tested in explore-blast-radius.test.ts: a helper with >FILE_CAP code
callers plus a .vue view now shows the view in its own dedicated slot.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant