-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't workingdebugDebugging and development featuresDebugging and development featuresenhancementNew feature or requestNew feature or request
Description
Debug Tapping Not Always Reliable
Problem
The debug tap-to-navigate features (DEBUG_QR_TAP_TO_POUR, DEBUG_POURING_TAP_TO_FINISHED, DEBUG_FINISHED_TAP_TO_QR) are not always reliable. Tapping on screens sometimes doesn't trigger the expected transitions.
Affected Features
- QR Code Screen → Pouring Screen:
DEBUG_QR_TAP_TO_POUR - Pouring Screen → Finished Screen:
DEBUG_POURING_TAP_TO_FINISHED - Finished Screen → QR Code Screen:
DEBUG_FINISHED_TAP_TO_QR
Symptoms
- Tapping on QR code doesn't always transition to pouring screen
- Tapping on pouring screen doesn't always transition to finished screen
- Tapping on finished screen doesn't always transition to QR code screen
- Sometimes requires multiple taps to trigger transition
- Touch events may be logged but transitions don't occur
Current Implementation
- QR code screen uses
lv_obj_hit_test()and fallback logic for content area clicks - Pouring screen uses screen-level touch handler
- Finished screen uses screen-level touch handler
- All use
LV_EVENT_CLICKEDevent
Possible Causes
- Touch event timing: Events may be missed during screen transitions or LVGL rendering
- Object hierarchy: Touch events may be captured by child objects before reaching screen handler
- LVGL event propagation: Events may not propagate correctly through the object tree
- Coordinate space issues: Touch coordinates may not match object bounds correctly
- Race conditions: Screen cleanup/initialization may interfere with touch handling
- Event handler registration: Handlers may not be registered at the right time or on the right objects
Expected Behavior
- Single tap should reliably trigger screen transition when debug option is enabled
- Touch should work consistently across all debug-enabled screens
- No need for multiple taps or specific tap locations
Steps to Reproduce
- Enable debug options via
idf.py menuconfig:DEBUG_QR_TAP_TO_POUR=yDEBUG_POURING_TAP_TO_FINISHED=yDEBUG_FINISHED_TAP_TO_QR=y
- Build and flash firmware
- Navigate to QR code screen
- Tap on QR code - may require multiple taps
- Navigate to pouring screen (via tap or MQTT)
- Tap on pouring screen - may require multiple taps
- Navigate to finished screen (via tap or max volume)
- Tap on finished screen - may require multiple taps
Investigation Needed
- Review touch event handling in each screen
- Check if touch events are being captured by child objects
- Verify event handler registration timing
- Test with different touch coordinates and pressures
- Check for conflicts with base screen touch handling
- Review LVGL event propagation behavior
- Consider using
LV_EVENT_PRESSEDorLV_EVENT_RELEASEDinstead ofLV_EVENT_CLICKED - Add more detailed logging for touch events
- Test touch handling during screen transitions
Potential Solutions
- Use
LV_EVENT_PRESSEDinstead ofLV_EVENT_CLICKEDfor more immediate response - Add touch event handlers to multiple objects (screen, content area, specific widgets)
- Implement touch debouncing or state tracking
- Ensure event handlers are registered after all objects are created
- Use
lv_obj_add_flag(obj, LV_OBJ_FLAG_CLICKABLE)explicitly on all touchable objects - Add touch event forwarding from child objects to parent
- Implement a unified touch handler system for all debug screens
Related Code
src/qr_code_screen.cpp- QR code touch handlersrc/pouring_screen.cpp- Pouring screen touch handlersrc/finished_screen.cpp- Finished screen touch handlersrc/base_screen.cpp- Base screen layout (may interfere with touch)
Priority
Medium - Debug feature, doesn't affect production functionality but impacts development/debugging workflow.
Labels
bugdebuguitouchenhancement
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdebugDebugging and development featuresDebugging and development featuresenhancementNew feature or requestNew feature or request