Markdown OKF-Schema Studio

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
Givena preview page with the focus in its content
Whenthe reader presses Cmd+F on macOS or Ctrl+F elsewhere
Thenthe key is taken before VS Code's webview find sees it, the find bar is shown under the toolbar with its field focused and the selected text of one line as the query, and Escape hides it and gives the focus back to where it was
boundaryEditors and an open bar
InputOutcome
Cmd/Ctrl+F while the focus is in the text editorVS 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 editorThe 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 wayThe 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 barNothing 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 elsewhereThe field is focused again and its query selected
Cmd/Ctrl+F in the barThe query is selected again
F3 while the focus is in a field of an open editorThe key is left to the field
Tab in the barThe order is the toolbar, the bar controls, then the content
nominalSelect all in the find field
Giventhe find bar is open with a query in its field
Whenthe reader presses Cmd+A on macOS or Ctrl+A elsewhere in the field
Thenthe key is stopped inside the bar, so no page listener and no VS Code key forwarding sees it, and its default action is not prevented: the browser selects the text of the field
boundaryOther keys
InputOutcome
Cmd/Ctrl+C, +X, +V, +Z, +Shift+Z, +Y in the find or replace fieldStopped 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 compositionNot taken by the bar
Escape, Enter, Shift+Enter, Cmd/Ctrl+Alt+Enter, Cmd/Ctrl+F, Alt+C, Alt+W, Alt+RKeep the actions of the bar
Another chord (Cmd/Ctrl+S, Cmd/Ctrl+P)Left to VS Code

Implemented in 6

Tested by 6

Replaces

SwRS-MDOKFSTUDIO-TOOLBAR-132The find and replace fields keep their native editing shortcuts superseded superseded by SwRS-MDOKFSTUDIO-TOOLBAR-009 Markdown file