Skip to content

Add alerts pill#37821

Open
elkoled wants to merge 10 commits intomasterfrom
notes-pill
Open

Add alerts pill#37821
elkoled wants to merge 10 commits intomasterfrom
notes-pill

Conversation

@elkoled
Copy link
Copy Markdown
Contributor

@elkoled elkoled commented Apr 14, 2026

Show bell icon with notification count in a pill at the bottom-right corner when there are active offroad alerts.
The count is sourced from MiciOffroadAlerts.active_alerts().

notify

@github-actions github-actions bot added the ui label Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

Process replay diff report

Replays driving segments through this PR and compares the behavior to master.
Please review any changes carefully to ensure they are expected.

✅ 0 changed, 66 passed, 0 errors

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

UI Preview

mici: ⚠️ Videos differ! View Diff Report
big: ⚠️ Videos differ! View Diff Report

@elkoled elkoled marked this pull request as ready for review April 14, 2026 05:32
@elkoled elkoled changed the title Add notification pill Add alerts pill Apr 14, 2026
rl.draw_texture_ex(self._bell_txt, rl.Vector2(bell_x, bell_y), 0.0, 1.0, rl.WHITE)

count_rect = rl.Rectangle(pill_x, pill_y, pill_w - 20, pill_h)
gui_label(count_rect, str(alert_count), font_size=36, color=rl.WHITE,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Prefer UnifiedLabel and WIdgets in general if content is expected to be laid out, for example, can't add this to HorizontalLayout class in the future

Comment on lines +72 to +73
def _update_state(self):
self._alerts_layout._update_state()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why is it not updating state? how does it normally work? oh it's out of view. this will double run it when in view. and make sure to call super() _update state

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can make alerts a singleton in the future

Comment on lines +107 to +110
# alerts pill
self._pill_bg_txt = gui_app.texture("icons_mici/alerts_pill.png", 104, 52)
self._bell_txt = gui_app.texture("icons_mici/alerts_bell.png", 28, 30)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

class self contains all this and allows you to use it anywhere if needed later

Copy link
Copy Markdown
Contributor

@sshane sshane left a comment

Choose a reason for hiding this comment

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

Looks close with double digit alerts, LGTM if @nickorie approves

image

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.

2 participants