fix(admin): debounce byline search to stop full-page reload per keystroke#1222
Draft
scottbuscemi wants to merge 1 commit into
Draft
fix(admin): debounce byline search to stop full-page reload per keystroke#1222scottbuscemi wants to merge 1 commit into
scottbuscemi wants to merge 1 commit into
Conversation
…roke The byline search input fed the query key directly with no debounce, and the full-page loader gate (`if (isLoading)`) replaced the whole page — including the search input — on every keystroke, so the field lost focus and flashed. Debounce the search (300ms) before it drives the query and only show the full-page loader when there is no data yet, matching the users page. Closes #1220.
Contributor
PR template validation failedPlease fix the following issues by editing your PR description:
See CONTRIBUTING.md for the full contribution policy. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
docs | d37327e | May 29 2026, 10:18 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-playground | d37327e | May 29 2026, 10:19 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-cache | d37327e | May 29 2026, 10:19 PM |
🦋 Changeset detectedLatest commit: d37327e The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Closes #1220.
Problem
Typing in the Bylines search box reloaded the whole page on every keystroke (even with ~5 bylines). The search value fed the React Query key directly with no debounce, and the full-page loader gate (
if (isLoading)) unmounted the entire page — including the search input — on each new query key, so the field lost focus and flashed.Fix
useDebouncedValuehook before it drives the query key / fetch / load-more, keeping the input bound to raw state so typing stays responsive.isLoading && !dataso the list refetches in place instead of replacing the page.Testing
pnpm lint:quickclean,pnpm --filter @emdash-cms/admin typecheckpasses.packages/admin/tests/routes/bylines.test.tsx(browser/vitest) covering debounce + no full-page loader takeover. Runs in CI.Manual verification