Hide white React Flow edge-label backgrounds on the topology canvas.

Disable labelShowBg for straight edges and suppress the default SVG textbg so link numbers render as text only.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-08-05 09:21:55 +08:00
parent 83acb5eef1
commit 4a0918ab44
2 changed files with 17 additions and 9 deletions

View file

@ -597,7 +597,8 @@ function resolveEdgeStyle(
function withEdgeVisual(edge: Edge, defaults: EdgeDefaults): Edge {
const data = (edge.data || {}) as EdgeStyleData;
const style = resolveEdgeStyle(data, defaults);
return { ...edge, style, markerEnd: undefined };
// RF EdgeText defaults labelShowBg=true with a white rect — keep digits only.
return { ...edge, style, markerEnd: undefined, labelShowBg: false };
}
function graphToFlow(
@ -3385,7 +3386,7 @@ export function TopologyPage() {
edgeTypes={edgeTypes}
onlyRenderVisibleElements
connectionMode={ConnectionMode.Loose}
defaultEdgeOptions={{ type: "straight" }}
defaultEdgeOptions={{ type: "straight", labelShowBg: false }}
proOptions={{ hideAttribution: true }}
minZoom={0.05}
maxZoom={4}