Page MenuHomePhabricator

Section unexpectedly collapsed when using New Discussion Tool to publish a topic on mobile
Closed, ResolvedPublic

Description

T301839 improves the experience people will have when publishing a comment with the Reply Tool on mobile. This is a "sibling" task for improving the experience people have when publishing a new topic with the New Discussion Tool on mobile.

Environment

  • Platform: iOS 15.2.1
  • Browser: Safari
  • Device: iPhone Xs

Behavior

🎥: Screen recording: https://youtu.be/lpusO5JFlGI

  1. Visit a talk page on a wiki where the mobile Reply Tool is available. E.g. https://simple.m.wikipedia.beta.wmflabs.org/wiki/Talk:Cats?dtenable=1.
  2. Tap the Add discussion button that appears at the top of the talk page
  3. Draft a new topic
  4. Tap the Add topic button to publish the topic you drafted in "3."

Actual

  1. ❗️Notice you are returned to the top of the talk page with all of the sections/discussions within it collapsed, the viewport is then scrolled to the collapsed section you just published a comment within, with the title of said discussion highlighted.

Expected

  1. ✅ Notice the new topic you published in "Step 4." (read: the topic's title and description) is highlighted in yellow
NOTE: I wonder the extent to which implemented the "Expected" behavior depends on T300502

Event Timeline

ppelberg edited projects, added Editing-team (Kanban Board); removed Editing-team.
ppelberg updated the task description. (Show Details)
matmarex added a project: Editing QA.
matmarex subscribed.

This should be fixed by the patch on T301839.

Ryasmeen subscribed.

The page is not jumping around anymore after posting a new topic but the title is not getting highlighted.

Oh, duh, the newly added section is still collapsed…

It turns out that expanding it is a little tricky, since the state of MobileFrontend's collapsed sections is not exposed for other extensions like DiscussionTools to modify.

Options:

  1. Ask the maintainters to introduce a JS API for this
  2. Navigate to #fragment after saving
  3. Simulate a click on the heading
  4. Modify mw.storage.session.getObject( 'expandedSections' )

I kind of like option 2, since it matches the behavior of the normal wikitext editor when adding sections.

Change 784271 had a related patch set uploaded (by Bartosz Dziewoński; author: Esanders):

[mediawiki/extensions/DiscussionTools@master] Fix highlighting and expanding of new topics on mobile

https://gerrit.wikimedia.org/r/784271

Change 784271 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Fix highlighting and expanding of new topics on mobile

https://gerrit.wikimedia.org/r/784271