Skip to content

Comments

Refactor header#14

Merged
OpenSauce merged 2 commits intomainfrom
refactor-header
Jun 7, 2025
Merged

Refactor header#14
OpenSauce merged 2 commits intomainfrom
refactor-header

Conversation

@OpenSauce
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 7, 2025 20:03
Copy link
Contributor

Copilot AI left a comment

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 centralizes widget header logic by introducing a shared stage_header helper and replacing inline header construction in each stage widget.

  • Add stage_header function to mod.rs and import it into each widget.
  • Define a module-level HEADER_TEXT constant in each widget and remove duplicated icon_button logic.
  • Simplify containers and layouts across tone stack, preamp, power amp, filter, and compressor widgets.

Reviewed Changes

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

Show a summary per file
File Description
src/gui/widgets/tonestack.rs Imported stage_header and replaced inline header code.
src/gui/widgets/preamp.rs Ditto, plus added a TODO for background color.
src/gui/widgets/poweramp.rs Ditto, simplified container layout.
src/gui/widgets/filter.rs Ditto.
src/gui/widgets/compressor.rs Ditto, cleaned up imports.
src/gui/widgets/mod.rs Introduced the new stage_header helper function.
Comments suppressed due to low confidence (4)

src/gui/widgets/mod.rs:52

  • [nitpick] Consider adding a doc comment for stage_header to describe its purpose, parameters, and return value for clearer code maintenance.
pub fn stage_header(stage_name: &str, idx: usize, total_stages: usize) -> Element<Message> {

src/gui/widgets/tonestack.rs:7

  • [nitpick] The constant name HEADER_TEXT is quite generic. You might rename it to STAGE_LABEL or STAGE_NAME to better convey its purpose and avoid potential confusion.
const HEADER_TEXT: &str = "ToneStack";

src/gui/widgets/mod.rs:82

  • The original headers placed the stage title before the buttons. The new order shows buttons first then text, which may unintentionally alter the UI layout. Confirm this change is intentional or revert to text followed by the icon buttons.
row![move_up_btn, move_down_btn, remove_btn, text(header_text)]

src/gui/widgets/preamp.rs:50

  • [nitpick] Add a tracking issue or remove this TODO to ensure the background color improvement isn’t forgotten or left without follow-up.
// TODO: Use a better background colour

@OpenSauce OpenSauce merged commit 78e285a into main Jun 7, 2025
2 checks passed
@OpenSauce OpenSauce deleted the refactor-header branch June 7, 2025 20:06
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