Skip to content

Add brake indicator to ThrottleBar - #55

Merged
KacperSynator merged 4 commits into
mainfrom
add-brake-indicator-9148402415438005509
Sep 7, 2026
Merged

Add brake indicator to ThrottleBar#55
KacperSynator merged 4 commits into
mainfrom
add-brake-indicator-9148402415438005509

Conversation

@KacperSynator

Copy link
Copy Markdown
Owner

Adds a binary brake indicator onto the existing ThrottleBar overlay, drawn as a red box that illuminates when the brake is engaged. Included configuration UI to toggle the feature and updated default configuration.


PR created automatically by Jules for task 9148402415438005509 started by @KacperSynator

- Map "Brake (calculated)" from telemetry CSV to `TelemetrySample`
- Add `get_brake_active` helper method based on a threshold > 0.5
- Add `ThrottleBarConfig` with `show_brake` flag (defaults to true)
- Update `ThrottleBar` to render a red brake indicator box directly over the green throttle bar when `show_brake` is enabled and brake is active
- Add a checkbox to `ThrottleBar`'s custom UI configuration panel
- Update `default_config.json` to enable `show_brake` for the `ThrottleBar` component
- Fix resulting build/test errors caused by adding new fields to `TelemetrySample`

Co-authored-by: KacperSynator <62207289+KacperSynator@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@codecov-commenter

codecov-commenter commented Sep 6, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 75.00000% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/overlay/throttle_bar.rs 74.50% 13 Missing ⚠️
src/telemetry.rs 66.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

- Map "Brake (calculated)" from telemetry CSV to `TelemetrySample`
- Add `get_brake_active` helper method based on a threshold > 0.5
- Add `ThrottleBarConfig` with `show_brake` flag (defaults to true)
- Update `ThrottleBar` to render a red brake indicator box directly over the green throttle bar when `show_brake` is enabled and brake is active
- Add a checkbox to `ThrottleBar`'s custom UI configuration panel
- Update `default_config.json` to enable `show_brake` for the `ThrottleBar` component
- Fix resulting build/test errors caused by adding new fields to `TelemetrySample`
- Fix failing sync benchmark caused by uninitialized brake value

Co-authored-by: KacperSynator <62207289+KacperSynator@users.noreply.github.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Benchmark

Details
Benchmark suite Current: 4385e54 Previous: 2db3e79 Ratio
pixel_copy_1080p/allocate_every_frame 826419 ns/iter (± 7082) 891477 ns/iter (± 2033) 0.93
pixel_copy_1080p/reuse_buffer 548846 ns/iter (± 4598) 570143 ns/iter (± 4619) 0.96
auto_correlate_gps_100_laps 1511775 ns/iter (± 30510) 1697048 ns/iter (± 33639) 0.89
auto_correlate_gps_lissajous_12min 65474665 ns/iter (± 731408) 74198241 ns/iter (± 362246) 0.88

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 3b170d0 Previous: 9a70126 Ratio
pixel_copy_1080p/allocate_every_frame 826155 ns/iter (± 6320) 333928 ns/iter (± 5584) 2.47
pixel_copy_1080p/reuse_buffer 540923 ns/iter (± 16608) 215977 ns/iter (± 11777) 2.50

This comment was automatically generated by workflow using github-action-benchmark.

Comment thread src/overlay/throttle_bar.rs
Comment thread src/overlay/throttle_bar.rs
google-labs-jules Bot and others added 2 commits September 7, 2026 19:26
Extracted the ui and skia logic into `draw_brake_ui` and `draw_brake_skia` methods.

Co-authored-by: KacperSynator <62207289+KacperSynator@users.noreply.github.com>
Extracted the ui and skia logic into `draw_brake_ui` and `draw_brake_skia` methods. Passed `painter` by reference instead of by value.

Co-authored-by: KacperSynator <62207289+KacperSynator@users.noreply.github.com>
@KacperSynator
KacperSynator merged commit bdf8662 into main Sep 7, 2026
5 checks passed
@KacperSynator
KacperSynator deleted the add-brake-indicator-9148402415438005509 branch September 7, 2026 20:26
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.

2 participants