This is a follow up task for T278485. User when interacting with Add link structured task surface should be sufficiently informed about loosing changes when navigating away and/or the changes should be recoverable.
The two tables below present two paths - when a user does not interact with the add link inspector and when some interactions are done.
Notes:
- when a user switches between tabs on an article itself (View history, Read, Discussion or switching to Edit source mode) they might not view such actions as navigating away. So the expectations might be to see saved Add link surface with saved changes when they click edit again.
-(updated) I marked in red the scenarios that seem to be the most inconsistent to me (not sufficient warning, not recovered changes despite the assuring message, unexpected outcome etc).
(1) A user doesn't interact with the link inspector
Actions on Add link overlay | Outcome on initial page | Desired |
---|---|---|
(1) the link inspector is open->a user reloads the page | the link inspector is open | |
(2) the link inspector is open -> a user clicks on "View history"-> clicks "Edit" | the link inspector is open | |
(3) the link inspector is open -> a user clicks on "Read"-> clicks "Edit" | the link inspector is open | |
(4) the link inspector is open -> a user clicks on "Discussion" tab -> clicks "Article"-> "Edit" | the link inspector is open | |
(5) the link inspector is open -> a user navigates away-> clicks a browser Back button | VE mode is open | the link inspector is open |
(6) the link inspector is open -> a user clicks on "Source editing" -> clicks on "Edit" | the link inspector is open | |
(2) A user interacts with the link inspector (a user clicks Yes/No)
Actions on Add link overlay | Outcome on initial page | Changes are recovered? | Desired |
---|---|---|---|
(1) reloads a page | a browser warning appears to confirm Reload | No | |
✅ DONE (2) the link inspector is open-> a user clicks on "View history"-> clicks "Edit" | a browser warning appears to confirm Leave; the message "Changes are recovered" is present | the changes are not recovered | We don't show the "changes are recovered" message. |
(3) the link inspector is open -> a user clicks on "Read"-> clicks "Edit" | "Continue editing" and "Discard edits" options are present; | "Continue editing" returns a user to add link surface - the changes are still present | |
(4) the link inspector is open -> a user clicks on "Discussion" tab -> clicks on 'Article"-> clicks "Edit" | a browser warning appears to confirm "Leave" | No | |
✅ DONE (5) the link inspector is open -> a user navigates away (clicks Random article)-> clicks a browser Back button | a browser warning appears to confirm "Leave" | "Change recovery failed" - VE is open | It is okay for VE to be open with the changes gone, but we wouldn't want to be telling them change recovery failed, because we never intended to recover them. |
✅ (6) the link inspector is open -> a user clicks on "Source editing" -> clicks on "Edit" | no warning about navigating away or about non-recovered changes | Add link surface is present without any changes saved | This depends on whether we build T269653: Add a link: edit mode toggle (machine suggestions & visual) and its special dialog. |