Behaviour SwRS-MDOKFSTUDIO-TABLE-048
A labelled table bar above the table tells the position and holds the buttons
When a cell editor opens in a table, the extension SHALL create once a toolbar named "Table row and column actions" in the page flow directly above the table, showing seven labelled operation buttons and a status with the position of the selected cell, keep it while the editor moves between cells of that table, and remove it when the editor closes.
Step 2 of path 1 in StRS-MDOKFSTUDIO-TABLE-008: from “The cell editor is open” to “The table bar is shown above the table”.
Scenarios 7
The situations the tests check; open one to read it.
nominalBar above the table
Givena cell editor opened in a table
Whenthe page is inspected
Thena toolbar named "Table row and column actions" is the previous sibling of the table in the page flow, with no floating coordinates, and its bottom is not below the top of the table
boundaryPlacement and lifetime
| Input | Outcome |
|---|---|
| A table that is the only child of a div wrapper that has no source-line attribute, a cell editor opens | The bar is placed before the wrapper |
| A table without a parent | The bar falls back to the body (read from the code, untested) |
| The editor moves to the next cell with Tab | The same bar element is still in place and only its status changes |
| The editor is closed by Escape or by a save | No table bar is left |
nominalSeven labelled operation buttons
Givena cell editor open
Whenthe bar is inspected
Thenit holds seven buttons marked as table operations, in that order, each with an svg icon, a title and a label, and the buttons that follow the separator belong to the cell formatting group and are not table operations
| Visible label | Accessible name, title and tooltip name |
|---|---|
| Row above | Insert row before selected row |
| Row below | Insert row after selected row |
| Row − | Delete selected row |
| Col left | Insert column before selected column |
| Col right | Insert column after selected column |
| Col − | Delete selected column |
| List table | Convert to list-table |
boundaryGroups and rules
| Input | Outcome |
|---|---|
| The group attributes of the seven buttons are read | The buttons carry the groups row, row, row, column, column, column and table |
| The styles are read | The rule style applies to the first button of the column group and of the table group: a thin rule before Col left and before List table |
| The styles are read for Row above, Row below, Row −, Col right and Col − | No rule is drawn before them |
| The cell formatting group wraps onto a second line of the bar | Its rule is the first element of the group, so it starts the second line instead of ending the first |
nominalStatus of the selected cell
| Input | Outcome |
|---|---|
| Two-column table with two body rows, editor in the header's first cell | The status reads "Header · column 1 of 2" |
| The editor in the second cell of the first body row | The status reads "Row 1 of 2 · column 2 of 2" |
| A column added with Col right, the status read | It counts the new column count and the new selected column |
| The editor moves to another cell | The status is updated at every cell switch |
| The status has no text | It is not displayed and takes no room on the bar line |
| The status has text (the position of the cell) | It is displayed |
boundaryStatus centring
| Input | Outcome |
|---|---|
| Cell editor open in a sixteen-column table at 900 px; the vertical centres of the status and of the first operation button are compared | They differ by at most 2 px |
| A status that wraps onto its own line in a narrow pane | The centring is not required |
boundaryNarrow pane
| Input | Outcome |
|---|---|
| Cell editor open in a 460 px pane | The bar and its cell formatting group wrap onto several lines: no button of the cell group lies outside the bar and the bar is not wider than the viewport |
| Cell editor open in a 360 px pane | The bar and its group wrap inside the pane without overlap, which follows from the wrapping style and is not covered by any scenario |