fix(perception): detect bottom sheet modals structurally to prevent phantom interactions
This commit is contained in:
@@ -198,12 +198,16 @@ class ScreenIdentity:
|
||||
"next_button_textview",
|
||||
)
|
||||
browser_markers = ("ig_browser_text_title", "ig_browser_close_button", "ig_chrome_subsection")
|
||||
bottom_sheet_markers = ("bottom_sheet_container", "action_sheet_container")
|
||||
if not is_normal_override and any(marker in ids_str for marker in creation_flow_markers):
|
||||
logger.info("🛡️ [ScreenIdentity] Content-creation overlay detected → MODAL")
|
||||
return ScreenType.MODAL
|
||||
if not is_normal_override and any(marker in ids_str for marker in browser_markers):
|
||||
logger.info("🛡️ [ScreenIdentity] In-App Browser detected → MODAL")
|
||||
return ScreenType.MODAL
|
||||
if not is_normal_override and any(marker in ids_str for marker in bottom_sheet_markers):
|
||||
logger.info("🛡️ [ScreenIdentity] Bottom Sheet Modal detected → MODAL")
|
||||
return ScreenType.MODAL
|
||||
|
||||
# Priority 2: Structural Heuristics (100% Deterministic)
|
||||
if "unified_follow_list_tab_layout" in ids or "follow_list_container" in ids:
|
||||
|
||||
@@ -486,6 +486,8 @@ class SituationalAwarenessEngine:
|
||||
"ig_browser_text_title", # In-App Browser Title
|
||||
"ig_browser_close_button", # In-App Browser Close Button
|
||||
"ig_chrome_subsection", # In-App Browser Chrome
|
||||
"bottom_sheet_container", # Bottom sheet modal (e.g., following options)
|
||||
"action_sheet_container", # Action sheet modal
|
||||
)
|
||||
if any(
|
||||
re.search(rf'resource-id="[^"]*{marker}[^"]*"', xml_dump, re.IGNORECASE)
|
||||
|
||||
Reference in New Issue
Block a user