Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

gonzalezjj
Copy link
Contributor

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:

image

In its current state, the PR is meant as a request for comments. The following should completed before merging:

  • Tests (I might be able to do that myself)
  • Translations (not sure how to do that, other than by using online translation services)

I'd appreciate some input about this change. Thanks!

Copy link
Owner

@decompil3d decompil3d left a 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.

}

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) {
Copy link
Owner

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.

@gonzalezjj
Copy link
Contributor Author

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.

@decompil3d
Copy link
Owner

Apologies for the long delay on this. If you're still keen on adding this feature, would you mind rebasing against the latest main and getting things back up to date? Then I can merge this into a second branch so translations get picked up.

@daveB30
Copy link

daveB30 commented Aug 30, 2024

Is this still under development?
It would be a very nice and useful feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants