Any time a template or parameter receives user events, it should be highlighted in both the sidebar and content, and if necessary the page should scroll to make it visible.
**Acceptance criteria**
|** action on the left **| results in the sidebar T311204 | results in the **content pane**
| ----- | ----- | -----
| **select** a **template or wikitext** transclusion (press space) | ๐ฆ blue highlight | ๐ scroll into view (๐) & focus stays in sidebar
| **select a parameter** (press space) | ๐ฆ blue highlight | ๐ scroll into view (๐) & focus stays in sidebar T296996
| **unselect a selected parameter** (space or checkbox click) that was **selected** | โ selection goes away (remove blue highlight) | โธ focus stays as is T296996, T312213 & no scrolling
| **unselect a parameter** (space or checkbox click) that was **not selected** | โธ nothing happens | โ parameter should just be removed & โธ focus stays as is T296996 & no scrolling
| **hover** (cursor keys up and down or mouse cursor) | โฌ grey highlight on unselected elements โธ no change on selected elements | โธ no scrolling & no focus
| add a **new template** or **new wikitext** (with the buttons) | ๐ฆ blue highlight on new element | ๐ focus on new input field
| press the **delete button** in the toolbar to delete a template or wikitext transclusion | โฌ selection jumps to following element (template or wikitext), except if there is no element below, โฌ then jump to previous part T312221 | โ template or wikitext is hidden
| typing into **parameter filter** | โ removes any selections and associated highlights [[ https://gerrit.wikimedia.org/r/c/mediawiki/extensions/VisualEditor/+/810019 | 810019 ]] | โธ nothing happens
| **hard select** (press enter or mouse click on any element) | ๐ฆ blue highlight | ๐ scroll to top --> see next table
|** action on the right **| results in the sidebar | results in the **content pane**
| ----- | ----- | -----
| focus an **input element** in the content pane T311204 | ๐ scroll element in sidebar into view & ๐ฆ highlight it | โน๏ธ focus on input
| focus a **wikitext input** in the content pane T291381 | ๐ scroll element in sidebar into view & ๐ฆ highlight it | โน๏ธ focus on input
Different effects in desktop and mobile
|** action **| results in the **desktop skin** | results in the **mobile skin** | results in **narrow mode** T290975
| ----- | ----- | ----- | -----
| press **enter** or mouse **click on** a **template name** in the sidebar | ๐ scroll to top & โน๏ธ focus moves to link in description | ๐ scroll to top & โน๏ธ focus stays | after view flip: ๐ scroll to top
| press **enter** or mouse **click on** a **wikitext item** or a **parameter** in the sidebar | ๐ scroll to top & โน๏ธ focus moves to input field | ๐ scroll to top & โน๏ธ focus stays | after view flip: ๐ scroll to top
| click **new template** or **new wikitext** button | โน๏ธ focus on input | โน๏ธ focus on input | after view flip (see also T291365): ๐ scroll to top
[x] Disable the bogus auto-scroll feature described in T289043#7297679.
**Dev notes**
This partly depends on the keyboard navigation work in {T285323}, which will refactor events. We'll probably need to disconnect old sidebar events, either by preventing it from being created, or by putting conditionals around code that connects its event handlers.