Skip to content

ui: fix value text eliding when it fits - #38502

Merged
adeebshihadeh merged 4 commits into
commaai:masterfrom
mpurnell1:ui-value-elide-fix
Aug 7, 2026
Merged

ui: fix value text eliding when it fits#38502
adeebshihadeh merged 4 commits into
commaai:masterfrom
mpurnell1:ui-value-elide-fix

Conversation

@mpurnell1

@mpurnell1 mpurnell1 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Note

This branch temporarily includes the CI fix from #38514 so the Create UI Report job can run on fork PRs

Description
While checking for updates on my comma, I noticed the software panel showed checkin... instead of checking.... The last character is being eaten by gui_label's eliding: ButtonAction.get_width_hint() sizes the value label to exactly fit the measured text, and that width gets rounded when stored as float32 in rl.Rectangle. When it rounds down, the label rect comes out a fraction of a pixel too narrow, so the elide logic chops a whole character and appends ....

Whether a given string trips this depends on its exact measured width. On current master, checking... happens to survive the rounding, but downloading... renders as downloadin... and a target branch of nightly renders as nightl.... Rounding the width hint up to a whole pixel makes it exactly representable in float32, so the label rect can never come out narrower than the text it was sized for.

The first commit adds the updater checking... and downloading... states to the UI replay script, so they are covered by the UI report and the downloading... case will catch a regression here.

Verification
Software panel while the updater is downloading, before (frame from the UI report artifact):
before_downloadin

after:
after_downloading

@github-actions github-actions Bot added the ui label Jul 31, 2026
@mpurnell1
mpurnell1 force-pushed the ui-value-elide-fix branch 2 times, most recently from c9711bc to 37e3f66 Compare July 31, 2026 05:41
@github-actions

Copy link
Copy Markdown
Contributor

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

@mpurnell1
mpurnell1 force-pushed the ui-value-elide-fix branch 2 times, most recently from 51750f1 to 15667b5 Compare July 31, 2026 06:24
@mpurnell1
mpurnell1 marked this pull request as ready for review July 31, 2026 07:15
andiradulescu and others added 3 commits August 2, 2026 23:15
ButtonAction sizes the value label rect to exactly fit the measured text,
but the width gets rounded when stored as float32 in rl.Rectangle. When
it rounds down, the label comes out a fraction of a pixel too narrow and
gui_label cuts a whole character, rendering "downloading..." as
"downloadin..." and a "nightly" target branch as "nightl...".
@mpurnell1
mpurnell1 force-pushed the ui-value-elide-fix branch from 5e21352 to 4bd500c Compare August 3, 2026 04:26
@adeebshihadeh
adeebshihadeh merged commit faf966a into commaai:master Aug 7, 2026
9 of 11 checks passed
@mpurnell1
mpurnell1 deleted the ui-value-elide-fix branch August 7, 2026 17:40
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