fix(xiaohongshu): accept stacked duplicate filter chips in the search panel - #2460
Open
yisiliu wants to merge 1 commit into
Open
fix(xiaohongshu): accept stacked duplicate filter chips in the search panel#2460yisiliu wants to merge 1 commit into
yisiliu wants to merge 1 commit into
Conversation
… panel The current search_result layout renders every filter chip twice inside the same .tag-container, with both copies visible at pixel-identical positions. findOption required exactly one visible text match, so every search failed with ambiguous_option before any filter was applied. Matches whose bounding rects are identical are one visual control - treat them as one option (preferring the copy carrying .active so the activation checks see it). Matches at distinct positions still fail closed as ambiguous_option; the fixture now places the second copy of a genuinely ambiguous chip at a different rect to keep that path covered. Verified live: default-filter search and --sort latest (which clicks a deduplicated chip) both return results again. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Sep 5, 2026
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.
Problem
xiaohongshu searchcurrently fails on every invocation with:Inspecting the live
search_resultpage shows why: the current layout renders every filter chip twice inside the same.tag-container, both copies passing the visibility check, at pixel-identical bounding rects (verified: two最新chips both at{x:936, y:187, 96×40}, same parent chain).findOptionrequires exactly one visible text match per group, so filter application — which runs for all five groups even at defaults — dies on the first group.Fix
Matches whose bounding rects are identical are one visual control stacked on itself, not an ambiguity: dedupe them and click through (preferring the copy carrying
.active, so the activation wait-loop and the final verification see the active state regardless of which clone the site marks). Matches at distinct positions still fail closed asambiguous_option— the fail-closed contract from #1506-era layout drift is preserved, and the test fixture now places the second copy of a genuinely ambiguous chip at a different rect to keep that path covered.Verification
--sort latestrun succeeds end-to-end; written test-first against the real filter script.ambiguous_option(65 search tests, 341 xiaohongshu adapter tests, 24 rednote tests — all green; full suite 7317 passed, typecheck and both lint gates clean).--sort latest, which clicks a deduplicated chip, applies and returns latest-sorted results in 4.8s.🤖 Generated with Claude Code
Part of the xiaohongshu risk-control/persistence arc — umbrella issue with full motivation and cross-PR context: #2470