1818from spikeinterface .curation import validate_curation_dict
1919
2020from aind_ephys_portal .panel .logging import setup_logging , local_log_context
21- from aind_ephys_portal .panel .utils import PostMessageListener
21+ from aind_ephys_portal .panel .utils import PostMessageListener , FullscreenResizeHandler
2222
2323
2424displayed_unit_properties = [
@@ -111,6 +111,9 @@ def delayed_init():
111111 sizing_mode = "stretch_both" ,
112112 )
113113
114+ def create_fullscreen_resize_listener (self ):
115+ return FullscreenResizeHandler ()
116+
114117 def create_post_message_listener (self ):
115118 if self .identifier is not None :
116119 listener = PostMessageListener ()
@@ -212,13 +215,15 @@ def _initialize(self):
212215 # Add custom curation callback to send data to parent window
213216 self .submit_trigger = self .create_submit_trigger ()
214217 # Add postMessage listener to receive data from parent window
215- self .listener = self .create_post_message_listener ()
218+ self .curation_listener = self .create_post_message_listener ()
219+ self .fullscreen_listener = self .create_fullscreen_resize_listener ()
216220
217221 self .win_layout = self ._create_main_window ()
218222 self .layout [0 ] = self .win_layout
219223 if self .identifier is not None :
220224 self .layout .append (self .submit_trigger )
221- self .layout .append (self .listener )
225+ self .layout .append (self .curation_listener )
226+ self .layout .append (self .fullscreen_listener )
222227
223228 print ("\n Ephys GUI initialized successfully!" )
224229 t_stop = time .perf_counter ()
@@ -231,7 +236,9 @@ def _initialize(self):
231236
232237 if error is not None :
233238 print (f"Error during initialization: { error } " )
234- self .layout [0 ] = pn .pane .Markdown (f"⚠️ Error during initialization: { error } " , sizing_mode = "stretch_both" )
239+ self .layout = pn .Column (
240+ pn .pane .Markdown (f"⚠️ Error during initialization: { error } " , sizing_mode = "stretch_both" )
241+ )
235242 else :
236243 final_mem = psutil .virtual_memory ()
237244 final_ram_usage = final_mem .used / (1024 ** 3 )
@@ -320,8 +327,9 @@ def cleanup(self):
320327 current_ram_usage = initial_mem .used / (1024 ** 3 )
321328 print (f"\n RAM Usage before cleanup: { current_ram_usage :.2f} / { total_ram :.2f} GB\n " )
322329
323- # 1) Clear postMessage listener and submit trigger (they hold bound-method back-refs to self)
324- self .listener = None
330+ # 1) Clear postMessage listeners and submit trigger (they hold bound-method back-refs to self)
331+ self .curation_listener = None
332+ self .fullscreen_listener = None
325333 self .submit_trigger = None
326334
327335 # 2) Release GUI controller and all its data
0 commit comments