From ca26da303c99fc794c93c23a0373552a896c7e74 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Fri, 3 Apr 2026 01:22:08 +0200 Subject: [PATCH] fix: persist resolutions on init and on every value change Co-Authored-By: Claude Opus 4.6 --- tab_batch_ng.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tab_batch_ng.py b/tab_batch_ng.py index b9386a1..7787efa 100644 --- a/tab_batch_ng.py +++ b/tab_batch_ng.py @@ -555,9 +555,12 @@ def _render_sequence_card(i, seq, batch_list, data, file_path, state, # --- Resolutions (6 fixed slots) --- ui.label('Resolutions').classes('text-caption text-weight-bold q-mt-md') - resolutions = seq.setdefault('resolutions', []) - while len(resolutions) < 6: - resolutions.append([512, 512]) + if 'resolutions' not in seq or len(seq.get('resolutions', [])) < 6: + resolutions = seq.setdefault('resolutions', []) + while len(resolutions) < 6: + resolutions.append([512, 512]) + commit() + resolutions = seq['resolutions'] for idx in range(6): entry = resolutions[idx] with ui.row().classes('items-center w-full q-mt-xs'): @@ -575,7 +578,9 @@ def _render_sequence_card(i, seq, batch_list, data, file_path, state, commit() w_inp.on('blur', lambda _, s=_sync_wh: s()) + w_inp.on('update:model-value', lambda _, s=_sync_wh: s()) h_inp.on('blur', lambda _, s=_sync_wh: s()) + h_inp.on('update:model-value', lambda _, s=_sync_wh: s()) with splitter.after: # Mode