Test appplication for offdevice testing
This commit is contained in:
@@ -107,16 +107,25 @@ class NavigationOverlay(OverlaySubApplication):
|
||||
Returns:
|
||||
GestureResponse with appropriate action
|
||||
"""
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.info(f"[NAV_OVERLAY] Handling tap at ({x}, {y})")
|
||||
logger.info(f"[NAV_OVERLAY] Panel offset: {self._overlay_panel_offset}, Panel size: {self._panel_size}")
|
||||
|
||||
# Query the overlay to see what was tapped
|
||||
query_result = self.query_overlay_pixel(x, y)
|
||||
|
||||
# If query failed (tap outside overlay), close it
|
||||
if not query_result:
|
||||
logger.info(f"[NAV_OVERLAY] Query result: {query_result}")
|
||||
|
||||
# If query failed (tap outside overlay panel), close it
|
||||
if query_result is None:
|
||||
logger.info(f"[NAV_OVERLAY] Tap outside overlay panel, closing")
|
||||
return GestureResponse(ActionType.OVERLAY_CLOSED, {})
|
||||
|
||||
# Check if tapped on a link
|
||||
if query_result.get("is_interactive") and query_result.get("link_target"):
|
||||
link_target = query_result["link_target"]
|
||||
logger.info(f"[NAV_OVERLAY] Found interactive link: {link_target}")
|
||||
|
||||
# Parse "tab:tabname" format for tab switching
|
||||
if link_target.startswith("tab:"):
|
||||
@@ -168,10 +177,12 @@ class NavigationOverlay(OverlaySubApplication):
|
||||
elif link_target.startswith("action:"):
|
||||
action = link_target.split(":", 1)[1]
|
||||
if action == "close":
|
||||
logger.info(f"[NAV_OVERLAY] Close button clicked")
|
||||
return GestureResponse(ActionType.OVERLAY_CLOSED, {})
|
||||
|
||||
# Not an interactive element, close overlay
|
||||
return GestureResponse(ActionType.OVERLAY_CLOSED, {})
|
||||
# Tap inside overlay but not on interactive element - keep overlay open
|
||||
logger.info(f"[NAV_OVERLAY] Tap on non-interactive area inside overlay, ignoring")
|
||||
return GestureResponse(ActionType.NONE, {})
|
||||
|
||||
def switch_tab(self, new_tab: str) -> Optional[Image.Image]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user