Show a spinner while a log search runs, and drop stale searches - #290
Merged
Merged
Conversation
A search of the query log reads the whole stored log, which takes a second or more on a month of traffic. The box already waited 400 ms after the last keystroke, but it gave no sign a search was running, and an older search still on the wire kept going after the next one started. Now a newer search replaces one still running, in both log search boxes, and a search box whose form is waiting on the server swaps its magnifier for a spinner until the answer lands. Under reduced motion it holds still.
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.
Searching the query log could feel laggy. The box already waits 400 ms after the last keystroke before it searches, so the lag is the search itself, and the box gave no sign anything was happening.
SearchField, so it applies to any search box that posts its own form: both log search boxes and Check a Domain. Boxes that filter in the page never show it.hx-sync="this:replace", so a newer search cancels one still on the wire instead of both running.Checked in the Vandelay demo with the server slowed to 1.5 s: typing
ap, thenapplecancelled theaprequest, the spinner showed while each was out, and the box kept the typed text and focus.TestBrowserLogSearchpasses.Why it's slow
A whole-log search counts every match and then finds the page, scanning the domain, client, and answer of every row. On 1 million rows on an M3 Max it takes about 1.1 s: about 0.75 s for the count and 0.35 s for the page. ns1 keeps 30 days, which could be several million rows, on slower hardware. Speeding that up is a separate change.
Screenshots below (server slowed so the spinner stays up).