Skip to content

Add AccordionExpander to Modules summary section in GenerateTab - #65

Merged
SeamusMullan merged 4 commits into
mainfrom
copilot/create-summary-page-structure-again
Apr 4, 2026
Merged

Add AccordionExpander to Modules summary section in GenerateTab#65
SeamusMullan merged 4 commits into
mainfrom
copilot/create-summary-page-structure-again

Conversation

Copilot AI commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

The Modules section in GenerateTab rendered as a flat, non-interactive QLabel inside a plain QGroupBox. The existing AccordionExpander component was unused here despite the EPIC explicitly requiring "Modules summary with expansion."

Changes

src/ui/tabs/generate_tab.py

  • Wraps _modules_lbl inside an AccordionExpander (starts expanded by default) within the Modules QGroupBox
  • reset() restores the accordion to its expanded default state
  • _section_groups["Modules"] remains a QGroupBox — no structural breakage to callers
self._modules_expander = AccordionExpander(
    "",
    subtitle="Expand to review selected optional modules",
    start_expanded=True,
)
self._modules_expander.body_layout.addWidget(self._modules_lbl)

tests/test_generate_tab.py

  • Adds TestGenerateTabModulesAccordion (9 tests) covering: attribute presence, type assertion, expand/collapse toggle, body layout containment, text content after config update, QGroupBox wrapping, and reset behaviour

Copilot AI linked an issue Apr 3, 2026 that may be closed by this pull request
6 tasks
@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown

📊 PR Summary

Changes Overview

  • Files Changed: 0
  • Python Files: 0
  • Test Files: 0
  • Documentation: 0
  • Added: 0
  • Deleted: 0

CI Checks

This PR will trigger the following checks:

Please ensure all checks pass before merging.

Copilot AI changed the title [WIP] Add summary page structure for Tab 4 with data binding Add AccordionExpander to Modules summary section in GenerateTab Apr 3, 2026
Copilot AI requested a review from SeamusMullan April 3, 2026 18:53
@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown

📊 PR Summary

Changes Overview

  • Files Changed: 2
  • Python Files: 2
  • Test Files: 1
  • Documentation: 0
  • Added: 0
  • Deleted: 0

CI Checks

This PR will trigger the following checks:

  • ✅ Linting (ruff, isort, black)
  • ✅ Type Checking (mypy)
  • ✅ Tests (pytest)

Please ensure all checks pass before merging.

@SeamusMullan
SeamusMullan marked this pull request as ready for review April 4, 2026 10:11
Copilot AI review requested due to automatic review settings April 4, 2026 10:11
@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown

📊 PR Summary

Changes Overview

  • Files Changed: 2
  • Python Files: 2
  • Test Files: 1
  • Documentation: 0
  • Added: 0
  • Deleted: 0

CI Checks

This PR will trigger the following checks:

  • ✅ Linting (ruff, isort, black)
  • ✅ Type Checking (mypy)
  • ✅ Tests (pytest)

Please ensure all checks pass before merging.

@SeamusMullan
SeamusMullan merged commit 705994f into main Apr 4, 2026
5 checks passed
@SeamusMullan
SeamusMullan deleted the copilot/create-summary-page-structure-again branch April 4, 2026 10:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 an AccordionExpander (default expanded) inside the Modules QGroupBox.
  • 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(
"",

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"",
"Optional modules",

Copilot uses AI. Check for mistakes.
Comment on lines +121 to +125
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)

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
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.

[EPIC] Create Summary Page Structure

3 participants