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

onroad/alerts: replace magic numbers with named constants #33388

Closed
wants to merge 1 commit into from

Conversation

deanlee
Copy link
Contributor

@deanlee deanlee commented Aug 27, 2024

The alert_heights map was also removed because it didn't adapt to changes in window height, causing resizing issues. It was also non-constant, which was not ideal.

@github-actions github-actions bot added the ui label Aug 27, 2024
Copy link
Contributor

github-actions bot commented Aug 27, 2024

Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following:

  • Convert your PR to a draft unless it's ready to review
  • Read the contributing docs
  • Before marking as "ready for review", ensure:
    • the goal is clearly stated in the description
    • all the tests are passing
    • the change is something we merge
    • include a route or your device' dongle ID if relevant

@deanlee deanlee changed the title ui/alerts: replace magic numbers with named constants onroad/alerts: replace magic numbers with named constants Aug 27, 2024
Copy link
Contributor

github-actions bot commented Aug 27, 2024

UI Screenshots

@deanlee deanlee force-pushed the ui_improve_alerts branch 2 times, most recently from 710f19c to 930c0cb Compare August 27, 2024 09:42
Copy link
Contributor

@adeebshihadeh adeebshihadeh left a comment

Choose a reason for hiding this comment

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

Can you add one of each alert to the UI report?

We'll be touching this code a lot more soon, and it would be nice if the UI report showed the changes.

@deanlee
Copy link
Contributor Author

deanlee commented Aug 28, 2024

#33394

done, but not sure why the ui report is still displaying the old information.could it be that the updated results only appear after merging?

@maxime-desroches
Copy link
Contributor

@deanlee Yes, the ui_preview.yaml workflow is always taken from master since it has access to some Github Secrets.
The best way to test your new ui preview is to merge the new ui_preview.yaml in the master branch of your fork and then to do a PR againt the master branch of your fork.

@deanlee deanlee force-pushed the ui_improve_alerts branch 3 times, most recently from 4d2cb85 to 887708c Compare August 31, 2024 04:59
@adeebshihadeh
Copy link
Contributor

I don't actually think this is better. The locality of all these numbers makes the paintEvent readable. If anything's duplicated, let's pull it into a constant, but otherwise I think this is fine.

@deanlee deanlee deleted the ui_improve_alerts branch September 1, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants