Refactor for readability: declare state attrs, extract helpers, deduplicate

- Declare dynamic attributes (_render_main, _load_file, etc.) in AppState
  dataclass instead of monkey-patching at runtime
- Extract max_main_seq_number() and FRAME_TO_SKIP_DEFAULT in batch tab
- Add commit() closure in _render_sequence_card to deduplicate save/notify/refresh
- Add default param to dict_number(), replace hand-rolled CFG/VACE/custom bindings
- Extract _delete_nodes() helper in timeline to deduplicate single/batch delete
- Split 230-line render_timeline refreshable into 4 focused section helpers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 16:56:40 +01:00
parent a8c9a0376d
commit b0125133f1
4 changed files with 258 additions and 263 deletions

View File

@@ -78,8 +78,8 @@ def render_comfy_monitor(state: AppState):
# --- Auto-poll timer (every 300s) ---
# Store live_checkbox references so the timer can update them
_live_checkboxes = state._live_checkboxes = getattr(state, '_live_checkboxes', {})
_live_refreshables = state._live_refreshables = getattr(state, '_live_refreshables', {})
_live_checkboxes = state._live_checkboxes
_live_refreshables = state._live_refreshables
def poll_all():
timeout_val = config.get('monitor_timeout', 0)