Add AccordionExpander to Modules summary section in GenerateTab - #65
Conversation
📊 PR SummaryChanges Overview
CI ChecksThis PR will trigger the following checks: Please ensure all checks pass before merging. |
Agent-Logs-Url: https://github.com/DirektDSP/PluginConfiguratorApp/sessions/bbfbd3b0-3081-4cda-aa6c-68229138aec1 Co-authored-by: SeamusMullan <43112447+SeamusMullan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/DirektDSP/PluginConfiguratorApp/sessions/bbfbd3b0-3081-4cda-aa6c-68229138aec1 Co-authored-by: SeamusMullan <43112447+SeamusMullan@users.noreply.github.com>
📊 PR SummaryChanges Overview
CI ChecksThis PR will trigger the following checks:
Please ensure all checks pass before merging. |
📊 PR SummaryChanges Overview
CI ChecksThis PR will trigger the following checks:
Please ensure all checks pass before merging. |
There was a problem hiding this comment.
Pull request overview
Adds an interactive expand/collapse UI to the Modules summary in GenerateTab by embedding the modules summary label inside the existing AccordionExpander, and adds tests to validate the new behavior.
Changes:
- Wrap Modules summary (
_modules_lbl) in anAccordionExpander(default expanded) inside the ModulesQGroupBox. - Update
reset()to restore the Modules accordion to its default expanded state. - Add a new test suite covering expander presence, behavior, containment, and reset behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/ui/tabs/generate_tab.py |
Introduces _modules_expander and nests the modules summary label inside it; ensures reset restores expanded state. |
tests/test_generate_tab.py |
Adds tests validating the Modules accordion wiring, expand/collapse behavior, and reset behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| self._modules_lbl = self._make_summary_label() | ||
| modules_group = self._make_section_group("Modules", self._modules_lbl) | ||
| self._modules_expander = AccordionExpander( | ||
| "", |
There was a problem hiding this comment.
AccordionExpander is constructed with an empty title (""). In the current AccordionExpander implementation the title QLabel is always shown, so an empty title can still reserve vertical space and render as a blank header line. Consider providing a meaningful title (e.g. "Optional modules") or updating the component usage so the title label is hidden when the title is empty, to avoid awkward layout/UX.
| "", | |
| "Optional modules", |
| modules_group = QGroupBox("Modules") | ||
| modules_inner = QVBoxLayout() | ||
| modules_inner.setContentsMargins(6, 6, 6, 6) | ||
| modules_inner.addWidget(self._modules_expander) | ||
| modules_group.setLayout(modules_inner) |
There was a problem hiding this comment.
The Modules section is now created with a custom QGroupBox/QVBoxLayout block instead of reusing _make_section_group, which is used for the other sections. This introduces duplicated layout construction and different margin behavior for Modules vs the rest. Consider generalizing _make_section_group to accept a QWidget (not just QLabel) and optional margins/spacing, then reuse it here to keep section construction consistent and easier to maintain.
The Modules section in
GenerateTabrendered as a flat, non-interactiveQLabelinside a plainQGroupBox. The existingAccordionExpandercomponent was unused here despite the EPIC explicitly requiring "Modules summary with expansion."Changes
src/ui/tabs/generate_tab.py_modules_lblinside anAccordionExpander(starts expanded by default) within the ModulesQGroupBoxreset()restores the accordion to its expanded default state_section_groups["Modules"]remains aQGroupBox— no structural breakage to callerstests/test_generate_tab.pyTestGenerateTabModulesAccordion(9 tests) covering: attribute presence, type assertion, expand/collapse toggle, body layout containment, text content after config update, QGroupBox wrapping, and reset behaviour