Skip to content

feat(Codecov): add test search bar with dynamic title to TA page #94893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adrianviquez
Copy link
Contributor

This PR adds a search bar with dynamic title to the TA page. This component mainly changes the url to add the term key, but this PR doesn't clal the API directly as that part needs to be implemented.

Notes

  • Add TestSearchBar component and add it to the tests page
  • Expose totalCount from the test results endpoint

@adrianviquez adrianviquez requested a review from a team as a code owner July 3, 2025 23:49
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 3, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Debounce Function Recreated Due to Incorrect Dependency

The useMemo hook for the handleSearchChange function incorrectly includes searchParams in its dependency array. As searchParams is a new object on each render (especially after URL updates), the debounced function is recreated. This recreation cancels any pending debounced calls, defeating the purpose of debouncing and causing search input to be lost or executed immediately instead of after the intended 500ms delay. The dependency array should only include setSearchParams to maintain proper debounce behavior.

static/app/views/codecov/tests/testSearchBar/testSearchBar.tsx#L32-L47

const handleSearchChange = useMemo(
() =>
debounce((newValue: string) => {
const currentParams = Object.fromEntries(searchParams.entries());
if (newValue) {
currentParams.term = newValue;
} else {
delete currentParams.term;
}
setSearchParams(currentParams);
}, 500),
[setSearchParams, searchParams]
);

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant