Repository navigation
feat(viewer): add map scopes, grouping depth and dependency focus - #1901
Draft
nakul-malhotra wants to merge 13 commits into
Draft
nakul-malhotra wants to merge 13 commits into
nakul-malhotra wants to merge 13 commits into
Conversation
nakul-malhotra
marked this pull request as ready for review
September 18, 2026 18:44
nakul-malhotra
marked this pull request as draft
September 18, 2026 19:48
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make the Architecture Map navigable by named folder scopes, configurable grouping depth, and dependency focus.
Select a module and choose Focus to show it and its transitive dependencies. Switch to Used by to trace callers instead. Focus searches the indexed repository beyond the selected folder, so a component's page-level consumers remain visible. Clear focus restores the previous folder and grouping settings.
Previously, folder-local relationships could make a component appear to have no callers when its consumers lived elsewhere. The fixed grouping ceiling also limited inspection of deeply nested folders. Named scopes and configurable depth control the starting view; focus follows relationships across that boundary.
How it fits together
codegraph.jsonloader supplies validated map presets and grouping limits.This establishes reachability between indexed modules, not exact runtime execution paths. Existing confidence rules and the test-module filter still apply. Grouping stays fixed during focus; removing or renaming the selected module in the index still produces a recoverable error.
Project configuration
{ "viewer": { "map": { "maxDepth": 12, "scopes": [ { "label": "Backend", "root": "server" }, { "label": "Shared services", "root": "server/shared" }, { "label": "Frontend", "root": "src" } ] } } }Manual grouping defaults to four levels and accepts configured limits from 1 to 32. Automatic grouping retains its four-level ceiling and respects a lower configured limit. Refreshing applies configuration changes without rebuilding the index.
Compatibility and limits
The UI retains its independent package boundary and replaceable adapter. Ordinary views work with older adapters; a focus request lacking repository-context support produces an explicit recovery message instead of a misleading folder-only graph. No extraction, index schema, telemetry or dependency changes are included.
New focus URLs include the resolved grouping snapshot. Earlier canonical focus URLs with an explicit folder and depth remain valid; ambiguous automatic-focus links and malformed roots fail with a recovery action.
Focus is at module granularity: aggregation can connect relationships that belong to different symbols within a module. Large transitive closures can remain visually dense. The existing narrow-screen page overflow is outside this change.
Preview and verification
The supplied visual evidence uses a synthetic twelve-file project.
Final control states: keyboard Focus action, dependency focus, included tests with expanded Key, and an automatic-origin focus with its return settings.
Traversal examples before the final return-label refinement
Used by: callers outside the starting
featurefolder become visible.Depends on: the selected module, multi-hop dependencies and their cycle.
An isolated module remains visible, with an explanation and a named return destination.
An unavailable focus produces one recovery action.
Ordinary folder view before focus support (left) and after (right): the negative control for graph membership and layout.
Browser checks cover both directions, multi-hop paths and cycles, test-mediated paths, isolated modules, refocusing, clear and folder changes, reload/sharing/history, invalid links, retrieval failures, and older adapters without repository-context support. Captures cover light/dark preferences at 1500×1000 and 390×844; the narrow page retains its pre-existing horizontal overflow.
The test scope includes map configuration, real map API fixtures, graph models, URL and HTTP-adapter boundaries, the mounted UI package, and shared Screens/Program layout consumers. Application and standalone UI-library builds are checked separately. An isolated consumer has also rendered the packaged map with a replacement adapter.
Unmeasured: production-scale closure latency, completeness of extracted relationships against actual runtime behavior, and broad screen-reader/platform coverage. No full-repository test-suite or general mobile-layout claim is made.