Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses an issue where forecast data was not rendered when it arrived delayed (initially empty but received later). The fix adds logic to detect when the number of forecast items changes and triggers a layout recalculation to properly display the forecast data.
- Tracks previous forecast lengths before updating forecast data
- Recalculates layout when the number of forecast items changes
- Adds test coverage for the layout recalculation behavior
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/weather-forecast-card.ts | Adds logic to detect forecast length changes and trigger layout recalculation |
| test/weather-forecast-card.test.ts | Adds test to verify layout recalculation when forecast item count changes |
| test/mocks/hass.ts | Updates mock updateForecasts method to accept forecast type parameter and trigger subscriptions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR fixes an issue where forecast data was not rendered on delayed forecast data. If the forecast is initially empty and is received later, the card didn't render forecast data at all.