Skip to content

feat: Restructure tab navigation with wrapped multi-row deck and debouncing#8

Merged
markkr125 merged 6 commits intomainfrom
tabs-restructure
Mar 21, 2026
Merged

feat: Restructure tab navigation with wrapped multi-row deck and debouncing#8
markkr125 merged 6 commits intomainfrom
tabs-restructure

Conversation

@markkr125
Copy link
Owner

Overview

This PR refactors the request tab system to use a new wrapped multi-row tab deck (RequestTabBar), improving navigation usability for large collections. Key enhancements include debounced tab changes for smoother performance, new tab settings (preview, limits, activation behavior), and better session persistence. The old single-row request_tab_bar.py is deprecated in favor of the sub-package structure.

Key Changes

  • New Tab Deck Implementation (request_tabs):
    • bar.py: Custom RequestTabBar with wrapped rows, drag-to-reorder, and close interactions (650+ lines).
    • labels.py: TabLabel and FolderTabLabel for chip-style tab rendering (278 lines).
    • tab_button.py: TabButton component with close/reorder logic (203 lines).
  • Tab Controller Refactor (tab_controller.py): Updated _TabControllerMixin to integrate new deck, with debouncing and flush mechanism for tab switches (665 lines changed).
  • Settings Integration:
    • New tab_settings_manager.py (260 lines) for persisting tab prefs via QSettings (preview mode, row limits, activate-on-close, wrap mode).
    • Updated settings_dialog.py to include tab settings UI (154 lines).
  • MainWindow Mixins:
    • draft_controller.py, variable_controller.py, and window.py: Minor wiring updates for new tab APIs.
    • send_pipeline.py (not shown in diff but implied): Ensured compatibility with tab changes.
  • Auth and Editor Tweaks:
    • auth_mixin.py: Refactored for better tab context handling (157 lines).
    • editor_widget.py: Small fixes for tab switching.
  • Instructions Sync:
    • Updated copilot-instructions.md, architecture.instructions.md, and testing.instructions.md to reflect new structure, signals, and test patterns.
  • Scripts: Added profile_startup.py for performance profiling during development (190 lines).
  • Deprecations: request_tab_bar.py simplified (359 lines removed); re-export via __init__.py.

Benefits

  • Smoother UX: Debouncing reduces lag on rapid tab navigation; multi-row wrapping handles 20+ tabs without overflow.
  • Customization: Users can now configure tab behavior (e.g., auto-activate on close, line wrapping) via settings dialog.
  • Session Reliability: Improved draft saving and variable overrides during tab switches.
  • Performance: Background flushing prevents UI blocking; profiled startup for faster app launch.

Testing

  • New/Updated Tests:
    • test_main_window_tabs_navigation.py: Covers wrapped deck shortcuts, search, and multi-row behavior (56 lines).
    • test_main_window_session.py: Tab session persistence (save/restore) with new deck (607 lines).
    • test_main_window.py: General tab open/close/switch (103 lines).
    • test_settings_dialog.py: Tab settings UI (56 lines).
    • test_request_tab_bar.py: Deck interactions (114 lines).
    • Minor updates to test_collection_tree_actions.py and test_snippet_panel.py.
  • All tests pass; coverage maintained. Linting, formatting, and type-checking clean.

Related

  • Closes # (if applicable).
  • Follows coding conventions: No file >600 lines; instructions audited.

Ready for review! 🚀

@markkr125 markkr125 merged commit c052743 into main Mar 21, 2026
3 checks passed
@markkr125 markkr125 deleted the tabs-restructure branch March 21, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant