From 121dbb788d051c76375261cd18fa8dca0f23b935 Mon Sep 17 00:00:00 2001 From: Warry Date: Sun, 30 Nov 2025 15:37:32 +0100 Subject: feat: refactor settings UI with category navigation and add Delimiters page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #640 ## Changes ### UI Refactoring - Replace monolithic settings dialog with category-based navigation - Add QListWidget (lw_categories) for category selection on the left - Add QStackedWidget (sw_categories) for content pages on the right - Organize settings into 5 distinct pages: - Flags (14 checkboxes) - Quality (3 combo boxes) - Numbers (2 spin boxes) - Paths & Formats (7 line edits + 2 browse buttons) - Delimiters (4 line edits) — NEW ### New Feature: Delimiters Category - Add customizable separators for artists in metadata and filenames: - metadata_delimiter_artist - metadata_delimiter_album_artist - filename_delimiter_artist - filename_delimiter_album_artist - Auto-integration with DialogPreferences via parameters_line_edit - Line edits with max width 100px for compact display ### Styling - Apply dark theme to settings dialog: - Category list: #2b2b2b background, #3d5a80 selection, #3a3a3a hover - Settings area: #333333 background, styled GroupBoxes (#3a3a3a) - Light text (#e0e0e0) for better contrast - Add spacing property (6px) to category list for better readability - Style QListWidget items with padding (4px 3px) and margin (2px 0px) ### Testing - Add comprehensive test suite (61 tests total): - test_settings_ui.py: UI and basic integration (14 tests) - test_settings_dialog_structure.py: detailed structure validation (20 tests) - test_dialog_preferences_integration.py: DialogPreferences integration (14 tests) - test_delimiters_category.py: new Delimiters page validation (13 tests) - Fix ruff issues (F841, S108) in test files - All tests passing with 100% success rate ### Documentation - Add docs/refactor_settings_ui.md: comprehensive refactor overview - Add docs/delimiters_category.md: Delimiters feature documentation - Add docs/ui_styles.md: dark theme style guide - Add docs/testing_summary.md: testing overview and commands ### Code Quality - Apply ruff/black/pyupgrade via pre-commit hooks - Fix F841 (unused variable) in test_dialog_preferences_integration.py - Fix S108 (insecure temp path) using Path.home() in test_settings_ui.py - End-of-file fixes applied automatically ## Files Modified - tidal_dl_ng/ui/dialog_settings.ui (complete restructure) - tidal_dl_ng/ui/dialog_settings.py (auto-generated from .ui) - tidal_dl_ng/dialog.py (add 4 delimiter params + Delimiters category) - tests/* (4 new test files with 61 tests) - docs/* (4 new documentation files) ## Impact - Improved UX: intuitive category navigation, better visual organization - Extensibility: easy to add new settings pages/categories - Quality: comprehensive test coverage ensures robustness - User flexibility: customizable separators for metadata and filenames ## Technical Notes - QStackedWidget pages indexed 0-4 matching category list order - Navigation via QListWidget::currentRowChanged signal - Automatic save/load through existing DialogPreferences methods - No breaking changes to existing settings or configuration ## Testing Commands ```powershell poetry run pre-commit run -a poetry run pytest -q --- tidal_dl_ng/ui/dialog_settings.ui | 1936 +++++++++++++++++++++++-------------- 1 file changed, 1191 insertions(+), 745 deletions(-) (limited to 'tidal_dl_ng/ui/dialog_settings.ui') diff --git a/tidal_dl_ng/ui/dialog_settings.ui b/tidal_dl_ng/ui/dialog_settings.ui index 3161095..77dd59a 100644 --- a/tidal_dl_ng/ui/dialog_settings.ui +++ b/tidal_dl_ng/ui/dialog_settings.ui @@ -6,8 +6,8 @@ 0 0 - 640 - 832 + 808 + 379 @@ -50,749 +50,1195 @@ 12 - - - - 100 - 100 - - - - Flags - - - false - - - false - - - - - - - - - - - 100 - 100 - - - - CheckBox - - - - - - - - - - - - 100 - 100 - - - - CheckBox - - - - - - - - - - - - - - - - 0 - 0 - - - - - - - CheckBox - - - - - - - - - - - - 100 - 100 - - - - CheckBox - - - - - - - - - - - - - - - - 100 - 100 - - - - CheckBox - - - - - - - - - - - - 0 - 0 - - - - CheckBox - - - - - - - - - - - - - - - CheckBox - - - - - - - - - - - CheckBox - - - - - - - - - - - - - - - CheckBox - - - - - - - - - - - CheckBox - - - - - - - - - - - - - - - CheckBox - - - - - - - - - - - CheckBox - - - - - - - - - - - - - - - CheckBox - - - - - - - - - - - CheckBox - - - - - - - - - - - - - - - 0 - 0 - - - - Choices - - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - - - - - QLayout::SizeConstraint::SetDefaultConstraint - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - 10 - 0 - - - - - - - - - - - - - Numbers - - - - - - - - TextLabel - - - - - - - TextLabel - - - - - - - 4 - - - - - - - - - - - TextLabel - - - - - - - TextLabel - - - - - - - 1 - - - 5 - - - - - - - - - - - - Path - - - - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - - - - - - - - - 0 - 0 - - - - true - - - - - - - ... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - 0 - - - - - - - - - - - - - - - - - - - - 0 - 0 - - - - true - - - - - - - ... - - - - - - - - - + + + + + + 0 + 0 + + + + + 150 + 0 + + + + + 200 + 16777215 + + + + QListWidget { + background-color: #2b2b2b; + border: 1px solid #3d3d3d; + border-radius: 4px; + padding: 4px; + outline: none; +} + +QListWidget::item { + padding: 4px 3px; + border-radius: 3px; + margin: 2px 0px; + color: #e0e0e0; +} + +QListWidget::item:selected { + background-color: #3d5a80; + color: white; + font-weight: bold; +} + +QListWidget::item:hover:!selected { + background-color: #3a3a3a; + color: white; +} + +QListWidget::item:focus { + outline: none; +} + + + QFrame::Shape::StyledPanel + + + QFrame::Shadow::Raised + + + -1 + + + QListView::ResizeMode::Adjust + + + 0 + + + + + + + QStackedWidget { + background-color: #333333; + border: 1px solid #3d3d3d; + border-radius: 4px; +} + +QWidget { + background-color: transparent; +} + +QGroupBox { + background-color: #3a3a3a; + border: 1px solid #4a4a4a; + border-radius: 6px; + margin-top: 12px; + padding-top: 12px; + font-weight: bold; +} + +QGroupBox::title { + subcontrol-origin: margin; + subcontrol-position: top left; + padding: 4px 8px; + background-color: #3a3a3a; + border-radius: 4px; +} + + + QFrame::Shape::StyledPanel + + + QFrame::Shadow::Plain + + + 1 + + + 0 + + + + + + + + 100 + 100 + + + + Flags + + + false + + + false + + + + + + + + + + + 100 + 100 + + + + CheckBox + + + + + + + + + + + + 100 + 100 + + + + CheckBox + + + + + + + + + + + + + + + + 0 + 0 + + + + + + + CheckBox + + + + + + + + + + + + 100 + 100 + + + + CheckBox + + + + + + + + + + + + + + + + 100 + 100 + + + + CheckBox + + + + + + + + + + + + 0 + 0 + + + + CheckBox + + + + + + + + + + + + + + + CheckBox + + + + + + + + + + + CheckBox + + + + + + + + + + + + + + + CheckBox + + + + + + + + + + + CheckBox + + + + + + + + + + + + + + + CheckBox + + + + + + + + + + + CheckBox + + + + + + + + + + + + + + + CheckBox + + + + + + + + + + + CheckBox + + + + + + + + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + + + + + + 0 + 0 + + + + Choices + + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + + + + + QLayout::SizeConstraint::SetDefaultConstraint + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 10 + 0 + + + + + + + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + + + + + Numbers + + + + + + + + TextLabel + + + + + + + TextLabel + + + + + + + 4 + + + + + + + + + + + TextLabel + + + + + + + TextLabel + + + + + + + 1 + + + 5 + + + + + + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + + + + + Path + + + + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + + + + + + + + + 0 + 0 + + + + true + + + + + + + ... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + true + + + + + + + ... + + + + + + + + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + + + + + Delimiters + + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + + 100 + 16777215 + + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + + 100 + 16777215 + + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + + 100 + 16777215 + + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + + 100 + 16777215 + + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + + -- cgit v1.3.1