Copilot feaeb0071a
Implement consistent hover effect for all HAButtonStyle variants (#3966)
## Summary
Only `HAButtonStyle` (primary) had hover effects implemented. The other
7 button style variants lacked this functionality, creating inconsistent
user interaction feedback.

**Primary Button (HAButtonStyle):**
Maintains its original full hover behavior with both visual and
interaction feedback:
- Background color opacity change: `Color.haPrimary` →
`Color.haPrimary.opacity(0.9)` on hover
- Scale effects: 1.02x on hover, 0.95x on press
- Uses direct `onHover` implementation for complete control

**Other Button Styles:**
Created `HAButtonHoverEffectModifier` - a reusable view modifier that
provides scale-based hover behavior:
- Scale effects: 1.02x on hover, 0.95x on press
- Animations: 0.1s easeInOut transitions
- State-aware: Only activates when button is enabled
- Platform-specific: Excluded on watchOS

Applied to:
- `HAOutlinedButtonStyle`, `HANeutralButtonStyle`,
`HANegativeButtonStyle`, `HASecondaryButtonStyle`,
`HASecondaryNegativeButtonStyle`, `HACriticalButtonStyle`,
`HALinkButtonStyle`

Added `@Environment(\.isEnabled)` to `HACriticalButtonStyle` and
`HALinkButtonStyle` where previously missing.

## Screenshots
N/A - Interactive hover effect, existing snapshot tests cover visual
appearance

## Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#

## Any other notes
Changes maintain backward compatibility with no breaking API changes.
Primary button retains original hover behavior (background + scale),
while other buttons gain new scale-based hover effects for consistent
user feedback.

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> Check HAButtonStyle, the primary style has hover effect set but not
the others, please implement a single logic and apply for all


</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>
2025-11-12 17:01:10 +00:00
..