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.