DevTools icon indicating copy to clipboard operation
DevTools copied to clipboard

The new search UI in the JSON viewer should show current index and total matches AND the old search field shouldn't appear

Open captainbrosset opened this issue 1 year ago • 4 comments

It cannot do full search. For example ["aaa", "aaa", ...] if there are 200 "aaa", use Ctrl+F to search aaa, it won't show xxx/200

Originally posted by @imba-tjd in https://github.com/MicrosoftEdge/DevTools/issues/87#issuecomment-1925750811

AB#47800890

captainbrosset avatar Feb 05 '24 09:02 captainbrosset

Thanks for filing @imba-tjd. I know that there's been some work on search lately, so this might be related.

Just to make sure I understand: you're saying that the "xxx/200" counter is missing, but apart from this, search works, right?

captainbrosset avatar Feb 05 '24 09:02 captainbrosset

I mean the total number isn't correct. For example xxx/123 even though there are actually 200.

imba-tjd avatar Feb 07 '24 13:02 imba-tjd

Thanks for clarifying, I was able to reproduce the issue.

If others want to test this, you can use the following URL (just copy the whole string, paste it into the address bar, and press Enter):

data:text/json,["aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa","aaa"]

Now, there are 2 ways to search:

  • Click somewhere inside the rendered JSON text, and then press Ctrl+F. This opens up a new search UI which does not include a total matches counter. See below:

    image

  • Click outside of the rendered page, for example click inside the address bar, and then press Ctrl+F. This opens up the usual browser search UI. This one does include a total matches counter, and ithat counter is incorrect. See below, there are 288 aaa in the JSON text, but the search field only counts a total of 119 instances:

    image

My understanding is that, for performance reasons, the JSON viewer only renders what's visible in the viewport, and then renders more content as you scroll. This is why the usual browser search field can't find the total number of instances. These instances simply don't exist in the DOM yet.

The new search UI (first screenshot above) is, I think, supposed to replace the browser search field in the JSON viewer. So I think this issue is really about two things:

  1. It shouldn't be possible to use the usual browser search field in the JSON viewer, because it doesn't work.
  2. The new search UI should show the total number of matches and current index.

captainbrosset avatar Feb 08 '24 08:02 captainbrosset

It shouldn't be possible to use the usual browser search field in the JSON viewer, because it doesn't work. The new search UI should show the total number of matches and current index.

Or, the other way around: the usual browser search field should just work with the JSON viewer, and the new search UI should be removed.

captainbrosset avatar Feb 08 '24 17:02 captainbrosset