From 876026d1f64130887272c531386486ed23e70fb8 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Sun, 19 Apr 2026 19:06:26 +0200 Subject: [PATCH] fix: block spurious tab signals during scan panel load to prevent slow file switching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit load_for_file and add_scan_results triggered N redundant timeline repaints via tab_changed → _on_scan_regions_edited for each tab add/remove. blockSignals(True) during programmatic tab operations eliminates the cascade. Also adds EAT_LARGE embedding model (1024-dim) and updates design docs. Co-Authored-By: Claude Opus 4.6 --- main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.py b/main.py index 51819fb..532e111 100755 --- a/main.py +++ b/main.py @@ -791,11 +791,13 @@ class ScanResultsPanel(QWidget): self._filename = filename self._profile = profile self._neg_times = self._db.get_hard_negative_times(filename, profile) + self._tabs.blockSignals(True) self._tabs.clear() results = self._db.get_scan_results(filename, profile) for model, rows in results.items(): self._add_tab(model, rows) self._populate_version_combos() + self._tabs.blockSignals(False) def add_scan_results(self, model: str, regions: list[tuple[float, float, float]]) -> None: @@ -803,6 +805,7 @@ class ScanResultsPanel(QWidget): self._db.save_scan_results(self._filename, self._profile, model, regions) db_results = self._db.get_scan_results(self._filename, self._profile) rows = db_results.get(model, []) + self._tabs.blockSignals(True) for i in range(self._tabs.count()): if self._tabs.tabText(i).rsplit(" (", 1)[0] == model: self._tabs.removeTab(i) @@ -813,6 +816,8 @@ class ScanResultsPanel(QWidget): if self._tabs.tabText(i).rsplit(" (", 1)[0] == model: self._tabs.setCurrentIndex(i) break + self._tabs.blockSignals(False) + self.tab_changed.emit() def _add_tab(self, model: str, rows: list[tuple[int, float, float, float, bool, float, float]]) -> None: