Behaviour SwRS-MDOKFSTUDIO-TOOLBAR-009
Cmd/Ctrl+F opens a find bar over the preview
When the reader presses Cmd+F (macOS) or Ctrl+F (other systems) with the focus in the preview page, including a field of an open block, table cell or frontmatter editor, the extension SHALL open a find bar over the preview at once with its field focused, so the keys typed next go to the query, close it on Escape, and leave the key to VS Code when the focus is in the text editor; and the find and replace fields keep their native text-editing shortcuts (select all, copy, cut, paste, undo, redo, caret and word moves, delete a word), applied to the field alone without handing the key to the page or to VS Code.
Step 1 of path 1 in StRS-MDOKFSTUDIO-TOOLBAR-003: from “The preview page has the focus” to “The find bar is open”.
Scenarios 4
The situations the tests check; open one to read it.
nominalOpen and close
boundaryEditors and an open bar
| Input | Outcome |
|---|---|
| Cmd/Ctrl+F while the focus is in the text editor | VS Code's own find opens; the preview is not involved |
| Cmd/Ctrl+F while the focus is in a field of an open block editor, table cell editor or the frontmatter editor | The page takes the key and opens the bar at once with its field focused (the query starts with the text selected in that field, if any); the keys typed afterwards go to the query, not to the field; the editor commits on blur as usual, with what was typed before the key |
| Cmd/Ctrl+F while the focus is in another field of the page (a comment box, a control of the palette or of a panel) | The same: the bar opens at once; the field loses the focus as on a click elsewhere |
| Escape after the blur committed a block or table cell editor whose final save is still on its way | The bar closes and the focus is not given back to that editor's field (keys typed there would not be saved) |
| The host's find command (VS Code's key binding) while the focus is already in the bar | Nothing changes: no second bar, the query is kept and not selected again, the focus stays |
| Cmd/Ctrl+F while the bar is open and the focus is elsewhere | The field is focused again and its query selected |
| Cmd/Ctrl+F in the bar | The query is selected again |
| F3 while the focus is in a field of an open editor | The key is left to the field |
| Tab in the bar | The order is the toolbar, the bar controls, then the content |
nominalSelect all in the find field
boundaryOther keys
| Input | Outcome |
|---|---|
| Cmd/Ctrl+C, +X, +V, +Z, +Shift+Z, +Y in the find or replace field | Stopped inside the bar, default action kept: the field copies, cuts, pastes, undoes or redoes, never a block selection or the workbench history |
| Arrows, Home, End, Backspace, Delete, with or without Shift, Alt or Cmd/Ctrl (caret, word and line moves, delete a word) | Stopped inside the bar, default action kept |
| The same keys during an input method composition | Not taken by the bar |
| Escape, Enter, Shift+Enter, Cmd/Ctrl+Alt+Enter, Cmd/Ctrl+F, Alt+C, Alt+W, Alt+R | Keep the actions of the bar |
| Another chord (Cmd/Ctrl+S, Cmd/Ctrl+P) | Left to VS Code |