address review: scroll only when needed and smoothly, tighten the visual search needle

scrollIntoView re-centered every element unconditionally and instantly, which is the page jump between the daily set and explore on bing. The pointer move now scrolls only when the element is actually outside the viewport, smoothly, and polls the rect until the async scroll settles before computing the path.

Visual search matches the full 'visual search streak' label. Plain 'visual search' can also hit a dashboard element that goes stale mid-interaction, and the guessed 'image search' needle is gone.
This commit is contained in:
mardausdennis
2026-08-25 22:23:13 +02:00
parent 3dba5aa849
commit bf79e188f2
2 changed files with 44 additions and 16 deletions
+9 -10
View File
@@ -22,7 +22,9 @@ class Labels:
CLAIM = "claim" # exact label preferred, substring as fallback
DAILY_SET_STREAK = "daily set streak"
CARD_COMPLETED = "completed"
VISUAL_SEARCH = ("visual search", "image search")
# The full streak label on purpose: plain "visual search" also matches an
# element on the dashboard, which can go stale mid-interaction.
VISUAL_SEARCH_STREAK = "visual search streak"
class ElementSelectionUtils:
@@ -175,15 +177,12 @@ class ElementSelectionUtils:
# ------------------------------------------------------------------
def get_open_visual_search_sidebar(self):
for needle in Labels.VISUAL_SEARCH:
try:
return self._button_containing(needle)
except NoSuchElementException:
continue
# Not every layout ships this entry point, and where it does the label is
# not confirmed, so fall back to the original position in streaks.
return self._streaks_button(5)
try:
return self._button_containing(Labels.VISUAL_SEARCH_STREAK)
except NoSuchElementException:
# Not every layout ships this entry point. Where it does but the
# label differs, fall back to the original position in streaks.
return self._streaks_button(5)
def get_search_now_link_from_visual_search_sidebar(self):
sidebar = self.get_sidebar_section()