Skip to content

e-paper UX improvements - #672

Open
KenVanHoeylandt wants to merge 1 commit into
mainfrom
develop
Open

KenVanHoeylandt wants to merge 1 commit into
mainfrom
develop

Conversation

@KenVanHoeylandt

@KenVanHoeylandt KenVanHoeylandt commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Visual Improvements
    • On monochrome displays, buttons retain borders when pressed and focus outlines remain visible.
    • App grid tiles preserve theme focus outlines and icon colors on monochrome displays.
    • Tile labels use a consistent height while retaining dot truncation.
    • Existing color and focus behavior remains unchanged on non-monochrome displays.

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

📝 Walkthrough

Walkthrough

When mono themes are enabled, the display module extends the active theme to remove the default button border. AppGrid detects 1-bit monochrome displays and adjusts tile outlines, icon colors, focus handlers, and label sizing based on the display type.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 33e96

On builds that enable mono-theme support, color displays may lose default button borders. This is a small visual regression, and the fix is a small localized change.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 33e96

The change affects screen appearance rather than privileges or data access. Remaining uncertainty concerns how display settings behave when multiple screens are initialized or replaced.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated effect is local display presentation: the extension can affect buttons throughout displays that receive it, rather than only AppGrid tiles. The inspected changes do not establish a path to additional service, credential or data-store authority.

Trust Boundaries and Controls

  • observed — The new branch reads the grid's display color format. It does not use application names or callback data to grant authority, and existing actionable event registrations remain unchanged; only visual focus handlers are conditional.

Resilience and Maintainability Implications

  • observed — Visible allocation and display-creation failures return before theme installation. Display removal frees owned resources but does not reset the static extension. The source therefore does not establish parent-theme cleanup or serialization across display replacement.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is broad, but it describes the e-paper user-experience changes in the display theme and app grid.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e3a6c1f0-b8cc-4d18-96db-28fe04710a3a
📥 Commits

Reviewing files that changed from the base of the PR and between 2b6b4b5 and 33e96bb.

📒 Files selected for processing (2)
  • Modules/lvgl-module/source/devices/display.cpp
  • Tactility/Source/app/AppGrid.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

}

#if LV_USE_THEME_MONO
lvgl_display_extend_mono_theme(disp);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n 1,70p Modules/lvgl-module/source/devices/display.cpp; sed -n 490,520p Modules/lvgl-module/source/devices/display.cpp; rg -n 'LV_USE_THEME_MONO|LV_USE_THEME_DEFAULT' --glob '*.h' --glob '*.txt' --glob '*.cmake' . | head -30

Repository: TactilityProject/Tactility

Length of output: 4045


🏁 Script executed:

printf '%s\n' '--- tracked LVGL/theme files ---'
git ls-files | rg '(^|/)(lvgl|lv_conf|theme|display)\.(c|h|cpp)$|lvgl/.+(display|theme)|theme_.+\.c$' | head -100
printf '%s\n' '--- theme init and default theme references ---'
rg -n 'lv_theme_(default|mono)_init|lv_display_set_theme|lv_display_get_theme|lv_display_create|LV_USE_THEME_MONO|LV_USE_THEME_DEFAULT|LV_COLOR_DEPTH' --glob '*.[ch]' --glob '*.cpp' --glob '*.cmake' --glob '*.txt' Modules lv_conf.h | head -160

Repository: TactilityProject/Tactility

Length of output: 1197


🏁 Script executed:

printf '%s\n' '--- lvgl module source ---'
sed -n '1,220p' Modules/lvgl-module/source/lvgl.c
printf '%s\n' '--- relevant tracked build/dependency files ---'
git ls-files | rg '(^|/)(CMakeLists\\.txt|idf_component\\.yml|component\\.yml|Kconfig|manifest\\.yml|west\\.yml|.*lock.*|.*lvgl.*)$' | head -100
printf '%s\n' '--- LVGL setup/dependency references ---'
rg -n -i 'lvgl|theme_default_init|theme_mono_init|lv_init\\(' CMakeLists.txt Modules components idf_component.yml 2>/dev/null | head -180

Repository: TactilityProject/Tactility

Length of output: 4958


