webgpu / webgpu-samples

WebGPU Samples
https://webgpu.github.io/webgpu-samples/
BSD 3-Clause "New" or "Revised" License
1.77k stars 300 forks source link

The "find" functionality is broken on desktop. Makes it hard to navigate the code. #426

Open Tomycj opened 3 months ago

Tomycj commented 3 months ago

The find function (Ctrl+F) doesn't work properly in the section that shows the code in the webgpu samples, at least on Chrome for desktop. For some reason it often doesn't find all matches within the code). The same section has its own search function, but it sticks to the bottom, which makes it almost useless since it gets out of reach once it jumps to a match that's out of view.

greggman commented 3 months ago

Can you post a video of the issue?

This is what I see on my Mac

https://github.com/webgpu/webgpu-samples/assets/234804/b2d88be0-78a6-42cd-8edb-8652850ee103

(ps: used handbreak to take it from 38meg to 3meg)

Tomycj commented 3 months ago

Thank you for the detailed reply!

Notice how the browser's find function was unable to find all matches (it misses "device" on line 216). It seems to only be able to find those that are roughly visible on screen, so it works a little better for words with a lot of matches since switching between them reveals new text to find new matches on.

https://github.com/webgpu/webgpu-samples/assets/51275588/db771be4-bbd8-49cd-b046-1e5f3020d291

The behavior on my end is the same, except I can't (or don't know how to) automatically move between matches without having to go back down to the finder controls. That capability (or the controls staying fixed on the screen, like the browser's) would make it much more comfortable to browse the code. Btw, how do you manage to view the page in dark colors?

Thank you.

greggman commented 3 months ago

Btw, how do you manage to view the page in dark colors?

For me, I go into my OS and set it to dark mode

Or you can set your browser to dark mode separate from your OS

greggman commented 3 months ago

428