Skip to content

Commit dbfc293

Browse files
authored
Merge pull request #8 from Modsofthenation/cursor/minimap-fix-ccb4
Fix impact-graph MiniMap so it draws the node overview
2 parents baaad29 + ab21a83 commit dbfc293

11 files changed

Lines changed: 58 additions & 18 deletions

File tree

‎docs/screenshots/architecture.png‎

-4.89 KB
Loading

‎docs/screenshots/graph.png‎

-39.3 KB
Loading

‎docs/screenshots/pull-requests.png‎

13 Bytes
Loading

‎docs/screenshots/review.png‎

-2.1 KB
Loading

‎docs/screenshots/settings.png‎

17 Bytes
Loading

src/loadpath/static/assets/index-YwQandBA.css renamed to src/loadpath/static/assets/index-DA_Qg5fM.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/loadpath/static/assets/index-5LvtBaA5.js renamed to src/loadpath/static/assets/index-gOpwxVBZ.js

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/loadpath/static/index.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<link rel="preconnect" href="https://fonts.googleapis.com" />
1818
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1919
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap" rel="stylesheet" />
20-
<script type="module" crossorigin src="./assets/index-5LvtBaA5.js"></script>
21-
<link rel="stylesheet" crossorigin href="./assets/index-YwQandBA.css">
20+
<script type="module" crossorigin src="./assets/index-gOpwxVBZ.js"></script>
21+
<link rel="stylesheet" crossorigin href="./assets/index-DA_Qg5fM.css">
2222
</head>
2323
<body>
2424
<div id="root"></div>

‎tests/e2e/test_ui_screenshots.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ def test_ui_review_graph_prs_settings(live_app, tmp_path: Path):
123123
page.get_by_test_id("tab-graph").click()
124124
page.get_by_test_id("graph-full").wait_for()
125125
page.locator(".react-flow__node").first.wait_for(timeout=15_000)
126+
page.locator(".react-flow__minimap-node").first.wait_for(timeout=10_000)
127+
assert page.locator(".react-flow__minimap-node").count() > 3
126128
page.wait_for_timeout(600)
127129
page.screenshot(path=str(dest / "graph.png"), full_page=False)
128130

‎ui/src/ImpactGraph.tsx‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ function LoadNode({ data, selected }: { data: { name: string; type: string }; se
2929
}
3030

3131
const nodeTypes = { load: LoadNode };
32+
const NODE_WIDTH = 180;
33+
const NODE_HEIGHT = 56;
3234

3335
export function ImpactGraph({ nodes, edges }: { nodes: GraphNode[]; edges: GraphEdge[] }) {
3436
const [selectedId, setSelectedId] = useState<string | null>(null);
@@ -43,6 +45,10 @@ export function ImpactGraph({ nodes, edges }: { nodes: GraphNode[]; edges: Graph
4345
position: pos.get(n.id) ?? { x: 0, y: 0 },
4446
data: { name: n.name, type: n.type, file: n.file_path },
4547
selected: selectedId === n.id,
48+
// MiniMap reads width/height off the user node, not the measured DOM box.
49+
width: NODE_WIDTH,
50+
height: NODE_HEIGHT,
51+
style: { width: NODE_WIDTH, height: NODE_HEIGHT },
4652
}));
4753
const rfEdges: Edge[] = edges
4854
.filter((e) => byId.has(e.src) && byId.has(e.dst))
@@ -84,7 +90,19 @@ export function ImpactGraph({ nodes, edges }: { nodes: GraphNode[]; edges: Graph
8490
data-testid="impact-graph"
8591
>
8692
<Background />
87-
<MiniMap pannable zoomable />
93+
<MiniMap
94+
pannable
95+
zoomable
96+
ariaLabel="Impact graph overview"
97+
nodeColor="var(--muted)"
98+
nodeStrokeColor="transparent"
99+
nodeStrokeWidth={0}
100+
maskColor="rgba(0, 0, 0, 0.45)"
101+
maskStrokeColor="var(--accent)"
102+
maskStrokeWidth={1.4}
103+
bgColor="var(--graph-bg)"
104+
style={{ width: 184, height: 128 }}
105+
/>
88106
<Controls />
89107
</ReactFlow>
90108
</ReactFlowProvider>

0 commit comments

Comments
 (0)