gitmaps 1.0.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +265 -122
- package/app/[...slug]/page.client.tsx +1 -0
- package/app/[...slug]/page.tsx +6 -0
- package/app/[owner]/[repo]/page.client.tsx +5 -0
- package/app/[slug]/page.client.tsx +5 -0
- package/app/analytics.db +0 -0
- package/app/api/analytics/route.ts +64 -0
- package/app/api/auth/positions/route.ts +95 -33
- package/app/api/build-info/route.ts +19 -0
- package/app/api/chat/route.ts +13 -2
- package/app/api/manifest.json/route.ts +20 -0
- package/app/api/og-image/route.ts +14 -0
- package/app/api/pwa-icon/route.ts +14 -0
- package/app/api/repo/clone-stream/route.ts +20 -12
- package/app/api/repo/file-content/route.ts +73 -20
- package/app/api/repo/imports/route.ts +21 -3
- package/app/api/repo/list/route.ts +30 -0
- package/app/api/repo/load/route.test.ts +62 -0
- package/app/api/repo/load/route.ts +41 -1
- package/app/api/repo/pdf-thumb/route.ts +127 -0
- package/app/api/repo/resolve-slug/route.ts +51 -0
- package/app/api/repo/tree/route.ts +188 -104
- package/app/api/repo/upload/route.ts +6 -9
- package/app/api/sw.js/route.ts +70 -0
- package/app/api/version/route.ts +26 -0
- package/app/galaxy-canvas/page.client.tsx +2 -0
- package/app/galaxy-canvas/page.tsx +5 -0
- package/app/globals.css +5844 -4694
- package/app/icon.png +0 -0
- package/app/layout.tsx +1284 -467
- package/app/lib/auto-arrange.test.ts +158 -0
- package/app/lib/auto-arrange.ts +147 -0
- package/app/lib/canvas-export.ts +358 -358
- package/app/lib/canvas-text.ts +4 -72
- package/app/lib/canvas.ts +625 -564
- package/app/lib/card-arrangement.ts +21 -7
- package/app/lib/card-context-menu.tsx +2 -2
- package/app/lib/card-groups.ts +9 -2
- package/app/lib/cards.tsx +1361 -914
- package/app/lib/chat.tsx +65 -9
- package/app/lib/code-editor.ts +86 -2
- package/app/lib/connections.tsx +34 -43
- package/app/lib/context.test.ts +32 -0
- package/app/lib/context.ts +19 -3
- package/app/lib/cursor-sharing.ts +34 -0
- package/app/lib/events.tsx +76 -73
- package/app/lib/export-canvas.ts +287 -0
- package/app/lib/file-card-plugin.ts +148 -134
- package/app/lib/file-modal.tsx +49 -0
- package/app/lib/file-preview.ts +486 -400
- package/app/lib/github-import.test.ts +424 -0
- package/app/lib/global-search.ts +48 -27
- package/app/lib/initial-route-hydration.test.ts +283 -0
- package/app/lib/initial-route-hydration.ts +202 -0
- package/app/lib/landing-reset.test.ts +99 -0
- package/app/lib/landing-reset.ts +106 -0
- package/app/lib/landing-shell.test.ts +75 -0
- package/app/lib/large-repo-optimization.ts +37 -0
- package/app/lib/layers.tsx +17 -18
- package/app/lib/layout-snapshots.ts +320 -0
- package/app/lib/loading.test.ts +69 -0
- package/app/lib/loading.tsx +160 -45
- package/app/lib/mount-cleanup.test.ts +52 -0
- package/app/lib/mount-cleanup.ts +34 -0
- package/app/lib/mount-init.test.ts +123 -0
- package/app/lib/mount-init.ts +107 -0
- package/app/lib/mount-lifecycle.test.ts +39 -0
- package/app/lib/mount-lifecycle.ts +12 -0
- package/app/lib/mount-route-wiring.test.ts +87 -0
- package/app/lib/mount-route-wiring.ts +84 -0
- package/app/lib/multi-repo.ts +14 -0
- package/app/lib/onboarding-tutorial.ts +278 -0
- package/app/lib/perf-overlay.ts +78 -0
- package/app/lib/positions.ts +191 -122
- package/app/lib/recent-commits.test.ts +869 -0
- package/app/lib/recent-commits.ts +227 -0
- package/app/lib/repo-handoff.test.ts +23 -0
- package/app/lib/repo-handoff.ts +16 -0
- package/app/lib/repo-progressive.ts +119 -0
- package/app/lib/repo-select.test.ts +61 -0
- package/app/lib/repo-select.ts +74 -0
- package/app/lib/repo.tsx +1383 -977
- package/app/lib/role.ts +228 -0
- package/app/lib/route-catchall.test.ts +27 -0
- package/app/lib/route-repo-entry.test.ts +95 -0
- package/app/lib/route-repo-entry.ts +36 -0
- package/app/lib/router-contract.test.ts +22 -0
- package/app/lib/router-contract.ts +19 -0
- package/app/lib/shared-layout.test.ts +86 -0
- package/app/lib/shared-layout.ts +82 -0
- package/app/lib/shortcuts-panel.ts +2 -0
- package/app/lib/status-bar.test.ts +118 -0
- package/app/lib/status-bar.ts +365 -128
- package/app/lib/sync-controls.test.ts +43 -0
- package/app/lib/sync-controls.tsx +303 -0
- package/app/lib/test-dom.ts +145 -0
- package/app/lib/test-fixtures/router-contract/[...slug]/page.tsx +3 -0
- package/app/lib/test-fixtures/router-contract/api/health/route.ts +3 -0
- package/app/lib/test-fixtures/router-contract/api/version/route.ts +3 -0
- package/app/lib/test-fixtures/router-contract/galaxy-canvas/page.tsx +3 -0
- package/app/lib/test-fixtures/router-contract/page.tsx +3 -0
- package/app/lib/transclusion-smoke.test.ts +163 -0
- package/app/lib/tutorial.ts +301 -0
- package/app/lib/version.ts +93 -0
- package/app/lib/viewport-culling.ts +740 -728
- package/app/lib/virtual-files.ts +456 -0
- package/app/lib/webgl-text.ts +189 -0
- package/app/lib/{galaxydraw-bridge.ts → xydraw-bridge.ts} +485 -477
- package/app/lib/{galaxydraw.test.ts → xydraw.test.ts} +228 -229
- package/app/og-image.png +0 -0
- package/app/page.client.tsx +70 -215
- package/app/page.tsx +27 -92
- package/app/state/machine.js +13 -0
- package/banner.png +0 -0
- package/package.json +17 -8
- package/server.ts +11 -1
- package/app/api/connections/route.ts +0 -72
- package/app/api/positions/route.ts +0 -80
- package/app/api/repo/browse/route.ts +0 -55
- package/app/lib/pr-review.ts +0 -374
- package/packages/galaxydraw/README.md +0 -296
- package/packages/galaxydraw/banner.png +0 -0
- package/packages/galaxydraw/demo/build-static.ts +0 -100
- package/packages/galaxydraw/demo/client.ts +0 -154
- package/packages/galaxydraw/demo/dist/client.js +0 -8
- package/packages/galaxydraw/demo/index.html +0 -256
- package/packages/galaxydraw/demo/server.ts +0 -96
- package/packages/galaxydraw/dist/index.js +0 -984
- package/packages/galaxydraw/dist/index.js.map +0 -16
- package/packages/galaxydraw/node_modules/.bin/tsc.bunx +0 -0
- package/packages/galaxydraw/node_modules/.bin/tsc.exe +0 -0
- package/packages/galaxydraw/node_modules/.bin/tsserver.bunx +0 -0
- package/packages/galaxydraw/node_modules/.bin/tsserver.exe +0 -0
- package/packages/galaxydraw/package.json +0 -49
- package/packages/galaxydraw/perf.test.ts +0 -284
- package/packages/galaxydraw/src/core/cards.ts +0 -435
- package/packages/galaxydraw/src/core/engine.ts +0 -339
- package/packages/galaxydraw/src/core/events.ts +0 -81
- package/packages/galaxydraw/src/core/layout.ts +0 -136
- package/packages/galaxydraw/src/core/minimap.ts +0 -216
- package/packages/galaxydraw/src/core/state.ts +0 -177
- package/packages/galaxydraw/src/core/viewport.ts +0 -106
- package/packages/galaxydraw/src/galaxydraw.css +0 -166
- package/packages/galaxydraw/src/index.ts +0 -40
- package/packages/galaxydraw/tsconfig.json +0 -30
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { measure } from 'measure-fn';
|
|
10
10
|
import type { CanvasContext } from './context';
|
|
11
|
-
import { savePosition } from './positions';
|
|
11
|
+
import { savePosition, flushPositions } from './positions';
|
|
12
12
|
import { updateMinimap } from './canvas';
|
|
13
13
|
import { renderConnections } from './connections';
|
|
14
14
|
|
|
@@ -35,11 +35,19 @@ function getSelectedCardsInfo(ctx: CanvasContext): CardInfo[] {
|
|
|
35
35
|
const x = parseFloat(card.style.left);
|
|
36
36
|
const y = parseFloat(card.style.top);
|
|
37
37
|
if (isNaN(x) || isNaN(y)) return;
|
|
38
|
+
// In pill mode, card might be display:none (0px) or rendered as a pill (~24px).
|
|
39
|
+
let cw = card.offsetWidth;
|
|
40
|
+
let ch = card.offsetHeight;
|
|
41
|
+
if (!cw || cw < 100) cw = 580;
|
|
42
|
+
if (!ch || ch < 100) ch = 700;
|
|
43
|
+
|
|
44
|
+
const pos = ctx.positions?.get(path);
|
|
45
|
+
const def = ctx.deferredCards?.get(path);
|
|
38
46
|
infos.push({
|
|
39
47
|
path, card,
|
|
40
48
|
x, y,
|
|
41
|
-
w:
|
|
42
|
-
h:
|
|
49
|
+
w: pos?.width || def?.size?.width || cw,
|
|
50
|
+
h: pos?.height || def?.size?.height || ch,
|
|
43
51
|
});
|
|
44
52
|
}
|
|
45
53
|
});
|
|
@@ -69,16 +77,19 @@ function getSelectedCardsInfo(ctx: CanvasContext): CardInfo[] {
|
|
|
69
77
|
if (infos.length < selected.length) {
|
|
70
78
|
selected.forEach(path => {
|
|
71
79
|
if (seen.has(path)) return;
|
|
72
|
-
const pill = document.querySelector(`.file-
|
|
80
|
+
const pill = document.querySelector(`.file-pill[data-path="${CSS.escape(path)}"]`) as HTMLElement;
|
|
73
81
|
if (pill) {
|
|
74
82
|
const x = parseFloat(pill.style.left);
|
|
75
83
|
const y = parseFloat(pill.style.top);
|
|
76
84
|
if (isNaN(x) || isNaN(y)) return;
|
|
85
|
+
// Pills are tiny (~24px) — use stored size or default card size
|
|
86
|
+
const pos = ctx.positions?.get(path);
|
|
87
|
+
const def = ctx.deferredCards?.get(path);
|
|
77
88
|
infos.push({
|
|
78
89
|
path, card: null,
|
|
79
90
|
x, y,
|
|
80
|
-
w:
|
|
81
|
-
h:
|
|
91
|
+
w: pos?.width || def?.size?.width || 580,
|
|
92
|
+
h: pos?.height || def?.size?.height || 700,
|
|
82
93
|
});
|
|
83
94
|
}
|
|
84
95
|
});
|
|
@@ -104,7 +115,7 @@ function applyPosition(ctx: CanvasContext, info: CardInfo, newX: number, newY: n
|
|
|
104
115
|
}
|
|
105
116
|
|
|
106
117
|
// Update pill element
|
|
107
|
-
const pill = document.querySelector(`.file-
|
|
118
|
+
const pill = document.querySelector(`.file-pill[data-path="${CSS.escape(info.path)}"]`) as HTMLElement;
|
|
108
119
|
if (pill) {
|
|
109
120
|
pill.style.left = `${newX}px`;
|
|
110
121
|
pill.style.top = `${newY}px`;
|
|
@@ -126,6 +137,7 @@ export function arrangeRow(ctx: CanvasContext) {
|
|
|
126
137
|
savePosition(ctx, commitHash, info.path, curX, startY);
|
|
127
138
|
curX += info.w + gap;
|
|
128
139
|
});
|
|
140
|
+
flushPositions(ctx); // Force immediate save — don't rely on debounce for batch arrange
|
|
129
141
|
renderConnections(ctx);
|
|
130
142
|
updateMinimap(ctx);
|
|
131
143
|
});
|
|
@@ -146,6 +158,7 @@ export function arrangeColumn(ctx: CanvasContext) {
|
|
|
146
158
|
savePosition(ctx, commitHash, info.path, startX, curY);
|
|
147
159
|
curY += info.h + gap;
|
|
148
160
|
});
|
|
161
|
+
flushPositions(ctx);
|
|
149
162
|
renderConnections(ctx);
|
|
150
163
|
updateMinimap(ctx);
|
|
151
164
|
});
|
|
@@ -182,6 +195,7 @@ export function arrangeGrid(ctx: CanvasContext) {
|
|
|
182
195
|
savePosition(ctx, commitHash, info.path, x, y);
|
|
183
196
|
});
|
|
184
197
|
|
|
198
|
+
flushPositions(ctx);
|
|
185
199
|
renderConnections(ctx);
|
|
186
200
|
updateMinimap(ctx);
|
|
187
201
|
});
|
|
@@ -93,8 +93,8 @@ function ContextMenu({ onAction, onActionLayer, onSelectFolder, isInActiveLayer,
|
|
|
93
93
|
</div>
|
|
94
94
|
</div>
|
|
95
95
|
{isInActiveLayer && (
|
|
96
|
-
<button className="ctx-item" onClick={() => onAction('remove-from-layer')} style="color: #
|
|
97
|
-
|
|
96
|
+
<button className="ctx-item" onClick={() => onAction('remove-from-layer')} style="color: #60a5fa">
|
|
97
|
+
↩ Move to Main
|
|
98
98
|
</button>
|
|
99
99
|
)}
|
|
100
100
|
<div className="ctx-divider"></div>
|
package/app/lib/card-groups.ts
CHANGED
|
@@ -24,8 +24,8 @@ const activeGroups = new Map<string, CollapsedGroup>();
|
|
|
24
24
|
|
|
25
25
|
// ─── Persistence ─────────────────────────────────────────
|
|
26
26
|
function getStorageKey(): string {
|
|
27
|
-
const
|
|
28
|
-
return `gitmaps:collapsed-dirs:${
|
|
27
|
+
const repoPath = _ctx?.snap().context.repoPath || 'default';
|
|
28
|
+
return `gitmaps:collapsed-dirs:${repoPath}`;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function saveState() {
|
|
@@ -45,6 +45,13 @@ function loadState() {
|
|
|
45
45
|
} catch { }
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
export function resetCardGroups() {
|
|
49
|
+
for (const group of activeGroups.values()) {
|
|
50
|
+
group.groupCard.remove();
|
|
51
|
+
}
|
|
52
|
+
activeGroups.clear();
|
|
53
|
+
}
|
|
54
|
+
|
|
48
55
|
// ─── Group card rendering ────────────────────────────────
|
|
49
56
|
function createGroupCard(dir: string, files: CollapsedGroup['files']): HTMLElement {
|
|
50
57
|
const card = document.createElement('div');
|