feat: default workflow batch filters to latest batch

This commit is contained in:
chengma
2026-07-08 10:30:30 +08:00
parent c64f947f2f
commit 530ef2009f
6 changed files with 108 additions and 12 deletions
+13
View File
@@ -405,6 +405,19 @@ def _set_batch_progress_overview(label, tasks):
label.setText(_format_batch_progress(summary) if active else "")
def _batch_filter_current_index(combo, batches, selected_batch, had_previous_items):
batch_ids = {batch.id for batch in batches}
if selected_batch in batch_ids:
index = combo.findData(selected_batch)
if index >= 0:
return index
if selected_batch is None and had_previous_items:
index = combo.findData(None)
if index >= 0:
return index
return 1 if batches else 0
def _database_path(db_path=None, config=None) -> str:
return db_path or appconfig.db_path(config)