feat: Add info panel persistence setting and magnet icon to allow displaying last hovered node info.

This commit is contained in:
AEmotionStudio
2026-01-02 14:50:20 -08:00
parent ea6b800b32
commit ac2eba8b73
19 changed files with 178 additions and 17 deletions
+5
View File
@@ -77,6 +77,11 @@ export const Icons = {
<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/>
<polyline points="3.27 6.96 12 12.01 20.73 6.96"/>
<line x1="12" y1="22.08" x2="12" y2="12"/>
</svg>`,
// Magnet icon - persist/sticky mode
magnet: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="m6 15-4-4 6.75-6.77a7.79 7.79 0 0 1 11 11L13 22l-4-4 6.39-6.36a2.2 2.2 0 0 0-3.1-3.13l-6.29 6.49Z"/>
</svg>`
};
+1
View File
@@ -57,4 +57,5 @@ export const DEFAULT_PANEL_SETTINGS: PanelSettings = {
"🔍MagnifyGlass.InfoPanelTextColor": "#6b7280",
"🔍MagnifyGlass.InfoPanelAccentColor": "#3b82f6",
"🔍MagnifyGlass.InfoPanelFontSize": 14,
"🔍MagnifyGlass.InfoPanelPersist": false,
};
+16
View File
@@ -128,6 +128,22 @@ export function registerPanelSettings(stateManager: any, uiManager: any, positio
}
});
app.ui.settings.addSetting({
id: "🔍MagnifyGlass.InfoPanelPersist",
name: "📊 Info Panel: Persist Node Info",
type: "boolean",
defaultValue: settings["🔍MagnifyGlass.InfoPanelPersist"],
tooltip: "Keep displaying the last node's info until you hover over another node.",
onChange: (value: any) => {
if (stateManager) {
stateManager.state.settings["🔍MagnifyGlass.InfoPanelPersist"] = !!value;
if (uiManager) {
uiManager.updateControlStates();
}
}
}
});
app.ui.settings.addSetting({
id: "🔍MagnifyGlass.InfoPanelAnimations",
name: "📊 Info Panel: Animations",
+1
View File
@@ -45,6 +45,7 @@ export interface PanelSettings {
"🔍MagnifyGlass.InfoPanelTextColor": string;
"🔍MagnifyGlass.InfoPanelAccentColor": string;
"🔍MagnifyGlass.InfoPanelFontSize": number;
"🔍MagnifyGlass.InfoPanelPersist": boolean;
[key: string]: string | number | boolean; // Allow indexing
}