Page MenuHomePhabricator

Ensure section containing a comment is expanded when restoring from autosave on mobile
Open, Needs TriagePublic

Description

Currently it is unlikely the section is collapsed, as it would have just been opened by the user and that state is preserved in sessionStorage. As we move to localStorage, it will become more likely that a user opens a page where a draft comment is recovered, but there section is not restored because sessionStorage is erased when the tab is closed.

This means DiscussionTools will need to ensure the section is forced open. Currently the only API for getting MobileFrontend to open a section is to set the URL has to the ID of the section, or an ID inside the section. We could do this here but it might result in some scroll jumping. Alternatively we could expose a JS API for expanding sections.

Testing
  1. Expand a section on a mobile talk page and open the reply widget.
  2. Start typing a reply
  3. Collapse the section the reply is in.
  4. Reload the page

Observed

  1. A notification is shown saying your changes have been recovered, but the section is not expanded so no reply widget is visible

Expected

  1. The reply widget with your draft comment is visible.

Event Timeline

@Esanders: Removing task assignee as this open task has been assigned for more than two years - See the email sent to task assignee on October 11th.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome! :)
If this task has been resolved in the meantime, or should not be worked on by anybody ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!