From cadb24fed774aa97f1f5e0ca9cb42697199a2333 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 10 Feb 2026 15:14:13 -0500 Subject: [PATCH] fix: refresh settings data when navigating to settings view Extract data loading into a refresh() method on SettingsView and call it on view switch so categories, rules, and household data stay current. Co-Authored-By: Claude Opus 4.6 --- src/ui/main_window.py | 2 ++ src/ui/settings_view.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/ui/main_window.py b/src/ui/main_window.py index 801cdf6..a778367 100644 --- a/src/ui/main_window.py +++ b/src/ui/main_window.py @@ -65,6 +65,8 @@ class MainWindow(QMainWindow): def _switch_view(self, key: str): self.stack.setCurrentIndex(self._views[key]) + if key == "settings": + self._settings_view.refresh() def _apply_theme(self, theme: str): qss_path = Path(__file__).parent / "themes" / f"{theme}.qss" diff --git a/src/ui/settings_view.py b/src/ui/settings_view.py index 92a83cc..bba613c 100644 --- a/src/ui/settings_view.py +++ b/src/ui/settings_view.py @@ -39,6 +39,10 @@ class SettingsView(QWidget): self._build_csv_mappings_tab() # Initial data load + self.refresh() + + def refresh(self): + """Reload all settings data from the database.""" self._load_categories() self._load_rules() self._load_household()