Skip to content

Commit a8b57cc

Browse files
heqikaicursoragent
andcommitted
fix(panorama): dedupe fetches and densify large-repo overviews
Consolidate PanoramaPage loading behind URL-driven fetch with request deduping; scale subgraph budgets, auto-expand sparse entry trees, and add an entry-surface sidebar for large-repo navigation. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 989e8ec commit a8b57cc

7 files changed

Lines changed: 412 additions & 168 deletions

File tree

apps/web/src/components/PanoramaGraphView.tsx

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,14 @@ export default function PanoramaGraphView({
359359
graph &&
360360
!canGoToOverview &&
361361
(graph.stats.snapshotNodeCount ?? 0) >= 300 &&
362-
graph.stats.nodeCount <= (graph.stats.entrySurfaceCount ?? 6) + 10;
362+
graph.stats.nodeCount <= Math.max((graph.stats.entrySurfaceCount ?? 6) * 3, 24);
363+
364+
const showEntryCatalog =
365+
graph?.entryCatalog &&
366+
graph.entryCatalog.length > 0 &&
367+
!canGoToOverview &&
368+
onFocusEntry &&
369+
(sparseOverview || graph.entryCatalog.length > 6);
363370

364371
if (loading) {
365372
return <p className="hint panorama-status">Loading panorama…</p>;
@@ -391,10 +398,13 @@ export default function PanoramaGraphView({
391398
? ` · ${graph.stats.snapshotNodeCount.toLocaleString()} indexed`
392399
: ''}
393400
{graph.stats.truncated ? ' · truncated — expand a node to go deeper' : ''}
401+
{graph.stats.effectiveDepth && graph.stats.effectiveDepth > 3
402+
? ` · depth ${graph.stats.effectiveDepth} (large repo boost)`
403+
: ''}
394404
</span>
395405
{sparseOverview && (
396406
<span className="hint panorama-overview-hint">
397-
Overview shows top entry routes and components only — click{' '}
407+
Overview shows top entry routes and components — pick an entry below or click{' '}
398408
<em>Expand from here</em> on a route or mount point to open its call tree.
399409
</span>
400410
)}
@@ -443,6 +453,25 @@ export default function PanoramaGraphView({
443453
</div>
444454
{exportError && <p className="hint panorama-export-error">{exportError}</p>}
445455

456+
{showEntryCatalog && (
457+
<div className="panorama-entry-sidebar">
458+
<h4>Entry surfaces ({graph!.entryCatalog!.length})</h4>
459+
<p className="hint panorama-entry-sidebar-hint">
460+
Jump into a route, component, or exported handler.
461+
</p>
462+
<ul className="panorama-entry-list">
463+
{graph!.entryCatalog!.map((entry) => (
464+
<li key={entry.id} className={entry.inGraph ? 'panorama-entry-list-item--in-graph' : ''}>
465+
<Button variant="link" onClick={() => onFocusEntry!(entry.qualifiedName)}>
466+
<span className="panorama-entry-kind">{entry.kind}</span>
467+
{entry.qualifiedName}
468+
</Button>
469+
</li>
470+
))}
471+
</ul>
472+
</div>
473+
)}
474+
446475
{impactedEntryPoints && impactedEntryPoints.length > 0 && onFocusEntry && (
447476
<div className="panorama-entry-sidebar">
448477
<h4>Impacted entry points</h4>

0 commit comments

Comments
 (0)