refactor: rename Scan deck tab -> Audio (deck wiring only)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 14:13:48 +02:00
co-authored by Claude Opus 4.8
parent f584e54a8c
commit 52ce2d451a
2 changed files with 24 additions and 12 deletions
+11 -10
View File
@@ -19,6 +19,7 @@ from PyQt6.QtWidgets import (
QComboBox, QCheckBox, QSpinBox, QDoubleSpinBox, QComboBox, QCheckBox, QSpinBox, QDoubleSpinBox,
QMessageBox, QInputDialog, QDialog, QDialogButtonBox, QFormLayout, QMessageBox, QInputDialog, QDialog, QDialogButtonBox, QFormLayout,
QTableWidget, QTableWidgetItem, QTabWidget, QTabBar, QHeaderView, QTableWidget, QTableWidgetItem, QTabWidget, QTabBar, QHeaderView,
QToolBox, QGroupBox,
QGridLayout, QGridLayout,
) )
from PyQt6.QtCore import Qt, QObject, QThread, QTimer, QRect, QSize, pyqtSignal, QSettings from PyQt6.QtCore import Qt, QObject, QThread, QTimer, QRect, QSize, pyqtSignal, QSettings
@@ -4480,7 +4481,7 @@ class MainWindow(QMainWindow):
# Row 2/3 — annotation, output path, crop and scan controls all live in # Row 2/3 — annotation, output path, crop and scan controls all live in
# the control deck's tabs now (_build_export_tab / _build_crop_tab / # the control deck's tabs now (_build_export_tab / _build_crop_tab /
# _build_scan_tab); path_row and settings_row are no longer mounted. # _build_audio_tab); path_row and settings_row are no longer mounted.
right = QWidget() right = QWidget()
right_layout = QVBoxLayout(right) right_layout = QVBoxLayout(right)
@@ -4495,7 +4496,7 @@ class MainWindow(QMainWindow):
right_layout.addWidget(self._build_control_deck()) right_layout.addWidget(self._build_control_deck())
self._build_export_tab() self._build_export_tab()
self._build_crop_tab() self._build_crop_tab()
self._build_scan_tab() self._build_audio_tab()
# Left: queue header + playlist # Left: queue header + playlist
self._btn_open = QPushButton("+ Open Files") self._btn_open = QPushButton("+ Open Files")
@@ -4665,7 +4666,7 @@ class MainWindow(QMainWindow):
deck.setTabBar(_DeckTabBar()) deck.setTabBar(_DeckTabBar())
self._tab_export = QWidget(); self._tab_export.setObjectName("export_tab") self._tab_export = QWidget(); self._tab_export.setObjectName("export_tab")
self._tab_crop = QWidget(); self._tab_crop.setObjectName("crop_tab") self._tab_crop = QWidget(); self._tab_crop.setObjectName("crop_tab")
self._tab_scan = QWidget(); self._tab_scan.setObjectName("scan_tab") self._tab_audio = QWidget(); self._tab_audio.setObjectName("audio_tab")
# Panel identity for the side-by-side view (mirrors PlaylistWidget). # Panel identity for the side-by-side view (mirrors PlaylistWidget).
# _label drives the tab text and split-column header; _deck_key is a # _label drives the tab text and split-column header; _deck_key is a
# stable persistence key; _pinned tracks side-by-side membership. # stable persistence key; _pinned tracks side-by-side membership.
@@ -4675,14 +4676,14 @@ class MainWindow(QMainWindow):
self._tab_crop._pinned = False self._tab_crop._pinned = False
self._tab_crop._label = "Crop && Track" self._tab_crop._label = "Crop && Track"
self._tab_crop._deck_key = "crop" self._tab_crop._deck_key = "crop"
self._tab_scan._pinned = False self._tab_audio._pinned = False
self._tab_scan._label = "Scan" self._tab_audio._label = "Audio"
self._tab_scan._deck_key = "scan" self._tab_audio._deck_key = "audio"
# Ordered list for deterministic column / tab order. # Ordered list for deterministic column / tab order.
self._deck_panels = [self._tab_export, self._tab_crop, self._tab_scan] self._deck_panels = [self._tab_export, self._tab_crop, self._tab_audio]
deck.addTab(self._tab_export, self._tab_export._label) deck.addTab(self._tab_export, self._tab_export._label)
deck.addTab(self._tab_crop, self._tab_crop._label) deck.addTab(self._tab_crop, self._tab_crop._label)
deck.addTab(self._tab_scan, self._tab_scan._label) deck.addTab(self._tab_audio, self._tab_audio._label)
self._control_deck = deck self._control_deck = deck
deck.tabBar().pin_toggle_requested.connect(self._on_deck_pin_toggle) deck.tabBar().pin_toggle_requested.connect(self._on_deck_pin_toggle)
@@ -4742,8 +4743,8 @@ class MainWindow(QMainWindow):
g.addWidget(self._chk_track, 3, 0, 1, 2) g.addWidget(self._chk_track, 3, 0, 1, 2)
g.setRowStretch(4, 1); g.setColumnStretch(2, 1) g.setRowStretch(4, 1); g.setColumnStretch(2, 1)
def _build_scan_tab(self) -> None: def _build_audio_tab(self) -> None:
g = QGridLayout(self._tab_scan) g = QGridLayout(self._tab_audio)
g.setContentsMargins(8, 6, 8, 6); g.setHorizontalSpacing(8); g.setVerticalSpacing(6) g.setContentsMargins(8, 6, 8, 6); g.setHorizontalSpacing(8); g.setVerticalSpacing(6)
model_row = QHBoxLayout() model_row = QHBoxLayout()
model_row.addWidget(self._cmb_scan_model, 1); model_row.addWidget(self._btn_model_history) model_row.addWidget(self._cmb_scan_model, 1); model_row.addWidget(self._btn_model_history)
+13 -2
View File
@@ -55,7 +55,7 @@ def test_workers_spinbox_in_export_tab(win):
def test_scan_button_in_scan_tab(win): def test_scan_button_in_scan_tab(win):
from PyQt6.QtWidgets import QPushButton from PyQt6.QtWidgets import QPushButton
assert win._btn_scan in win._tab_scan.findChildren(QPushButton) assert win._btn_scan in win._tab_audio.findChildren(QPushButton)
def test_portrait_combo_in_crop_tab(win): def test_portrait_combo_in_crop_tab(win):
@@ -106,7 +106,7 @@ def test_side_by_side_menu_pins_third_panel(win):
# (there's no tab bar to right-click). Suppress the QSettings save via the # (there's no tab bar to right-click). Suppress the QSettings save via the
# _deck_loading guard so this doesn't leak into other windows. # _deck_loading guard so this doesn't leak into other windows.
win._tab_export._pinned = True win._tab_export._pinned = True
win._tab_scan._pinned = True win._tab_audio._pinned = True
win._refresh_deck_layout() win._refresh_deck_layout()
assert len(_split_columns(win)) == 2 assert len(_split_columns(win)) == 2
act = next(a for a, p in win._deck_pin_actions if p is win._tab_crop) act = next(a for a, p in win._deck_pin_actions if p is win._tab_crop)
@@ -271,3 +271,14 @@ def test_audio_region_tracks_cursor_and_length(win):
win._file_path = "" win._file_path = ""
win._update_audio_region() win._update_audio_region()
assert win._timeline._audio_region is None assert win._timeline._audio_region is None
def test_audio_deck_tab_exists(win):
# The old "Scan" deck tab is now "Audio".
assert hasattr(win, "_tab_audio")
assert win._tab_audio._deck_key == "audio"
assert win._tab_audio in win._deck_panels
assert not hasattr(win, "_tab_scan")
labels = [win._control_deck.tabText(i)
for i in range(win._control_deck.count())]
assert "Audio" in labels and "Scan" not in labels