This task involves the work with introducing edit affordances within the desktop site's new sticky header (T283505).
=== Requirements
//Notes: once completed, this section will end up being a combination of the requirements originally defined in T287545 as well as those that emerged during the [Sticky Header Mini Offsite](https://docs.google.com/document/d/1z_YXtXdqboRmf4c61nEupdZOYIBS8vV_ErKutcPF-GY/edit) the Editing Team held on 1-Dec-2021.//
==== Meta
- Platforms: **Desktop**
- Editing Interfaces: **Visual editor** and **2010 Wikitext editor**
-- !!#TODO: do we get support for the 2017 wikitext editor "for free"?!!
- People Affected: people who A) Are **Logged in** //and// B) Have the `Use Legacy Vector` setting within `Special:Preferences#mw-prefsection-rendering` **disabled**
-- //Note: the Web Team will revisit the question of whether the sticky header will be made available to logged out users in Q3FY2021-22.//
- Relationship to settings: Logged in editors who have explicitly set a preference for the `Editing mode` setting within `Special:Preferences#mw-prefsection-editing` will notice their preference reflected within the reading mode sticky header by way of the editing affordance(s) they see/do not see.
-- //This requirement will likely already have been met by way of T289723.//
==== Noticing the edit affordance
- In single edit tab contexts, one affordance, that opens the editing interface projects will have defined as their default or individual people will have defined as their preferred interface, must be present within the sticky header.
-- //This requirement will likely have been met by way of T291414 and T289723.//
- In contexts where two edits tabs are available, affordances to open the wikitext and visualeditor must be present within the sticky header
-- //This requirement will likely have been met by way of T291414 and T289723.//
==== Transitioning from reading into editing
**`Visual`**
- Upon clicking an edit affordance within the sticky header, we should strive to minimize the amount that the viewport/content moves, so that people can maintain their focus on the content they are seeking to change, and ultimately, begin making that change as quickly as possible after the editing interface becomes ready.
-- //Note: the approach we implement now will be improved when the new parser is deployed.//
- !!#TODO: define which section heading we should pick as point we use to anchor the reading and editing experiences!!
-- //Note: the work to define the section anchor point will happen in TICKET.//
**`Source`**
- !!#TODO: define which section heading we should pick as point we use to anchor the reading and editing experiences!!
-- //Note: the work to define the section anchor point will happen in TICKET.//
-- //Note: "section heading" in this context refers to all section levels: `==H2==`, `===H3===`, `====H4====`, etc.//
**`Source`** + **`Visual`**
- Upon landing in editing mode, people ought to see the section they were just viewing focused in-view while //still being able to// scroll to any other part of the article.
-- //Note: this functionality is already implemented within the Visual editor. Additional work will be required to implement this in the 2010 wikitext editor.//
==== Making a change
**`Source`** + **`Visual`**
- When the editing interface loads, the sticky header people will see while reading should //not// be visible so: A) they do not become confused what modality they're in //and// B) they can continue to access the editing toolbar they will need to make changes.
==== Transitioning from editing into reading
**Abandoning the editing interfaces (`source` + `visual`)**
- Upon abandoning the editing interfaces (e.g. pressing {nav Escape} or clicking the browser's {nav Back} button) people should be returned [as closely as possible] to the scroll position they were at in the moment they clicked the {nav Edit} affordance within the sticky header.
==== Publishing a change
**`Visual`**
- //No changes to the current experience: upon publishing an edit, people should land back in reading mode at the same position in the article as they were just before they clicked {nav Publish changes}.//
**`Source`**
- //No changes to the current experience: upon publishing an edit, people should land back in reading mode at the top of the section they were in just before they clicked {nav Publish changes}.//
=== Prototype
You can see a WIP prototype that begins to implement what the `===Requirements` describe in this prototype: https://patchdemo.wmflabs.org/wikis/000ff2c092/wiki/Cats.
//More context in T293158.//
=== Minimum test case