Skip to content

Comments

fix: improved wind indicator font and tip visibility#31

Merged
troinine merged 7 commits intomainfrom
fix/improved-wind-indicator
Dec 24, 2025
Merged

fix: improved wind indicator font and tip visibility#31
troinine merged 7 commits intomainfrom
fix/improved-wind-indicator

Conversation

@troinine
Copy link
Owner

No description provided.

@troinine troinine added the fix Fix or improvement label Dec 23, 2025
@troinine troinine requested a review from Copilot December 23, 2025 20:04
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 refactors the wind indicator component to improve arrow visibility by simplifying the arrow geometry and centralizing wind speed unit handling. The component now uses a simpler coordinate-based polygon for the arrow instead of polar coordinates, and delegates unit conversion to a centralized getNormalizedWindSpeed utility function.

  • Refactored wind indicator component API to accept hass, weatherEntity, and forecast objects instead of individual wind properties
  • Simplified arrow rendering using Cartesian coordinates instead of polar math for better visibility
  • Added comprehensive test suite covering rendering, rotation, type behavior, colors, and sizing

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/wind-indicator.test.ts New comprehensive test file with 20+ tests covering rendering, rotation, bearing vs direction types, color thresholds, and custom sizing
src/components/wfc-wind-indicator.ts Refactored component API, simplified arrow geometry using Cartesian coordinates, moved unit conversion to getNormalizedWindSpeed, improved text positioning and accessibility
src/components/wfc-forecast-simple.ts Updated to pass ExtendedHomeAssistant type and weatherEntity prop to child components
src/components/wfc-forecast-info.ts Refactored to pass weatherEntity prop to wind indicator instead of computing wind unit locally
src/components/wfc-forecast-chart.ts Updated to pass weatherEntity prop to forecast info component

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@troinine troinine changed the title fix: improved wind indicator arrow visibility fix: improved wind indicator font and tip visibility Dec 24, 2025
@troinine troinine requested a review from Copilot December 24, 2025 18:54
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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

</g>

<text x="${cx}" y="${cy + 5}" text-anchor="middle">${speed}</text>
<text x="${cx}" y="${cy}" dy="2px">${speed}</text>
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

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

The dy="2px" offset is hardcoded in pixels, which may not scale properly with different font sizes or SVG dimensions. Consider calculating this offset based on the font size or using a unitless value that scales with the viewBox dimensions.

Suggested change
<text x="${cx}" y="${cy}" dy="2px">${speed}</text>
<text x="${cx}" y="${cy}" dy="0.1em">${speed}</text>

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

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

Fixed in 330b62a

@troinine troinine merged commit 100d832 into main Dec 24, 2025
4 checks passed
@troinine troinine deleted the fix/improved-wind-indicator branch December 24, 2025 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fix or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant