Skip to content

refactor: add graphical viewport context to MenuScreen#409

Merged
forntoh merged 2 commits into
feat/graphical-displayfrom
gd/04-menu-screen-graphical-context
Apr 24, 2026
Merged

refactor: add graphical viewport context to MenuScreen#409
forntoh merged 2 commits into
feat/graphical-displayfrom
gd/04-menu-screen-graphical-context

Conversation

@forntoh
Copy link
Copy Markdown
Owner

@forntoh forntoh commented Apr 23, 2026

Summary

  • teach MenuScreen to populate optional GraphicalRendererContext state (viewport, active item, value-area width) before drawing and polling
  • clamp cursor/view using dynamic getMaxRows() / getMaxCols() so graphical font changes cannot desync visible ranges
  • preserve draw-owned frame lifecycle (beginFrame/endFrame) while keeping poll flush behavior unchanged in LcdMenu
  • update unit tests for the new clamped-view behavior and add docs note under graphical renderer integration

Summary by CodeRabbit

  • New Features

    • Menu now properly integrates with graphical renderers, providing correct viewport context and accounting for varying font sizes across menu items.
    • Improved menu navigation to properly handle non-selectable items and adjust view positioning.
  • Bug Fixes

    • Enhanced cursor bounds checking and viewport recalculation logic.
  • Documentation

    • Added documentation explaining Menu integration with graphical display renderers.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e7987d0c-a6d5-4ef5-8dbf-eeace1511466

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gd/04-menu-screen-graphical-context

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

Memory usage change @ e6dbb99

Board flash % RAM for global variables %
STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8 🔺 +788 - +1096 +1.2 - +1.67 0 - 0 0.0 - 0.0
arduino:avr:uno 🔺 +1242 - +1688 +3.85 - +5.23 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 🔺 +828 - +1120 +0.32 - +0.43 0 - 0 0.0 - 0.0
esp32:esp32:esp32 🔺 +928 - +1272 +0.07 - +0.1 0 - 0 0.0 - 0.0
esp8266:esp8266:huzzah N/A N/A N/A N/A
Click for full report table
Board examples/Basic
flash
% examples/Basic
RAM for global variables
% examples/ButtonAdapter
flash
% examples/ButtonAdapter
RAM for global variables
% examples/Callbacks
flash
% examples/Callbacks
RAM for global variables
% examples/InputRotary
flash
% examples/InputRotary
RAM for global variables
% examples/IntFloatValues
flash
% examples/IntFloatValues
RAM for global variables
% examples/KeyboardAdapter
flash
% examples/KeyboardAdapter
RAM for global variables
% examples/List
flash
% examples/List
RAM for global variables
% examples/SimpleRotary
flash
% examples/SimpleRotary
RAM for global variables
% examples/SSD1803A_I2C
flash
% examples/SSD1803A_I2C
RAM for global variables
% examples/UseByRef
flash
% examples/UseByRef
RAM for global variables
% examples/DynamicMenu
flash
% examples/DynamicMenu
RAM for global variables
% examples/Widgets
flash
% examples/Widgets
RAM for global variables
% examples/RTOS
flash
% examples/RTOS
RAM for global variables
% examples/ST7920_SPI
flash
% examples/ST7920_SPI
RAM for global variables
%
STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8 792 1.21 0 0.0 792 1.21 0 0.0 792 1.21 0 0.0 792 1.21 0 0.0 792 1.21 0 0.0 792 1.21 0 0.0 792 1.21 0 0.0 792 1.21 0 0.0 792 1.21 0 0.0 1096 1.67 0 0.0 788 1.2 0 0.0 792 1.21 0 0.0
arduino:avr:uno 1262 3.91 0 0.0 1262 3.91 0 0.0 1262 3.91 0 0.0 1242 3.85 0 0.0 1262 3.91 0 0.0 1262 3.91 0 0.0 1262 3.91 0 0.0 1242 3.85 0 0.0 1262 3.91 0 0.0 1662 5.15 0 0.0 1262 3.91 0 0.0 1262 3.91 0 0.0 1688 5.23 0 0.0
arduino:samd:mkr1000 828 0.32 0 0.0 828 0.32 0 0.0 828 0.32 0 0.0 828 0.32 0 0.0 828 0.32 0 0.0 828 0.32 0 0.0 828 0.32 0 0.0 828 0.32 0 0.0 828 0.32 0 0.0 1120 0.43 0 0.0 828 0.32 0 0.0 828 0.32 0 0.0
esp32:esp32:esp32 928 0.07 0 0.0 928 0.07 0 0.0 928 0.07 0 0.0 928 0.07 0 0.0 928 0.07 0 0.0 928 0.07 0 0.0 928 0.07 0 0.0 928 0.07 0 0.0 928 0.07 0 0.0 1272 0.1 0 0.0 932 0.07 0 0.0 928 0.07 0 0.0 1272 0.1 0 0.0 928 0.07 0 0.0
esp8266:esp8266:huzzah N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
Click for full report CSV
Board,examples/Basic<br>flash,%,examples/Basic<br>RAM for global variables,%,examples/ButtonAdapter<br>flash,%,examples/ButtonAdapter<br>RAM for global variables,%,examples/Callbacks<br>flash,%,examples/Callbacks<br>RAM for global variables,%,examples/InputRotary<br>flash,%,examples/InputRotary<br>RAM for global variables,%,examples/IntFloatValues<br>flash,%,examples/IntFloatValues<br>RAM for global variables,%,examples/KeyboardAdapter<br>flash,%,examples/KeyboardAdapter<br>RAM for global variables,%,examples/List<br>flash,%,examples/List<br>RAM for global variables,%,examples/SimpleRotary<br>flash,%,examples/SimpleRotary<br>RAM for global variables,%,examples/SSD1803A_I2C<br>flash,%,examples/SSD1803A_I2C<br>RAM for global variables,%,examples/UseByRef<br>flash,%,examples/UseByRef<br>RAM for global variables,%,examples/DynamicMenu<br>flash,%,examples/DynamicMenu<br>RAM for global variables,%,examples/Widgets<br>flash,%,examples/Widgets<br>RAM for global variables,%,examples/RTOS<br>flash,%,examples/RTOS<br>RAM for global variables,%,examples/ST7920_SPI<br>flash,%,examples/ST7920_SPI<br>RAM for global variables,%
STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8,792,1.21,0,0.0,792,1.21,0,0.0,792,1.21,0,0.0,792,1.21,0,0.0,792,1.21,0,0.0,792,1.21,0,0.0,792,1.21,0,0.0,792,1.21,0,0.0,792,1.21,0,0.0,1096,1.67,0,0.0,788,1.2,0,0.0,792,1.21,0,0.0
arduino:avr:uno,1262,3.91,0,0.0,1262,3.91,0,0.0,1262,3.91,0,0.0,1242,3.85,0,0.0,1262,3.91,0,0.0,1262,3.91,0,0.0,1262,3.91,0,0.0,1242,3.85,0,0.0,1262,3.91,0,0.0,1662,5.15,0,0.0,1262,3.91,0,0.0,1262,3.91,0,0.0,1688,5.23,0,0.0
arduino:samd:mkr1000,828,0.32,0,0.0,828,0.32,0,0.0,828,0.32,0,0.0,828,0.32,0,0.0,828,0.32,0,0.0,828,0.32,0,0.0,828,0.32,0,0.0,828,0.32,0,0.0,828,0.32,0,0.0,1120,0.43,0,0.0,828,0.32,0,0.0,828,0.32,0,0.0,,,,
esp32:esp32:esp32,928,0.07,0,0.0,928,0.07,0,0.0,928,0.07,0,0.0,928,0.07,0,0.0,928,0.07,0,0.0,928,0.07,0,0.0,928,0.07,0,0.0,928,0.07,0,0.0,928,0.07,0,0.0,1272,0.1,0,0.0,932,0.07,0,0.0,928,0.07,0,0.0,1272,0.1,0,0.0,928,0.07,0,0.0
esp8266:esp8266:huzzah,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,,,,,,,,

@coderabbitai coderabbitai Bot added documentation Improvements or additions to documentation feature New feature labels Apr 24, 2026
coderabbitai[bot]

This comment was marked as resolved.

@forntoh forntoh merged commit 4f9d9b2 into feat/graphical-display Apr 24, 2026
13 of 17 checks passed
@forntoh forntoh deleted the gd/04-menu-screen-graphical-context branch April 24, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant