Expose style controls in local-first Map page#808
Conversation
|
|
| Filename | Overview |
|---|---|
| ui/dockwidget/map_page.py | Adds style_controls_panel and associated layout/visibility helpers to MapPageContent, mirroring the existing filter_controls_panel pattern cleanly. |
| qfit_dockwidget.py | Adds _install_wizard_style_controls and wires it into both the wizard and local-first compositions; idempotency guard, re-parenting, and visibility handling follow the established filter-controls pattern exactly. |
| tests/test_map_page.py | Extends existing map-page tests to cover style_controls_panel initial state, set_style_controls_visible, and persistence through set_state. |
| tests/test_qfit_dockwidget_analysis_pure.py | Adds pure unit tests for _install_wizard_style_controls (move path and idempotency) and mocks the new call in the local-first composition build test. |
| tests/test_qgis_smoke.py | Adds QGIS smoke assertions verifying stylePresetComboBox is parented to the local-first map page's style_controls_panel and indexed within its layout after composition build. |
Sequence Diagram
sequenceDiagram
participant DW as QfitDockWidget
participant Comp as Composition (wizard / local-first)
participant MPC as MapPageContent
participant SCP as style_controls_panel (QWidget)
participant SCL as _style_controls_layout (QVBoxLayout)
DW->>Comp: build_*_composition()
Comp->>MPC: MapPageContent(state)
MPC->>SCP: QWidget(self) + setObjectName
MPC->>SCL: QVBoxLayout(style_controls_panel)
MPC->>MPC: set_state() → set_style_controls_visible()
MPC-->>Comp: map_content
DW->>DW: _install_wizard_style_controls(composition)
DW->>DW: guard: _wizard_style_controls_installed and target == id(map_content)?
alt already installed for this map_content
DW-->>DW: return early (idempotent)
else first install / new target
DW->>DW: _remove_widget_from_current_layout(stylePresetLabel)
DW->>SCP: stylePresetLabel.setParent(style_controls_panel)
DW->>SCL: addWidget(stylePresetLabel)
DW->>DW: _remove_widget_from_current_layout(stylePresetComboBox)
DW->>SCP: stylePresetComboBox.setParent(style_controls_panel)
DW->>SCL: addWidget(stylePresetComboBox)
DW->>MPC: set_style_controls_visible()
DW->>DW: _wizard_style_controls_installed = True
end
Reviews (1): Last reviewed commit: "Expose style controls in local-first map..." | Re-trigger Greptile



Summary
Refs #805.
Tests
python3 -m pytest tests/test_map_page.py tests/test_qfit_dockwidget_analysis_pure.py tests/test_qgis_smoke.py::QgisSmokeTests::test_dock_widget_defaults_to_local_first_live_path -qpython3 -m pytest tests/ -x -q --tb=short