Skip to content

Commit fcbca5c

Browse files
CopilotMathiasVDA
andauthored
fix: visual indicators for double-click-to-expand feature weren't working (fixes #25 and #27)
* Initial plan * feat: add zoom-in cursor as visual indicator for double-click-to-expand nodes Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com> * fix: colors of buttons were styled wrong when embedded in yasgui (fixes #27) * fix: ensure loading/expanded border indicators are visible in all node states Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com> Co-authored-by: Mathias Vanden Auweele <mathias@matdata.eu>
1 parent 4c9f381 commit fcbca5c

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

src/GraphPlugin.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -739,18 +739,24 @@ class GraphPlugin {
739739
originalColor = node.color;
740740
originalBorderWidth = node.borderWidth;
741741
}
742+
// Apply loading indicator: orange border, visible in all node states (normal, selected, hover)
743+
const loadingBackground = typeof originalColor === 'string' ? originalColor : undefined;
742744
this.nodesDataSet.update({
743745
id: nodeId,
744746
borderWidth: LOADING_BORDER_WIDTH,
745-
color: typeof originalColor === 'object' && originalColor !== null
746-
? { ...originalColor, border: LOADING_BORDER_COLOR }
747-
: { border: LOADING_BORDER_COLOR, background: originalColor ?? undefined },
747+
borderWidthSelected: LOADING_BORDER_WIDTH,
748+
color: {
749+
border: LOADING_BORDER_COLOR,
750+
background: loadingBackground,
751+
highlight: { border: LOADING_BORDER_COLOR, background: loadingBackground },
752+
hover: { border: LOADING_BORDER_COLOR, background: loadingBackground },
753+
},
748754
});
749755
}
750756

751757
const restoreNode = (borderWidth: number) => {
752758
if (nodeId !== undefined) {
753-
this.nodesDataSet.update({ id: nodeId, borderWidth, color: originalColor });
759+
this.nodesDataSet.update({ id: nodeId, borderWidth, borderWidthSelected: borderWidth, color: originalColor });
754760
}
755761
};
756762

styles/_variables.css

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515

1616
/* UI elements - using YASGUI variables with fallbacks */
1717
--yasgui-graph-canvas-bg: var(--yasgui-bg-primary, #ffffff);
18-
--yasgui-graph-button-bg: var(--yasgui-accent-color, #4caf50);
19-
--yasgui-graph-button-hover: var(--yasgui-link-hover, #45a049);
20-
--yasgui-graph-button-text: var(--yasgui-button-text, #ffffff);
18+
--yasgui-graph-button-bg: var(--yasgui-bg-secondary, #f0f0f0);
19+
--yasgui-graph-button-hover: var(--yasgui-button-hover, #e0e0e0);
20+
--yasgui-graph-button-text: var(--yasgui-text-primary, #333333);
21+
--yasgui-graph-button-border: var(--yasgui-border-color, #cccccc);
2122
--yasgui-graph-empty-text: var(--yasgui-text-secondary, #666666);
2223
--yasgui-graph-error-text: #f44336;
2324

@@ -66,4 +67,10 @@
6667
--yasgui-graph-background: var(--yasgui-bg-primary, #1e1e1e);
6768
--yasgui-graph-canvas-bg: var(--yasgui-bg-primary, #1e1e1e);
6869
--yasgui-graph-empty-text: var(--yasgui-text-secondary, #cccccc);
70+
71+
/* UI controls - dark mode fallbacks for when YASGUI variables are not in scope */
72+
--yasgui-graph-button-bg: var(--yasgui-bg-secondary, #2a2a2a);
73+
--yasgui-graph-button-hover: var(--yasgui-button-hover, #3a3a3a);
74+
--yasgui-graph-button-text: var(--yasgui-text-primary, #e0e0e0);
75+
--yasgui-graph-button-border: var(--yasgui-border-color, #555555);
6976
}

styles/graph-plugin.css

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
padding: 8px 12px;
3838
background: var(--yasgui-graph-button-bg);
3939
color: var(--yasgui-graph-button-text);
40-
border: none;
40+
border: 1px solid var(--yasgui-graph-button-border);
4141
border-radius: 4px;
4242
cursor: pointer;
4343
font-size: 14px;
@@ -59,10 +59,9 @@
5959
top: 50px;
6060
right: 10px;
6161
z-index: 10001;
62-
background: var(--yasgui-graph-button-bg, #4caf50);
63-
background: var(--yasgui-bg-primary, #ffffff);
64-
color: var(--yasgui-graph-text, #333333);
65-
border: 1px solid var(--yasgui-border-color, #cccccc);
62+
background: var(--yasgui-graph-button-bg);
63+
color: var(--yasgui-graph-button-text);
64+
border: 1px solid var(--yasgui-graph-button-border, #cccccc);
6665
border-radius: 6px;
6766
padding: 12px 14px;
6867
min-width: 240px;

0 commit comments

Comments
 (0)