fix(xhs): recover homepage search submission - #291
Merged
Conversation
|
@IRONICBo is attempting to deploy a commit to the socai Team on Vercel. A member of the Team first needs to authorize it. |
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
.single-line-search-btninside its.textarea-containerProduction 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 reportedSearch 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_searchmeasured 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
.single-line-search-btnto the explicit submit selector list.textarea-containerto avoid the hidden duplicate composersearchInputafter an unsuccessful Enter and click the live post-typing submit controlValidation
cargo test -p socai-core --lib— 99 passed, 0 failed, 2 ignoredcargo test -p socai-cli— 6 passed, 0 failednode --check core/src/sites/xhs/page_scripts.jsgit diff --check内容策划 招聘 上海entered/search_result_ai, preserved the exact query, and returned 10 requested cards/explorewith 30 homepage cards and zero results; after the fixclick_refreshed_search_buttonentered the result page and returned 8 requested cardsNo 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.