fix: critical QA findings — dead code and prop mismatch
1. Remove get_config_manager() call from translate_run_websocket
(@app.websocket /ws/translate/run/{run_id}) — was not imported
and unused. Also remove unused from sqlalchemy.orm import Session.
2. Fix prop name mismatch: showBulkReplace -> showPageBulkReplace
in RunTabContent. Use () for reactive two-way binding.
3. Add ('DRAFT') for status prop in RunTabContent.
This commit is contained in:
@@ -640,10 +640,8 @@ async def translate_run_websocket(websocket: WebSocket, run_id: str):
|
||||
await websocket.accept()
|
||||
logger.reason("Accepted translate run WebSocket", extra={"run_id": run_id})
|
||||
try:
|
||||
config_manager = get_config_manager()
|
||||
while True:
|
||||
try:
|
||||
from sqlalchemy.orm import Session
|
||||
from .core.database import SessionLocal
|
||||
from .plugins.translate.orchestrator_aggregator import TranslationResultAggregator
|
||||
from .core.event_log import EventLog
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
import TranslationRunResult from './TranslationRunResult.svelte';
|
||||
|
||||
let {
|
||||
status = 'DRAFT',
|
||||
status = $bindable('DRAFT'),
|
||||
jobId = '',
|
||||
isRunning = false,
|
||||
isFullRun = false,
|
||||
@@ -30,14 +30,12 @@
|
||||
runComplete = false,
|
||||
completedRuns = [],
|
||||
expandedRunIds = [],
|
||||
showBulkReplace = false,
|
||||
showPageBulkReplace = $bindable(false),
|
||||
onTriggerRun = (isFull) => {},
|
||||
onRetryRun = () => {},
|
||||
onRetryInsert = () => {},
|
||||
onLoadRunHistory = () => {},
|
||||
onToggleRunDetails = (id) => {},
|
||||
onBulkReplaceApplied = (count) => {},
|
||||
onBulkReplaceClose = () => {},
|
||||
getJobStatusLabel = (s) => s,
|
||||
} = $props();
|
||||
|
||||
@@ -144,7 +142,7 @@
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<h3 class="text-sm font-medium text-gray-700">{$t.translate?.config?.recent_runs}</h3>
|
||||
<button
|
||||
onclick={() => showBulkReplace = true}
|
||||
onclick={() => showPageBulkReplace = true}
|
||||
class="px-3 py-1.5 text-xs bg-indigo-600 text-white rounded hover:bg-indigo-700 transition-colors"
|
||||
>
|
||||
{$t.translate?.run?.bulk_replace || 'Bulk Replace'}
|
||||
|
||||
Reference in New Issue
Block a user