From 4c877dd6a2167fd327f8f60134294ab6fc64e7ca Mon Sep 17 00:00:00 2001 From: Jim Lancaster <40281233+zoltan57@users.noreply.github.com> Date: Tue, 1 Sep 2026 11:54:34 -0500 Subject: [PATCH] V6.1 fixes --- src/transcription/ui/pages/settings_page.py | 43 ++++++++++--------- .../ui/runtime_settings_store.py | 7 +++ 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/transcription/ui/pages/settings_page.py b/src/transcription/ui/pages/settings_page.py index eee548a..47a7764 100644 --- a/src/transcription/ui/pages/settings_page.py +++ b/src/transcription/ui/pages/settings_page.py @@ -12,6 +12,7 @@ from nicegui import ui from transcription.config import Settings from transcription.db.models import MaintenanceJobType +from transcription.db.models import MaintenanceRunStatus from transcription.runtime_helpers import run_blocking from transcription.services.documents import DocumentService from transcription.services.maintenance import MaintenanceService @@ -23,6 +24,7 @@ from transcription.ui.components.error_presenter import run_ui_action from transcription.ui.components.primitives import destructive_button from transcription.ui.components.primitives import render_empty_state from transcription.ui.components.primitives import section_header_row +from transcription.ui.components.table.common import build_table from transcription.ui.components.table.registry import render_registry_table from transcription.ui.homepage_store import read_homepage_markdown from transcription.ui.homepage_store import save_homepage_markdown @@ -562,26 +564,19 @@ def register_page(*, settings: Settings) -> None: # noqa: PLR0915 for run in runs ] - table = ( - ui.table( - rows=rows, - columns=[ - {"name": "job_type", "label": "Job Type", "field": "job_type", "sortable": True}, - {"name": "status", "label": "Status", "field": "status", "sortable": True}, - {"name": "started_at", "label": "Started", "field": "started_at", "sortable": True}, - {"name": "finished_at", "label": "Finished", "field": "finished_at", "sortable": True}, - {"name": "duration", "label": "Duration", "field": "duration", "sortable": False}, - {"name": "summary", "label": "Summary", "field": "summary", "sortable": False}, - ], - row_key="id", - selection="single", - ) - .classes("w-full ui-table") - .props( - 'flat square table-style="table-layout: fixed; width: 100%;" ' - 'header-cell-class="ui-table-header text-xs uppercase tracking-wider" ' - 'table-class="ui-table-body text-xs"' - ) + table = build_table( + rows=rows, + columns=[ + {"name": "job_type", "label": "Job Type", "field": "job_type", "sortable": True}, + {"name": "status", "label": "Status", "field": "status", "sortable": True}, + {"name": "started_at", "label": "Started", "field": "started_at", "sortable": True}, + {"name": "finished_at", "label": "Finished", "field": "finished_at", "sortable": True}, + {"name": "duration", "label": "Duration", "field": "duration", "sortable": False}, + {"name": "summary", "label": "Summary", "field": "summary", "sortable": False}, + ], + row_key="id", + selection="single", + show_search=False, ) table.add_slot( @@ -656,7 +651,13 @@ def register_page(*, settings: Settings) -> None: # noqa: PLR0915 ui.button("View Log", icon="visibility", on_click=view_log).props("flat") ui.button("Download Log", icon="download", on_click=download_log).props("flat") - if any(run.status.value in {"queued", "processing"} for run in runs): + active_statuses = frozenset( + { + MaintenanceRunStatus.QUEUED, + MaintenanceRunStatus.PROCESSING, + } + ) + if any(run.status in active_statuses for run in runs): ui.timer(4.0, render_maintenance.refresh, once=True) @ui.refreshable diff --git a/src/transcription/ui/runtime_settings_store.py b/src/transcription/ui/runtime_settings_store.py index 1983977..1ea17f2 100644 --- a/src/transcription/ui/runtime_settings_store.py +++ b/src/transcription/ui/runtime_settings_store.py @@ -191,6 +191,13 @@ RUNTIME_SETTINGS_CATALOG: tuple[RuntimeSettingDescriptor, ...] = ( "Optional build or commit identifier for evidence provenance.", "text", ), + RuntimeSettingDescriptor( + "run_embedded_worker", + "RUN_EMBEDDED_WORKER", + "Run embedded worker", + "Run the in-process worker loop in the web app process.", + "bool", + ), RuntimeSettingDescriptor( "bootstrap_schema_on_startup", "BOOTSTRAP_SCHEMA_ON_STARTUP",