🏁 Script executed:

printf '%s\n' '--- dependency and guidance ---'
git submodule status -- Libraries/lvgl
sed -n '1,180p' Modules/lvgl-module/CMakeLists.txt
sed -n '1,220p' .claude/rules/lvgl.md
printf '%s\n' '--- LVGL tracked theme/display files ---'
git -C Libraries/lvgl ls-files | rg '(^|/)(lv_display|lv_theme|theme|display).*\.(c|h)$' | head -120
printf '%s\n' '--- LVGL version/config references ---'
git -C Libraries/lvgl describe --tags --always --dirty 2>/dev/null || true
rg -n 'lv_display_create|lv_display_set_color_format|lv_theme_default_init|lv_theme_mono_init|LV_USE_THEME_MONO|LV_USE_THEME_DEFAULT|lv_display_get_theme|lv_display_set_theme' Libraries/lvgl/src Libraries/lvgl 2>/dev/null | head -220

Repository: TactilityProject/Tactility

Length of output: 7434


🏁 Script executed:

printf '%s\n' '--- submodule metadata ---'
git ls-files .gitmodules
cat .gitmodules 2>/dev/null
git ls-tree HEAD Libraries/lvgl
git ls-tree 2b6b4b5167ff0795f720f724f6f378fcb8c7e2b7 Libraries/lvgl
printf '%s\n' '--- available submodule metadata files ---'
find Libraries/lvgl -maxdepth 2 -type f -print 2>/dev/null | head -40
printf '%s\n' '--- LVGL commit object availability ---'
git cat-file -t e9db313f8ccc07e27f6afd0f34fe3cf6f20596f0 2>/dev/null || true

Repository: TactilityProject/Tactility

Length of output: 1083


🌐 Web query:

LVGL e9db313f8ccc07e27f6afd0f34fe3cf6f20596f0 lv_display_create theme color format

💡 Result:

At commit `e9db313f8ccc07e27f6afd0f34fe3cf6f20596f0`:

