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
AND, when the panel was opened from a table cell editor, it sits inside the table bar under the buttons
nominalPrefill and focus
| Input | Outcome |
|---|---|
| Selected text https://example.org | Text is empty, URL holds the address and the focus is in Text |
| Selected text some words | Text 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 filled | The focus is in Text |
| No selection | Both fields are empty and Text has the focus |
nominalKeyboard inside the panel
| Input | Outcome |
|---|---|
| Tab with the focus on Cancel | The focus moves to Text |
| Shift+Tab with the focus on Text | The focus moves to Cancel |
| Tab or Shift+Tab between the first and the last stop | The browser's own order is used |
| Ctrl+K or Cmd+K with the focus in Text | The panel consumes the key, the focus moves to URL and VS Code does not receive the key |
| Ctrl+Shift+K with the focus in Text | The 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
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
with the same text as at the opening, Insert writes the link
boundaryOne panel, removed with the editor
| Input | Outcome |
|---|---|
| The panel is open and the writer presses Link again | The first empty field of the open panel takes the focus and no second panel opens |
| The panel is open and the editor is closed | The panel is removed |
| The panel was closed by Cancel and the editor is closed | Nothing is left of the panel |