Repository navigation
fix(headless): repair WebUI Navigator & serial mirror rendering under USE_DUMMY_TFT - #3114
Merged
Merged
Conversation
Author
|
Thanks for reviewing and merging, @bmorcelli! ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Follow-up to #3095. After closing #3095, I tested both the official
1.17release and the latestdev(fa6bcbf) on my headless ESP32-S3-WROOM-1 (N16R8). While boot/BLE fixes in1.17+worked, the WebUIDevice Navigatorand Companion App serial mirroring still suffered from severe rendering corruption underUSE_DUMMY_TFT=1:Channel Analyzercut toChannel Anal).drawOptions()menus (such as theRun in background / Exitprompt) overlapped vertically in a ~4px stack.drawSubmenu()cards lost text centering, drew solid black boxes across rounded borders, and wiped half of the screen when scrolling.MainMenucarousel/grid frames randomly disappeared or turned black due to ring-buffer wraparound and Z-order corruption.Root Causes & Fixes (4 files):
Fix inverted virtual panel dimensions (
boards/ESP-General/ESP-General.ini)esp32-s3-devkitc-1set-DROTATION=1withoutTFT_WIDTH/TFT_HEIGHT, falling back toprecompiler_flags.h(240x135), whichDisplayDrivers(dummy.h) andsrc/main.cppswapped on odd rotation into a narrow135x240portrait canvas.-DTFT_WIDTH=240and-DTFT_HEIGHT=320with-DROTATION=1produces the standard320x240landscape canvas.Fix virtual cursor & 1-arg transparent
setTextColorunderUSE_DUMMY_TFT(include/tftLogger.h,src/core/tftLogger/tftLogger.cpp)dummy.h'sprint()/println()never advances_cursorX/_cursorY, causingdrawOptions()andsetPadCursor()lines to stack every4px. Added cursor/newline tracking insidetft_logger::print()guarded by#ifdef USE_DUMMY_TFT(physical display backends are untouched).dummy.h's 1-argsetTextColor(c)leaves_textBgColorstale instead of transparent (c, c). ForwardedsetTextColor(c)to(c, c)under#ifdef USE_DUMMY_TFT.Fix rect-invalidation height bug & text datum alignment (
src/core/tftLogger/tftLogger.cpp)log_drawString()andlog_print()both multiplied the cleanup rectangle height bys.length()(s.length() * LH * currentTextSize()), wiping large portions of the screen below every label. Fixed both to use single-lineLH * currentTextSize()and adjusted horizontal cleanup bounds for centered/right-aligned strings.getTextDatum()(ML_DATUM,TC_DATUM,MC_DATUM, etc.) inlog_drawString()sodrawSubmenu()labels center properly inside rounded cards instead of shifting down across the bottom border.Fix ring-buffer replay order, Z-order & PSRAM log capacity (
include/tftLogger.h,src/core/tftLogger/tftLogger.cpp)logWriteIndexandlogCountfromuint8_ttouint16_tand raised PSRAMMAX_LOG_ENTRIESfrom64to256(keepingasyncSerialQueuecapped at64to avoid extra internal SRAM usage).getBinLog()to replay entries in chronological ring-buffer order rather than raw index0..logCount-1.pushLogIfUnique()to invalidate stale older duplicates and append at the tail so Z-order remains accurate across partial redraws.Fix WebUI Canvas text transparency &
SCREEN_INFOswitch fallthrough (embedded_resources/web_interface/index.js)break;incase 99 (SCREEN_INFO)so it does not fall through intocase 0 (FILLSCREEN)withinput.fg === undefined.input.bg === input.fgas transparent text instead of forcinginput.bg = 0(which painted black boxes over highlight bars and card borders), used measured text width for opaque text backgrounds, properly stripped actual\ncharacters, and roundedcolor565toCSSRGB channels.Visual Comparison (Before vs After)
dev)1. WebUI
Device NavigatorBefore (
devfa6bcbf):webui_dev.mp4
After (This PR):
webui_fix.mp4
2. Companion App (OTG Serial Mirror)
Before (
devfa6bcbf):APP_dev.mp4
After (This PR):
APP_fixed.mp4
Types of Changes
Verification
esp32-s3-devkitc-1-psram), tested standalone AP boot:Device Navigator: Main menu carousel,Run in background / Exit(drawOptions), Bluetooth/WiFi submenus (drawSubmenu), BLE Spam parameter screen, and scrolling redraws all render cleanly with proper highlights and spacing.pio run -e esp32-s3-devkitc-1-psram(PSRAM headless) — PASSpio run -e esp32-s3-devkitc-1(non-PSRAM headless) — PASSpio run -e m5stack-cplus2(physical TFT backend) — PASSTesting
Verified manually on real ESP32-S3 N16R8 hardware and via multi-target PlatformIO compilation (
esp32-s3-devkitc-1-psram,esp32-s3-devkitc-1,m5stack-cplus2).Linked Issues
Follow-up to #3095
User-Facing Change
Further Comments
Hi @bmorcelli, following up on my promise in #3095 — I tested both
1.17and latestdevon my headless ESP32-S3 N16R8 and tracked down the exact root causes behind the distorted WebUI Navigator & mirror rendering. All headless cursor/color workarounds are isolated under#ifdef USE_DUMMY_TFTso physical-display boards remain unaffected. Happy to adjust anything if needed!