Skip to content

fix(file-surfer): reset search state when opening another path - #8372

Open
BUG设计工程师 (hackermengzhi) wants to merge 1 commit into
microsoft:mainfrom
hackermengzhi:fix/file-surfer-reset-search
Open

BUG设计工程师 (hackermengzhi) wants to merge 1 commit into
microsoft:mainfrom
hackermengzhi:fix/file-surfer-reset-search

Conversation

@hackermengzhi

Copy link
Copy Markdown

Why are these changes needed?

Opening a new path leaves FileSurfer's previous search active. After searching file A, opening file B and searching for the same term can skip file B's first viewport; find_next() also reuses a query that was never started on file B.

set_path() assigns two unused public attributes instead of clearing the private search fields read by find_on_page() and find_next(). Reset those fields on navigation. Add public-behavior regressions for clearing an old query and searching the first viewport of a new file, plus a control for cycling matches within one file.

Validation on Python 3.12.13:

  • New regressions before fix: 2 failed, 1 passed.
  • After fix: 5 passed across the new browser tests and existing FileSurfer agent tests, using the repository's locked OpenAI version (1.93.0).
  • Ruff 0.4.8 lint and formatting checks passed for the changed Python files.

Related issue number

No existing issue found for search-state reset on navigation.

Checks

  • I've included any doc changes needed for https://microsoft.github.io/autogen/. Existing navigation behavior is restored; no API change.
  • I've added tests (if relevant) corresponding to the changes introduced in this PR.
  • I've made sure all auto checks have passed.

@hackermengzhi

Copy link
Copy Markdown
Author

BUG设计工程师 (BUG设计工程师 (@hackermengzhi)) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

This branch has not been deployed

No deployments
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