Skip to content

BaseUI: Emote Refactoring#9896

Merged
Xaositek merged 3 commits into
developfrom
EmoteCleanup
Mar 18, 2026
Merged

BaseUI: Emote Refactoring#9896
Xaositek merged 3 commits into
developfrom
EmoteCleanup

Conversation

@HarukiToreda

Copy link
Copy Markdown
Contributor

This cleanup makes emote rendering work consistently across the UI while reducing duplicate code, extra processing, and overall flash size. Node name with Emotes now render correctly if the emote exists across the whole UI.

T114 Before Cleanup
RAM: [==== ] 44.4% (used 110464 bytes from 248832 bytes)
Flash: [========= ] 88.1% (used 718400 bytes from 815104 bytes)

T114 After Cleanup
RAM: [==== ] 44.4% (used 110408 bytes from 248832 bytes)
Flash: [========= ] 88.0% (used 717360 bytes from 815104 bytes)

20260313_022732
20260313_022757
20260313_022434
20260313_022448

@HarukiToreda HarukiToreda requested a review from Xaositek March 13, 2026 06:36
@HarukiToreda HarukiToreda self-assigned this Mar 13, 2026
@HarukiToreda HarukiToreda added enhancement New feature or request baseui Issues directly related to BaseUI cleanup Code cleanup or refactor labels Mar 13, 2026

@Xaositek Xaositek left a comment

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.

Haven't found any regressions yet! Looks solid!

Copilot AI left a comment

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.

Pull request overview

Refactors BaseUI text rendering to support inline emotes consistently across multiple screens while reducing duplicated parsing/wrapping logic and flash usage.

Changes:

  • Introduces graphics::EmoteRenderer for emote-aware measuring, truncation, and drawing (with modifier-tolerant matching).
  • Adds UIRenderer wrappers (measure/truncate/drawStringWithEmotes) and updates several UI surfaces to use them.
  • Reworks canned message and message-thread rendering paths to remove bespoke tokenization/wrapping and rely on shared helpers.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/modules/CannedMessageModule.cpp Replaces local emote tokenization/rendering with shared emote-aware truncation/drawing and adds emote-safe wrapping helpers for freetext.
src/graphics/draw/UIRenderer.h Declares shared BaseUI emote helper APIs (measure/truncate/draw).
src/graphics/draw/UIRenderer.cpp Implements the UIRenderer emote helper wrappers and updates multiple UI call sites to use them.
src/graphics/draw/NotificationRenderer.cpp Updates node picker rendering to truncate/measure/draw with emotes.
src/graphics/draw/NodeListRenderer.h Changes getSafeNodeName to return std::string to preserve UTF-8/emotes.
src/graphics/draw/NodeListRenderer.cpp Uses emote-aware truncation/drawing for node list entries; updates name handling.
src/graphics/draw/MessageRenderer.cpp Centralizes emote rendering via EmoteRenderer for thread UI; updates header measurement/truncation.
src/graphics/SharedUIDisplay.cpp Centers header titles using emote-aware measurement and drawing.
src/graphics/EmoteRenderer.h Adds new emote rendering/measuring/truncation API and metrics helpers.
src/graphics/EmoteRenderer.cpp Implements shared emote-aware parsing/rendering, including handling FE0F and skin-tone modifiers.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/graphics/draw/NotificationRenderer.cpp
Comment thread src/graphics/draw/NotificationRenderer.cpp
Comment thread src/graphics/draw/NotificationRenderer.cpp
Comment thread src/graphics/draw/MessageRenderer.cpp
Comment thread src/graphics/draw/NodeListRenderer.cpp Outdated
@Xaositek Xaositek merged commit 2ef09d1 into develop Mar 18, 2026
77 checks passed
@Xaositek Xaositek deleted the EmoteCleanup branch March 18, 2026 01:42
thebentern pushed a commit that referenced this pull request Mar 19, 2026
* Emote refactor for BaseUI

* Trunk Check

* Copilot suggestions
andmadeira pushed a commit to andmadeira/meshtastic-firmware that referenced this pull request Mar 19, 2026
* Emote refactor for BaseUI

* Trunk Check

* Copilot suggestions
jeek pushed a commit to jeek/Meshtastic-Exploiteers-Hacker-Pager that referenced this pull request Jun 30, 2026
* Emote refactor for BaseUI

* Trunk Check

* Copilot suggestions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

baseui Issues directly related to BaseUI cleanup Code cleanup or refactor enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants