From 800fb1da98942c3486ae3f62e69548063bad99ac Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Sun, 3 May 2026 16:31:32 +0200 Subject: [PATCH] fix(perception): replace string matching with structural feed marker check for perfect snapping --- GramAddict/core/behaviors/perfect_snapping.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/GramAddict/core/behaviors/perfect_snapping.py b/GramAddict/core/behaviors/perfect_snapping.py index ed7c11d..80ef905 100644 --- a/GramAddict/core/behaviors/perfect_snapping.py +++ b/GramAddict/core/behaviors/perfect_snapping.py @@ -29,9 +29,11 @@ class PerfectSnappingPlugin(BehaviorPlugin): if not getattr(self, "_enabled", True): return False - xml_lower = ctx.context_xml.lower() - # Do not snap if we are on a profile page or grid, it's meant for posts. - if "profile_tabs_container" in xml_lower or "explore_grid" in xml_lower: + # Perfect snapping is only for feed posts. + # Do not snap if we are on a profile page, explore grid, or modal. + from GramAddict.core.perception.feed_analysis import has_feed_markers + + if not has_feed_markers(ctx.context_xml): return False return True