fix: fullscreen toggle loads correct session instead of default
When toggling fullscreen, the iframe reload was reading the session name from the node's widget (default "my_session") instead of the session the user had actually selected in the Dashboard picker. Now the Dashboard sends its current session name in the fullscreen postMessage, and the handler prefers that over the widget default. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
1d86313fcc
commit
beacb02101
@@ -5,7 +5,9 @@
|
||||
*/
|
||||
|
||||
function toggleFullscreen() {
|
||||
window.parent.postMessage({ type: 'toggle_fullscreen', node_id: TARGET_NODE_ID }, '*');
|
||||
// Send current session name so fullscreen reload uses the right session
|
||||
var currentSession = document.getElementById('session-input')?.value || '';
|
||||
window.parent.postMessage({ type: 'toggle_fullscreen', node_id: TARGET_NODE_ID, session_name: currentSession }, '*');
|
||||
}
|
||||
|
||||
|
||||
|
||||
+5
-3
@@ -180,9 +180,11 @@ app.registerExtension({
|
||||
el.addEventListener('load', () => {
|
||||
console.log('[UltimateGrid] Iframe reloaded after fullscreen toggle, restoring session...');
|
||||
|
||||
// Get the session name from the node's widget
|
||||
const sessionWidget = graphNode.widgets?.find(w => w.name === "session_name");
|
||||
const sessionName = sessionWidget ? sessionWidget.value : null;
|
||||
// Get the session name — prefer the one from the iframe (user may have
|
||||
// loaded a different session via the picker), fall back to node widget
|
||||
const sessionName = event.data.session_name
|
||||
|| graphNode.widgets?.find(w => w.name === "session_name")?.value
|
||||
|| null;
|
||||
|
||||
if (sessionName && graphNode.forceLoadSession) {
|
||||
graphNode.forceLoadSession(sessionName);
|
||||
|
||||
Reference in New Issue
Block a user