Skip to content

🧹 Refactor button hover interactions to remove code duplication#19

Draft
dynamikdev wants to merge 1 commit into
masterfrom
refactor-ui-hover-duplication-7089390449446674377
Draft

🧹 Refactor button hover interactions to remove code duplication#19
dynamikdev wants to merge 1 commit into
masterfrom
refactor-ui-hover-duplication-7089390449446674377

Conversation

@dynamikdev
Copy link
Copy Markdown
Owner

🎯 What: Removed duplicated hover-handling code across UI button systems and introduced a single generic hover system. Fixed a state bug where the sequence control button failed to reset its base color when un-hovered.

💡 Why: Code duplication makes maintenance harder. A single generic hover system centralizes the hover style (GHOST_BORDER), making it easier to tweak the design system globally. Addressing the sequence_control_button_system's missing Interaction::None block resolves a visual bug where it would "stick" to the hover state instead of restoring to the active PRIMARY_EMISSIVE color.

Verification:

  • Ran cargo check locally after installing Linux Bevy dependencies.
  • Confirmed Bevy tests via CI=true cargo test pass successfully.
  • Passed the internal Code Review tool validation.

Result: Improved UI maintainability and visual consistency, all while shrinking the codebase and fixing an interaction bug.


PR created automatically by Jules for task 7089390449446674377 started by @dynamikdev

- Removed duplicated `Interaction::Hovered` code from multiple UI systems.
- Added a generic `button_hover_system` to handle hover styles globally.
- Corrected missing `Interaction::None` match arm in `sequence_control_button_system`.
- Enforced system ordering to allow toggle-state buttons to safely override generic background restorations.

Co-authored-by: dynamikdev <717692+dynamikdev@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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