Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
271 lines (248 loc) · 12.6 KB
/
Copy pathindex.html
File metadata and controls
271 lines (248 loc) · 12.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CodeBread — codebase map</title>
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath d='M14 108 L14 56 C14 26 34 12 60 12 C86 12 106 26 106 56 L106 108 Z' fill='%230a1526' stroke='%231a2f4a' stroke-width='2'/%3E%3Cline x1='40' y1='86' x2='60' y2='46' stroke='%232dd4bf' stroke-width='4' stroke-linecap='round'/%3E%3Cline x1='60' y1='46' x2='82' y2='80' stroke='%232dd4bf' stroke-width='4' stroke-linecap='round'/%3E%3Cline x1='40' y1='86' x2='82' y2='80' stroke='%2367e8f9' stroke-width='4' stroke-linecap='round' opacity='0.6'/%3E%3Ccircle cx='40' cy='86' r='9' fill='%230a1526' stroke='%2367e8f9' stroke-width='3.5'/%3E%3Ccircle cx='60' cy='46' r='10' fill='%2367e8f9'/%3E%3Ccircle cx='82' cy='80' r='9' fill='%230a1526' stroke='%232dd4bf' stroke-width='3.5'/%3E%3C/svg%3E">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="app">
<header id="topbar">
<div id="brand">
<svg id="brand-icon" viewBox="0 0 120 120" role="img" aria-label="CodeBread logo">
<path d="M14 108 L14 56 C14 26 34 12 60 12 C86 12 106 26 106 56 L106 108 Z"
fill="#0a1526" stroke="#1a2f4a" stroke-width="2"/>
<line x1="40" y1="86" x2="60" y2="46" stroke="#2dd4bf" stroke-width="4" stroke-linecap="round"/>
<line x1="60" y1="46" x2="82" y2="80" stroke="#2dd4bf" stroke-width="4" stroke-linecap="round"/>
<line x1="40" y1="86" x2="82" y2="80" stroke="#67e8f9" stroke-width="4" stroke-linecap="round" opacity="0.6"/>
<circle cx="40" cy="86" r="9" fill="#0a1526" stroke="#67e8f9" stroke-width="3.5"/>
<circle cx="60" cy="46" r="10" fill="#67e8f9"/>
<circle cx="82" cy="80" r="9" fill="#0a1526" stroke="#2dd4bf" stroke-width="3.5"/>
</svg>
<span id="brand-name">CodeBread</span>
<span id="project-name"></span>
</div>
<nav id="view-mode" aria-label="View">
<button data-view="overview" class="active">Overview</button>
<button data-view="connect">Connections</button>
<button data-view="chart">Map</button>
<button data-view="ide">Code</button>
</nav>
<div id="search-wrap">
<input id="search" type="text" autocomplete="off" spellcheck="false"
placeholder="Search files, functions, tables">
<kbd id="search-kbd">/</kbd>
<div id="search-results" class="hidden"></div>
</div>
<nav id="layer-filter" aria-label="Filter by layer">
<button data-layer="all" class="active">All</button>
<button data-layer="frontend">Frontend</button>
<button data-layer="backend">Backend</button>
<button data-layer="database">Database</button>
<button data-layer="config">Config</button>
</nav>
<div id="accent-wrap">
<button id="accent-btn" title="Accent color" aria-label="Accent color"
aria-haspopup="dialog" aria-expanded="false"><span></span></button>
<div id="accent-pop" class="hidden" role="dialog" aria-label="Accent color">
<div class="kicker">Accent color</div>
<div id="accent-swatches"></div>
<div class="accent-row">
<label class="accent-custom"><input type="color" id="accent-input"> Custom</label>
<button id="accent-reset" class="chip">Reset</button>
</div>
</div>
</div>
</header>
<div id="main">
<div id="overview" class="hidden">
<div id="ov-inner">
<header id="ov-hero">
<div class="kicker">Codebase map</div>
<h1 id="ov-title"></h1>
<p id="ov-lede">Every file in this project, which part of the app it belongs to, and what it
talks to. Hover a row to preview it. Click it to explore its connections.</p>
<div id="stats"></div>
<div id="langs" class="hidden">
<div class="lang-head">
<span class="kicker">Languages</span>
<span id="lang-total" class="kicker"></span>
</div>
<div id="lang-bar" role="img"></div>
<ul id="lang-list"></ul>
</div>
<div id="ai-brief" class="hidden">
<div class="ai-text">
<div class="kicker">For AI assistants</div>
<p>One Markdown file that explains this whole codebase: <b id="ai-tokens"></b>.
Paste it into your AI chat, or save it next to your code, so the AI doesn't
have to read every file.</p>
</div>
<div class="ai-actions">
<button id="ai-copy" class="btn solid">Copy for AI</button>
<button id="ai-download" class="btn">Download .md</button>
<button id="ai-preview" class="btn">Preview</button>
</div>
<pre id="ai-md" class="hidden"></pre>
</div>
</header>
<div id="ov-head" class="ov-head">
<h2>Files & tables</h2>
<span id="ov-count" class="kicker"></span>
</div>
<div id="ov-grid">
<table id="ov-table">
<thead><tr>
<th data-sort="name">Name</th>
<th data-sort="layer">Layer</th>
<th data-sort="fns" class="num">Functions</th>
<th data-sort="links" class="num">Connections</th>
<th data-sort="issues" class="num">Issues</th>
</tr></thead>
<tbody></tbody>
</table>
<aside id="ov-preview" aria-live="polite"></aside>
</div>
</div>
</div>
<div id="connect" class="hidden">
<aside id="cx-side">
<div id="cx-side-head">
<input id="cx-search" type="search" autocomplete="off" spellcheck="false"
placeholder="Filter files and tables" aria-label="Filter files and tables">
<div id="cx-count" class="kicker"></div>
</div>
<div id="cx-list"></div>
</aside>
<div id="cx-main">
<nav id="cx-trail" aria-label="Visited files"></nav>
<header id="cx-head"></header>
<div id="cx-stage"></div>
</div>
</div>
<aside id="sidebar">
<div id="sidebar-title">Files</div>
<div id="tree" role="tree"></div>
</aside>
<div id="canvas-wrap">
<div id="breadcrumb" class="hidden"></div>
<svg id="graph" role="img" aria-label="Codebase connection graph">
<defs>
<marker id="arrow" viewBox="0 0 8 8" refX="7" refY="4"
markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M0,0.6 L7.4,4 L0,7.4 z" fill="context-stroke"/>
</marker>
<symbol id="icon-unlock" viewBox="0 0 24 24">
<path d="M7.5 10.5V7a4.5 4.5 0 0 1 8.8-1.3" fill="none"
stroke="currentColor" stroke-width="2.1" stroke-linecap="round"/>
<rect x="5" y="10.5" width="14" height="9.5" rx="2" fill="none" stroke="currentColor" stroke-width="2.1"/>
<circle cx="12" cy="15" r="1.3" fill="currentColor"/>
</symbol>
</defs>
<g id="viewport">
<g id="edges-g"></g>
<g id="nodes-g"></g>
</g>
</svg>
<div id="empty-state" class="hidden">
<svg id="empty-icon" class="cb-mark" viewBox="0 0 120 120" role="img" aria-label="CodeBread">
<path d="M14 108 L14 56 C14 26 34 12 60 12 C86 12 106 26 106 56 L106 108 Z"
fill="none" stroke="#2c4266" stroke-width="3"/>
<line x1="40" y1="86" x2="60" y2="46" stroke="#2dd4bf" stroke-width="3.5" stroke-linecap="round" opacity="0.7"/>
<line x1="60" y1="46" x2="82" y2="80" stroke="#2dd4bf" stroke-width="3.5" stroke-linecap="round" opacity="0.7"/>
<line x1="40" y1="86" x2="82" y2="80" stroke="#67e8f9" stroke-width="3.5" stroke-linecap="round" opacity="0.4"/>
<circle cx="40" cy="86" r="8" fill="none" stroke="#67e8f9" stroke-width="3" opacity="0.7"/>
<circle cx="60" cy="46" r="9" fill="#67e8f9" opacity="0.7"/>
<circle cx="82" cy="80" r="8" fill="none" stroke="#2dd4bf" stroke-width="3" opacity="0.7"/>
</svg>
<div id="empty-title">Pick a file to begin</div>
<div id="empty-msg">Pick a file in the list on the left to see its functions
and how it connects to the rest of the codebase.</div>
</div>
<div id="legend"></div>
<div id="minimap">
<svg id="minimap-svg"></svg>
</div>
<div id="zoom-controls">
<button id="zoom-in" title="Zoom in" aria-label="Zoom in"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 3v10M3 8h10" class="ln"/></svg></button>
<button id="zoom-out" title="Zoom out" aria-label="Zoom out"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h10" class="ln"/></svg></button>
<button id="zoom-fit" title="Fit everything in view" aria-label="Fit view"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 6V2h4M10 2h4v4M14 10v4h-4M6 14H2v-4" class="ln"/></svg></button>
<button id="layout-toggle" class="active" title="Orbit layout — files float, functions ring around them (click to switch)" aria-label="Switch layout"><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="2"/><circle cx="8" cy="8" r="5.5" class="ln"/></svg></button>
<button id="focus-toggle" title="Focus mode: clear the map, then pick one file at a time from the list" aria-label="Focus mode"><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="5" class="ln"/><path d="M8 1v3M8 12v3M1 8h3M12 8h3" class="ln"/></svg></button>
</div>
<div id="hint">Click a box to see what it connects to · scroll to zoom · drag to move</div>
<div id="tooltip" class="hidden"></div>
<div id="context-menu" class="hidden" role="menu"></div>
</div>
<div id="ide" class="hidden">
<div id="ide-head">
<span id="ide-path"></span>
<span id="ide-lang"></span>
<button id="ide-close" title="Back to the map (Esc)">Back to map</button>
</div>
<div id="ide-body">
<aside id="ide-outline">
<div id="ide-outline-title">Outline</div>
<div id="ide-outline-list"></div>
</aside>
<div id="ide-code"></div>
</div>
</div>
<aside id="detail" class="hidden">
<button id="detail-close" title="Close">×</button>
<div id="detail-body"></div>
</aside>
</div>
<div id="warnings-panel" class="hidden">
<div class="wp-head">
<span>Warnings</span>
<button id="warnings-close" title="Close">×</button>
</div>
<div id="warnings-list"></div>
</div>
<div id="insights-panel" class="hidden">
<div class="wp-head">
<span>Insights</span>
<button id="insights-close" title="Close">×</button>
</div>
<div id="insights-body">
<div class="ip-section">
<h5>Orphaned functions <span id="ip-orphan-count"></span></h5>
<div id="ip-orphans-list"></div>
</div>
<div class="ip-section">
<h5>Circular call chains <span id="ip-cycle-count"></span></h5>
<div id="ip-cycles-list"></div>
</div>
</div>
</div>
<div id="onboarding" class="hidden">
<div id="onboarding-card">
<svg id="onboarding-icon" class="cb-mark" viewBox="0 0 120 120" role="img" aria-label="CodeBread">
<path d="M14 108 L14 56 C14 26 34 12 60 12 C86 12 106 26 106 56 L106 108 Z"
fill="#0a1526" stroke="#1a2f4a" stroke-width="2"/>
<line x1="40" y1="86" x2="60" y2="46" stroke="#2dd4bf" stroke-width="4" stroke-linecap="round"/>
<line x1="60" y1="46" x2="82" y2="80" stroke="#2dd4bf" stroke-width="4" stroke-linecap="round"/>
<line x1="40" y1="86" x2="82" y2="80" stroke="#67e8f9" stroke-width="4" stroke-linecap="round" opacity="0.6"/>
<circle cx="40" cy="86" r="9" fill="#0a1526" stroke="#67e8f9" stroke-width="3.5"/>
<circle cx="60" cy="46" r="10" fill="#67e8f9"/>
<circle cx="82" cy="80" r="9" fill="#0a1526" stroke="#2dd4bf" stroke-width="3.5"/>
</svg>
<h3>How to read the map</h3>
<ol>
<li>Each <b>box</b> is a file. Its color shows the layer: frontend, backend, database or config.</li>
<li>Click a file to open it up into its <b>functions</b>. Click a function to light up
what it calls and what calls it.</li>
<li><b>Lines</b> are connections. The legend (bottom-left) says what each line style means.</li>
<li>Keyboard: <kbd>/</kbd> search · <kbd>←</kbd> <kbd>→</kbd> step through neighbors ·
<kbd>↑</kbd> <kbd>↓</kbd> history · right-click for more.</li>
</ol>
<button id="onboarding-dismiss">Got it</button>
</div>
</div>
</div>
<script src="app.js"></script>
</body>
</html>