Repository navigation
Add iframe search with debounce - #125856
Conversation
|
An issue with the CI seems to be that it's not taking in the proper Electron. |
|
Verified that in the case of an IME (e.g. for Mandarin), the search must be made explicit, e.g. by pressing enter, otherwise focus is lost from the IME. CC Peng Lyu (@rebornix) Meanwhile when using NVDA, the readout is very different than in stable, or in the Monaco editor. In the editor, NVDA starts reading the document from the active match. In stable, NVDA only reads what is being typed in the find box. With this PR, when searching in an iframe, NVDA sometimes says "virtual document" and starts reading the iframe from the beginning, due to focus being lost from the inputbox for long enough to trigger the screenreader. Other times, NVDA only reads what is typed. Isidor Nikolic (@isidorn) I'm wondering how to make the search behaviour more accessible here? |
Matt Bierner (mjbvz)
left a comment
There was a problem hiding this comment.
Code changes look good overall. Nice work! Just a few minor comments
Benjamin Pasero (bpasero)
left a comment
There was a problem hiding this comment.
👏 👏 👏
Gave some feedback inline. Also found one potential issue: I cannot hit Cmd+X to cut/clear the input of the find input box. Also Cmd+C and Cmd+V do not seem to work there, maybe something that is still missing?
|
Raymond Zhao (@rzhao271) thanks for the ping. I see there are already quite some discussions here so for accessibility I think the best would be that once we merge this in you create an issue for accessibility and we look into that together. Once this is merged it will also be easier for me to try it out. |
|
Benjamin Pasero (@bpasero) I can confirm that the cut, copy, and paste commands don't work, but I'm not sure why, yet. I notice there's this event handler that is run when I type Ctrl+X, but I'm not sure if it interferes in any way https://github.com/microsoft/vscode/blob/main/src/vs/base/browser/ui/findinput/findInput.ts#L215. Matt Bierner (@mjbvz) do you have any insights on this? Also, with the IME issue, if we switch webviews to iframes on Insiders, searching will fail for anyone using an IME (Chinese, Japanese, Korean languages require these, for example). Therefore, I think we can merge this to Insiders, but I wouldn't set iframes to be used by default for now. Isidor Nikolic (@isidorn) I can create an issue for accessibility after this PR gets merged. I think the IME issue is another blocker, though. Edit again: The active match should be highlighted orange. I'm not sure why the match colour seems to alternate between yellow and orange above. |
|
Another issue: OSS seems to crash when I do a search in the preview view, but then change the content in the source markdown file. |
|
The match colour alternating between yellow and orange is an artifact of the find-in-frame implementation: The crash described in #125856 (comment) is irregular, though, and requires I make a crashdump. |
What are the steps to get to this crash? When you say OSS you mean running with our internal builds? |
|
I confirmed the iframe search crash occurs around the time the I tried adding some code that stopped the find before that message was posted, but the crash continued to occur. |
|
👍 , I have extracted #126729 for the crash. I found a second case where I can reproduce a crash. |
c4b12a4 to
4da1d00
Compare
|
I have rebased the changes on top of Deepak's FindRequestManager fix, which now avoids the crash described in #126729. I also added on a commit that adds on |


This PR fixes #96307 by adding an iframe search prototype. It uses electron/electron#28274 to search in the iframe, which results in a loss of focus during the search. Therefore, I added an event to re-focus the inputbox after find results are returned, and also added a debounce so that the focus-changing behaviour of the find call is not too obvious.
Preview:

Issues: