Skip to content

Explorer & Graph Explorer

One-Liner

The Explorer pages provide codebase navigation with file tree browsing, code dependency visualization, and real-time search capabilities.


Pain Points Solved

Pain PointCurrent StateExplorer Solution
No code overviewCan't see codebase structureFile tree with hierarchical navigation
Hard to find filesManual directory traversalSearch and filter with instant results
Unknown dependenciesCan't see relationshipsVisual dependency graph with nodes/edges
No context previewOpen files blindlyFile preview with syntax highlighting
Lost in large codebasesCan't navigate efficientlySplit view with resizable panes

File Explorer

Page Overview

Location: ccw/frontend/src/pages/ExplorerPage.tsx

Purpose: File explorer with tree view and file preview panel.

Access: Navigation → Explorer

Layout

+--------------------------------------------------------------------------+
|  Explorer Title                                                            |
+--------------------------------------------------------------------------+
|  Toolbar: [Search...] [Root v] [View v] [Sort v] [Hidden] [Expand][Collapse]|
+--------------------------------------------------------------------------+
|  +----------------+  /  +--------------------------------------------------+  |
|  | Tree View      |  |  File Preview                                     |  |
|  | (resizable)    |  |  - Syntax highlighting                             |  |
|  |                |  |  - Line numbers                                    |  |
|  | - Folder tree  |  |  - Language detection                             |  |
|  | - File icons   |  |                                                   |  |
|  | - Expandable   |  |                                                   |  |
|  +----------------+  +--------------------------------------------------+  |
+--------------------------------------------------------------------------+

Core Features

FeatureDescription
Tree ViewHierarchical file tree with expand/collapse
File PreviewSyntax-highlighted preview with line numbers
Resizable PanesDrag divider to resize tree width (200-600px)
Root SelectionChange root directory from available options
Search/FilterFilter files by name
View ModeToggle between tree and list view
Sort OptionsName, size, modified date
Hidden FilesToggle show/hide hidden files
Expand/Collapse AllBulk expand or collapse all folders
Max File Size1MB limit for preview

Key Interactions

InteractionHow to Use
Open fileClick file in tree to show preview
Expand folderClick folder arrow to expand/collapse
Resize paneDrag divider between tree and preview
Change rootSelect root directory from dropdown
Search filesType in search box to filter tree
Sort filesSelect sort option from dropdown

Graph Explorer

Page Overview

Location: ccw/frontend/src/pages/GraphExplorerPage.tsx

Purpose: Code dependency graph visualization using ReactFlow with filtering and node details.

Access: Navigation → Graph Explorer

Layout

+--------------------------------------------------------------------------+
|  Graph Toolbar: [Filters] [Fit View] [Refresh] [Reset]                         |
+--------------------------------------------------------------------------+
|  +---------------------------------------------------+  +------------------+  |
|  | Graph Canvas (ReactFlow)                      |  | Sidebar          |  |
|  |                                               |  | (conditional)     |  |
|  |  [Module] --> [Class] --> [Function]         |  | - Node details    |  |
|  |                                               |  | - OR legend       |  |
|  |  Mini map, controls, background               |  |                  |  |
|  +---------------------------------------------------+  +------------------+  |
+--------------------------------------------------------------------------+

Core Features

FeatureDescription
ReactFlow CanvasInteractive graph with zoom/pan
Node TypesComponent, module, class, function, variable, interface, hook
Edge TypesImports, exports, extends, implements, uses, calls, depends-on
FiltersFilter by node type, edge type, isolated nodes
SidebarShows selected node details OR legend
Mini MapOverview of entire graph
Status PanelNode count, edge count, updating indicator
Fit ViewAuto-fit graph in view
Custom Node StylesColor-coded by node type

Node Types

TypeColorDescription
ComponentBlueReact/component
ModuleBlueCode module
ClassGreenClass definition
FunctionOrangeFunction/method
VariableCyanVariable declaration
InterfaceGrayInterface/type
HookPurpleReact hook

Edge Types

TypeDescription
ImportsModule import
ExportsModule export
ExtendsClass extension
ImplementsInterface implementation
UsesUsage reference
CallsFunction call
Depends-onDependency

Key Interactions

InteractionHow to Use
Select nodeClick node to show details in sidebar
DeselectClick canvas background
Zoom in/outUse mouse wheel or zoom controls
Pan canvasDrag canvas or use pan tool
Fit viewClick Fit View button
Filter nodesToggle node type filters in toolbar
Filter edgesToggle edge type filters in toolbar
Reset filtersClick Reset button

Components Reference

File Explorer Components

ComponentLocationPurpose
ExplorerPage@/pages/ExplorerPage.tsxMain file explorer page
TreeView@/components/shared/TreeView.tsxHierarchical tree component
FilePreview@/components/shared/FilePreview.tsxFile content preview
ExplorerToolbar@/components/shared/ExplorerToolbar.tsxToolbar with controls

Graph Explorer Components

ComponentLocationPurpose
GraphExplorerPage@/pages/GraphExplorerPage.tsxMain graph explorer page
GraphToolbar@/components/shared/GraphToolbar.tsxToolbar with filters
GraphSidebar@/components/shared/GraphSidebar.tsxNode details or legend
Custom Nodes@/pages/graph-explorer/nodes/*Node type components

State Management

File Explorer:

  • Local state: rootPath, treeWidth, isResizing
  • Custom hooks: useFileExplorer, useFileContent

Graph Explorer:

  • Local state: selectedNode, isSidebarOpen, filters
  • Custom hooks: useGraphData

Configuration

File Explorer Settings

typescript
const DEFAULT_TREE_WIDTH = 300;
const MIN_TREE_WIDTH = 200;
const MAX_TREE_WIDTH = 600;
const MAX_FILE_SIZE = 1024 * 1024; // 1MB

Graph Explorer Settings

typescript
const defaultFilters: GraphFilters = {
  nodeTypes: ['component', 'module', 'class', 'function', 'variable', 'interface', 'hook'],
  edgeTypes: ['imports', 'exports', 'extends', 'implements', 'uses', 'calls', 'depends-on'],
  showIsolatedNodes: false,
};

Released under the MIT License.