Skip to content

fix(xhs): recover homepage search submission - #291

Merged
IRONICBo merged 1 commit into
socai-io:mainfrom
IRONICBo:fix/xhs-search-submit-transition
Sep 4, 2026
Merged

fix(xhs): recover homepage search submission#291
IRONICBo merged 1 commit into
socai-io:mainfrom
IRONICBo:fix/xhs-search-submit-transition

Conversation

@IRONICBo

@IRONICBo IRONICBo commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • recover Xiaohongshu homepage searches when typing succeeds but Enter does not trigger navigation
  • re-locate the submit affordance after the query is entered instead of reusing the pre-input coordinate
  • recognize the current .single-line-search-btn inside its .textarea-container
  • keep the strict result-page guard so homepage feed cards cannot be reported as search results
  • document the homepage composer lifecycle and result-route invariant in the XHS knowledge file

Production evidence

An Axiom failure on v0.5.5 showed the requested query present in the input while the browser remained on /explore. The run observed 32 homepage feed cards, returned zero search cards, and reported Search did not transition to a valid Xiaohongshu result page.

A second historical failure had the same shape: the requested query and suggestion panel were visible, but unrelated homepage cards remained underneath and no result route was entered.

Root cause

The homepage AI composer mounts or re-renders its visible submit button only after text is entered. submit_search measured the button before typing, so its fallback reused a missing or stale coordinate. When Xiaohongshu also ignored the synthetic Enter event, the query remained in the homepage input until the strict transition check correctly rejected the page.

Implementation

  • add .single-line-search-btn to the explicit submit selector list
  • scope submit lookup to the closest .textarea-container to avoid the hidden duplicate composer
  • refresh searchInput after an unsuccessful Enter and click the live post-typing submit control
  • preserve the latest post-click transition state for failure diagnostics

Validation

  • cargo test -p socai-core --lib — 99 passed, 0 failed, 2 ignored
  • cargo test -p socai-cli — 6 passed, 0 failed
  • node --check core/src/sites/xhs/page_scripts.js
  • git diff --check
  • real logged-in homepage search for 内容策划 招聘 上海 entered /search_result_ai, preserved the exact query, and returned 10 requested cards
  • four additional normal searches entered valid result pages
  • deterministic fault injection blocked the first Enter: before the fix the page stayed on /explore with 30 homepage cards and zero results; after the fix click_refreshed_search_button entered the result page and returned 8 requested cards

No new Rust test function was added, following the repository engineering rule; the dynamic browser behavior was validated against the live logged-in Xiaohongshu DOM and with the controlled Enter-failure path.

@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

@IRONICBo is attempting to deploy a commit to the socai Team on Vercel.

A member of the Team first needs to authorize it.

@IRONICBo

IRONICBo commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author
image

@IRONICBo
IRONICBo merged commit 86a1ae6 into socai-io:main Sep 4, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant