From 0e7ef10eeee2b08fe77269abefb39fd6b85b4f87 Mon Sep 17 00:00:00 2001 From: x01dc Date: Fri, 31 Jul 2026 13:38:13 +0200 Subject: [PATCH] fix(lamni,flomni,omny): stop force-opening tomo-queue panel of running job The status webpage's tomo-queue accordion auto-expanded a job's details panel as soon as its status became "running", overriding whatever open/closed state the user had selected. Panel state now depends only on the existing DOM snapshot of user selections. Co-Authored-By: Claude Sonnet 5 --- .../OMNY_shared/webpage_generator_base.py | 20 +++---------------- .../plugins/omny/omny_webpage_generator.py | 20 +++---------------- 2 files changed, 6 insertions(+), 34 deletions(-) diff --git a/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/webpage_generator_base.py b/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/webpage_generator_base.py index 1097c39..0bdddcb 100644 --- a/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/webpage_generator_base.py +++ b/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/webpage_generator_base.py @@ -2754,12 +2754,6 @@ function renderTomoQueue(jobs){{ el.innerHTML='
No jobs queued
'; return; }} - // Running jobs are auto-opened once, on first appearance. We remember which - // we have already auto-opened so a manual collapse is not undone on the next - // refresh (previously, collapsing the only open job made the snapshot empty - // and re-triggered the auto-open). - const autoOpened=window.__tqAutoOpened||(window.__tqAutoOpened=new Set()); - const presentKeys=new Set(); let html=''; jobs.forEach((job,i)=>{{ const status=job.status||'pending'; @@ -2767,14 +2761,9 @@ function renderTomoQueue(jobs){{ const isCommand=job.kind==='command'; const params=job.params||{{}}; const key=(job.added_at||'')+'|'+label; - presentKeys.add(key); - // Open if the user currently has it open, or it is a running job we have - // not auto-opened before (its first appearance). Auto-open fires once. - let shouldOpen=openKeys.has(key); - if(status==='running' && !autoOpened.has(key)){{ - shouldOpen=true; - autoOpened.add(key); - }} + // Open only if the user currently has it open -- never force-open a + // job just because it started running. + const shouldOpen=openKeys.has(key); // Command jobs have no "params" key -- render their step sequence // instead of an (otherwise blank) params table. const paramRows=isCommand?'':buildParamRows(params); @@ -2799,9 +2788,6 @@ function renderTomoQueue(jobs){{ +'' +''; }}); - // Drop remembered auto-open keys for jobs that are gone, so the set stays - // small and a job that later reappears is treated as new. - autoOpened.forEach(k=>{{ if(!presentKeys.has(k)) autoOpened.delete(k); }}); el.innerHTML=html; }} diff --git a/csaxs_bec/bec_ipython_client/plugins/omny/omny_webpage_generator.py b/csaxs_bec/bec_ipython_client/plugins/omny/omny_webpage_generator.py index b1e74f7..3866630 100644 --- a/csaxs_bec/bec_ipython_client/plugins/omny/omny_webpage_generator.py +++ b/csaxs_bec/bec_ipython_client/plugins/omny/omny_webpage_generator.py @@ -2839,26 +2839,15 @@ function renderTomoQueue(jobs){{ el.innerHTML='
No jobs queued
'; return; }} - // Running jobs are auto-opened once, on first appearance. We remember which - // we have already auto-opened so a manual collapse is not undone on the next - // refresh (previously, collapsing the only open job made the snapshot empty - // and re-triggered the auto-open). - const autoOpened=window.__tqAutoOpened||(window.__tqAutoOpened=new Set()); - const presentKeys=new Set(); let html=''; jobs.forEach((job,i)=>{{ const status=job.status||'pending'; const label=job.label||('Job '+(i+1)); const params=job.params||{{}}; const key=(job.added_at||'')+'|'+label; - presentKeys.add(key); - // Open if the user currently has it open, or it is a running job we have - // not auto-opened before (its first appearance). Auto-open fires once. - let shouldOpen=openKeys.has(key); - if(status==='running' && !autoOpened.has(key)){{ - shouldOpen=true; - autoOpened.add(key); - }} + // Open only if the user currently has it open -- never force-open a + // job just because it started running. + const shouldOpen=openKeys.has(key); const paramRows=buildParamRows(params); const addedAt=job.added_at ?'Added '+new Date(job.added_at).toLocaleString([],{{month:'short',day:'numeric',hour:'2-digit',minute:'2-digit'}}) @@ -2875,9 +2864,6 @@ function renderTomoQueue(jobs){{ +'' +''; }}); - // Drop remembered auto-open keys for jobs that are gone, so the set stays - // small and a job that later reappears is treated as new. - autoOpened.forEach(k=>{{ if(!presentKeys.has(k)) autoOpened.delete(k); }}); el.innerHTML=html; }}