Skip to content

Refactor GUI to be more modular - #31

Merged
OpenSauce merged 1 commit into
mainfrom
refactor-gui
Jul 12, 2025
Merged

Refactor GUI to be more modular#31
OpenSauce merged 1 commit into
mainfrom
refactor-gui

Conversation

@OpenSauce

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 12, 2025 18:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the GUI into modular pieces by extracting configs, messages, and view components, and replaces the old monolithic amp.rs with a new AmplifierApp.

  • Reorganized module structure under src/gui
  • Introduced per-stage config and message modules
  • Created reusable widget and stage view components

Reviewed Changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/gui/mod.rs Updated root module to export app, components, config, and messages
src/gui/messages.rs Extracted all GUI message enums into a dedicated module
src/gui/config/*.rs Added individual config modules (filter, preamp, etc.) each with to_stage
src/gui/components/widgets/common.rs Refactored common widget imports and cleaned up labeled_slider layout
src/gui/components/stages/*.rs Moved each stage’s UI into its own view function in separate files
src/gui/components/stage_list.rs Added StageList component to render the list of stages
src/gui/components/control.rs Added Control component for stage type selection and adding stages
src/gui/app.rs Introduced AmplifierApp and build_amplifier_chain logic
src/gui/amp.rs Removed the old, monolithic GUI implementation file
Comments suppressed due to low confidence (4)

src/gui/app.rs:182

  • Stage names passed to to_stage are inconsistent with display names (no space in ToneStack). Consider using "Tone Stack {idx}" to match the user-facing label.
                    cfg.to_stage(&format!("ToneStack {idx}"), sample_rate),

src/gui/config/preamp.rs:21

  • [nitpick] The to_stage method for PreampConfig omits a sample_rate parameter, unlike other configs. Consider standardizing all to_stage signatures to accept sample_rate for consistency.
    pub fn to_stage(&self, name: &str) -> PreampStage {

src/gui/config/tonestack.rs:1

  • [nitpick] Consider adding unit tests for ToneStackConfig::to_stage to verify that it constructs a ToneStackStage with correct default and custom parameters.
use crate::sim::stages::tonestack::{ToneStackModel, ToneStackStage};

src/gui/components/stages/tonestack.rs:20

  • The model_picker row is missing .spacing() and .align_y() modifiers, which may break its layout. Add .spacing(10).align_y(Alignment::Center) to match other stage pickers.
    let model_picker = row![

@OpenSauce
OpenSauce merged commit 37fd185 into main Jul 12, 2025
2 checks passed
@OpenSauce
OpenSauce deleted the refactor-gui branch July 12, 2025 18:19
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.

2 participants