-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Allow negative offsets and show empty segments when no data is available #494
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a fine optional feature. Go ahead and add tests. As mentioned in the other PR, if you have localizable strings just let me know at review time and I can merge into a local branch to trigger the translation CI. Also, please make sure to update the Readme for this.
src/weather-bar.ts
Outdated
} | ||
|
||
const windCfg = this.show_wind ?? ''; | ||
const barBlocks: TemplateResult[] = []; | ||
let lastDate: string | null = null; | ||
|
||
for (let i = 0; i < this.num_empty_segments_leading; i += 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider extracting this into a small function so you can reuse this for the trailing space too without repeating yourself.
Hi. Thanks for your feedback. I believe that this feature is now ready to be merged into a branch on your repository. I've adapted the tests and the readme, and refactored the code to avoid duplication. Some screenshots for the readme might also be nice. I didn't want to change your repository's look, so since there are no other screenshots except for the one at the top, I haven't added anything yet. If you want to add some, feel free to reuse the ones in the PR description. |
Apologies for the long delay on this. If you're still keen on adding this feature, would you mind rebasing against the latest |
Is this still under development? |
This PR enables setting offset to both negative values and values larger than the amount of available data. This allows creating weather bars with fixed num_segments that don't change their layouts as time passes. It can be useful to show daily weather bars:
In its current state, the PR is meant as a request for comments. The following should completed before merging:
I'd appreciate some input about this change. Thanks!