Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-PALETTE-089

The Link button opens a labelled link panel prefilled from the selection

When the writer presses the Link button or Cmd+K or Ctrl+K, the extension SHALL open the link panel under the palette, a dialog named Insert link with the fields Text and URL and the buttons Insert and Cancel, prefilled from the selection, and make no edit until the panel is submitted.

Part of StRS-MDOKFSTUDIO-PALETTE-007, outside the paths drawn on its map.

Scenarios 7

The situations the tests check; open one to read it.

nominalButton
Givena block editor with a selected word
Whenthe writer presses Link
Thenthe panel Insert link opens under the palette and the text is unchanged
nominalStructure
Givenan open link panel
Whenthe panel is inspected
Thenit has role dialog and the name Insert link, two text fields with the accessible names Text and URL and the buttons Insert and Cancel in this tab order
AND, when the panel was opened from a table cell editor, it sits inside the table bar under the buttons
nominalPrefill and focus
InputOutcome
Selected text https://example.orgText is empty, URL holds the address and the focus is in Text
Selected text some wordsText holds the words, URL is empty and the focus is in URL
A selected address that starts with http://, https://, mailto: or www.The address goes to the URL field, any other selection to the Text field
Both fields filledThe focus is in Text
No selectionBoth fields are empty and Text has the focus
nominalKeyboard inside the panel
InputOutcome
Tab with the focus on CancelThe focus moves to Text
Shift+Tab with the focus on TextThe focus moves to Cancel
Tab or Shift+Tab between the first and the last stopThe browser's own order is used
Ctrl+K or Cmd+K with the focus in TextThe panel consumes the key, the focus moves to URL and VS Code does not receive the key
Ctrl+Shift+K with the focus in TextThe key is not consumed by the panel
refusalIME composition
Giventhe panel open and an IME composition in progress
WhenEnter confirms the composition
Thenthe panel stays open and nothing is inserted
once the composition has ended, Enter inserts the link
refusalText changed since the opening
Giventhe panel open and the text box value changed by a script, without an input event
WhenInsert is pressed
Thenthe panel closes and the text is unchanged
with the same text as at the opening, Insert writes the link
boundaryOne panel, removed with the editor
InputOutcome
The panel is open and the writer presses Link againThe first empty field of the open panel takes the focus and no second panel opens
The panel is open and the editor is closedThe panel is removed
The panel was closed by Cancel and the editor is closedNothing is left of the panel

Implemented in 3

Tested by 3