feat: added support for limiting hourly and daily forecast slots#49
Merged
feat: added support for limiting hourly and daily forecast slots#49
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for limiting the number of hourly and daily forecast entries displayed in the weather forecast card. Users can now configure hourly_slots and daily_slots to control how many forecast items are shown, with support for values starting from 0 (no entries) to unlimited (when not specified).
- Added
hourly_slotsanddaily_slotsconfiguration options to the forecast config - Implemented slot limiting logic that correctly applies after hourly grouping
- Added comprehensive test coverage for various slot limit scenarios
- Updated editor UI with new configuration fields and help text
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/types.ts | Added hourly_slots and daily_slots as optional number fields to the forecast configuration interface |
| src/weather-forecast-card.ts | Implemented slot limiting logic using array slicing, correctly applying limits after hourly grouping aggregation |
| src/editor/weather-forecast-card-editor.ts | Added UI schema entries and localization for the new slot configuration fields with appropriate minimum values |
| test/weather-forecast-card.test.ts | Added comprehensive test suite covering daily slots, hourly slots, combination with grouping, zero slots, and undefined behavior |
| README.md | Updated documentation table with descriptions for the new hourly_slots and daily_slots configuration options |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #17