Skip to content
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

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

Open
captainbrosset opened this issue Feb 5, 2024 · 4 comments
Labels
feature New feature or request more info needed We need more information before we can act on this issue tracked This issue is now tracked on our internal backlog

Comments

@captainbrosset
Copy link
Contributor

captainbrosset commented Feb 5, 2024

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 #87 (comment)

AB#47800890

@captainbrosset
Copy link
Contributor Author

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 captainbrosset added feature New feature or request tracked This issue is now tracked on our internal backlog more info needed We need more information before we can act on this issue labels Feb 5, 2024
@imba-tjd
Copy link

imba-tjd commented Feb 7, 2024

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

@captainbrosset
Copy link
Contributor Author

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 captainbrosset changed the title 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 The new search UI in the JSON viewer should show current index and total matches AND the old search field shouldn't appear Feb 8, 2024
@captainbrosset
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request more info needed We need more information before we can act on this issue tracked This issue is now tracked on our internal backlog
Projects
None yet
Development

No branches or pull requests

2 participants