- **Color format:** `lv_display_create()` initializes the display’s format to `LV_COLOR_FORMAT_NATIVE` (not `LV_COLOR_FORMAT_DEFAULT`). You can change it afterward with `lv_display_set_color_format(disp, format)`. ([github.com](https://github.com/lvgl/lvgl/blob/e9db313f8ccc07e27f6afd0f34fe3cf6f20596f0/src/display/lv_display.c))
- **Theme:** If `LV_USE_THEME_DEFAULT` is enabled and no default theme exists yet, creation initializes it with **blue primary**, **red secondary**, `LV_THEME_DEFAULT_DARK`, and `LV_FONT_DEFAULT`. Otherwise it reuses the existing default theme. Simple and mono themes have their own conditional initialization paths. ([github.com](https://github.com/lvgl/lvgl/blob/e9db313f8ccc07e27f6afd0f34fe3cf6f20596f0/src/display/lv_display.c))

So, the theme colors are initialization defaults; the display color format is set independently.

Citations:

- 1: https://github.com/lvgl/lvgl/blob/e9db313f8ccc07e27f6afd0f34fe3cf6f20596f0/src/display/lv_display.c
- 2: https://github.com/lvgl/lvgl/blob/e9db313f8ccc07e27f6afd0f34fe3cf6f20596f0/src/display/lv_display.c

🌐 Web query:

site:github.com/lvgl/lvgl/blob/e9db313f8ccc07e27f6afd0f34fe3cf6f20596f0/src/display/lv_display.c "lv_theme_mono_init" "lv_theme_default_init" "lv_display_create"

💡 Result:

At the matching path and commit, `lv_display_create()` initializes **one** theme, selected at compile time: default, simple, or mono. It calls the corresponding `*_init()` only if that theme is not already initialized; otherwise it uses `*_get()`. So `lv_theme_mono_init()` and `lv_theme_default_init()` are alternatives, not both called by the same creation path. ([github.com](https://github.com/lvgl/lvgl/blob/master/src/display/lv_display.c?utm_source=openai))

The search result is GitHub’s **`master`** view, not a confirmed rendering of commit `e9db313f8ccc07e27f6afd0f34fe3cf6f20596f0`; the exact commit’s contents remain unverified. ([github.com](https://github.com/lvgl/lvgl/blob/master/src/display/lv_display.c?utm_source=openai))

Citations:

- 1: https://github.com/lvgl/lvgl/blob/master/src/display/lv_display.c?utm_source=openai
- 2: https://github.com/lvgl/lvgl/blob/master/src/display/lv_display.c?utm_source=openai

🌐 Web query:

raw.githubusercontent.com/lvgl/lvgl/e9db313f8ccc07e27f6afd0f34fe3cf6f20596f0/src/display/lv_display.c lv_theme_mono_init lv_theme_default_init

💡 Result:

At commit `e9db313f8ccc07e27f6afd0f34fe3cf6f20596f0`, `lv_display.c` calls one theme initializer depending on compile-time configuration:

- If `LV_USE_THEME_DEFAULT` is enabled, it initializes the default theme with blue/red palette colors, `LV_THEME_DEFAULT_DARK`, and `LV_FONT_DEFAULT`; otherwise it reuses the existing default theme.
- If `LV_USE_THEME_MONO` is enabled instead, it initializes the mono theme with `dark_bg = false` and `LV_FONT_DEFAULT`; otherwise it reuses the existing mono theme. ([raw.githubusercontent.com](https://raw.githubusercontent.com/lvgl/lvgl/e9db313f8ccc07e27f6afd0f34fe3cf6f20596f0/src/display/lv_display.c))

The initializers are implemented in separate files, not `lv_display.c`: [`lv_theme_mono_init`](https://raw.githubusercontent.com/lvgl/lvgl/e9db313f8ccc07e27f6afd0f34fe3cf6f20596f0/src/themes/mono/lv_theme_mono.c) sets up the mono theme and its styles; [`lv_theme_default_init`](https://raw.githubusercontent.com/lvgl/lvgl/e9db313f8ccc07e27f6afd0f34fe3cf6f20596f0/src/themes/default/lv_theme_default.c) configures the default theme’s display, colors, fonts, and styles. ([raw.githubusercontent.com](https://raw.githubusercontent.com/lvgl/lvgl/e9db313f8ccc07e27f6afd0f34fe3cf6f20596f0/src/themes/mono/lv_theme_mono.c))

Citations:

- 1: https://raw.githubusercontent.com/lvgl/lvgl/e9db313f8ccc07e27f6afd0f34fe3cf6f20596f0/src/display/lv_display.c
- 2: https://raw.githubusercontent.com/lvgl/lvgl/e9db313f8ccc07e27f6afd0f34fe3cf6f20596f0/src/themes/mono/lv_theme_mono.c

🏁 Script executed:

printf '%s\n' '--- display API and implementation ---'
rg -n 'lvgl_display_add|lv_display_set_color_format|lv_color_format_t|LV_COLOR_FORMAT_' Modules/lvgl-module/include/lvgl/devices/display.h Modules/lvgl-module/source/devices/display.cpp | head -140
sed -n '1,180p' Modules/lvgl-module/include/lvgl/devices/display.h
sed -n '430,525p' Modules/lvgl-module/source/devices/display.cpp
printf '%s\n' '--- display-add call sites ---'
rg -n 'lvgl_display_add\\(' --glob '*.[ch]' --glob '*.cpp' . | head -100

Repository: TactilityProject/Tactility

Length of output: 10815


Apply the border override only to monochrome displays.

LV_USE_THEME_MONO does not guarantee that lv_display_create() selects the mono theme. LVGL can select the default theme instead. The current call wraps whichever theme is active and sets button borders to zero. Because the call occurs before lv_display_set_color_format(), it can change buttons on color displays.

Set the color format first, then apply the extension only for LV_COLOR_FORMAT_I1.

Suggested fix
-#if LV_USE_THEME_MONO
-    lvgl_display_extend_mono_theme(disp);
-#endif
-
     ctx->render_mode = render_mode;
     lv_display_set_color_format(disp, lv_color_format);
+#if LV_USE_THEME_MONO
+    if (lv_color_format == LV_COLOR_FORMAT_I1) {
+        lvgl_display_extend_mono_theme(disp);
+    }
+#endif

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.

1 participant