Page MenuHomePhabricator

Mobile toggling code doesn't use the first heading to toggle
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Create a new page with the contents of https://en.wikipedia.org/w/index.php?title=User_talk:Jetstreamer&oldid=645994201&action=edit (or just some level 1 sections (== title ==) and one level 0 section (= title =))
  2. Open this page in mobile view

Expected: The level 0 section title should be the only one which is collapsible and have an edit pencil
Observed: The entire toggling is broken, there is no toggleable section (and therefore no editable) and the ToC is somewhere in the page)

Original report

See [[User_talk:Jetstreamer#PLUNA_destinations.2C_orphan_status | discussion here ]].

The beta mobile site for a user talk page other than one's own has only one edit button (pencil icon): the one at the top of the page. I tried to add a section to the bottom of [[User:Jetstreamer]]'s talk page, but wasn't able to. I can edit my own talk page as a wiki page, and add a section at the bottom by editing the current last section; and I can do the same on an article talk page; but I can't do it on another user's talk page.

Similarly, there's no way to edit an existing section of another user's talk page. In adding a section to [[User talk:Jetstreamer]], I asked them to {{tn:ping}} me in reply (so I wouldn't have to watch the page and get notified of irrelevant discussions). They did, but I couldn't reply via the beta mobile site unless I wanted to add another section to the top of the page; I had to wait till I could get to my laptop.

Event Timeline

Thnidu raised the priority of this task from to Needs Triage.
Thnidu updated the task description. (Show Details)
Thnidu added a subscriber: Thnidu.

Hi!

Thanks for reporting this. If there is an edit pencil at a heading or not is handled by our toggling code, which means, if a section isn't toggleable, it will not have an edit pencil (it is discussed to change this in ---).

Not all headings will be toggleable, only the "first" headings, so h1 or h2 or h3... (see https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/javascripts/modules/toggling/init.js#L310). Now i checked the linked talk page, and there is something crappy, normally there should be a list of headings and div containers (see, e.g., a working example here), but there is a div container, a heading and a div. In the second div, there is one heading and a div (correct style) which is transformed to a toggleable div and has a working edit pencil (see https://en.m.wikipedia.org/wiki/User_talk:Jetstreamer#Re:_Ethiopian_Airlines_accidents_and_incidents). So there seems to be a problem in some of the templates used on the talk page :(

Ok, checked the page and: It's the correct behavior. Toggling and editing works only for the top heading, which is, on this talk page, happy new year (it has a heading created with "= Heading ="). I have changed this to a "normal" first heading:
https://en.wikipedia.org/w/index.php?title=User_talk%3AJetstreamer&diff=646075983&oldid=645994201

And toggling and editing works now. Why this seaction doesn't had an edit pencil is the other question :/

Florian renamed this task from Beta mobile site doesn't work right for editing another user's talk page to Mobile toggling code doesn't use the first heading to toggle.Feb 7 2015, 7:52 PM
Florian claimed this task.
Florian updated the task description. (Show Details)
Florian set Security to None.
gerritbot added a subscriber: gerritbot.

Change 189239 had a related patch set uploaded (by Florianschmidtwelzow):
Fix toggling when level 0 sections are used

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

Patch-For-Review

Thanks! I should have tried with other Talk user:... pages; it didn't occur to me that this user's page might have an individual problem.

Why this seaction doesn't had an edit pencil is the other question :/

(Psst! The negative simple past form is "didn't have". When there's an auxiliary verb in the construction -- do, can, will (but not have) -- the main verb is always in the infinitive form, and any inflections go on the auxiliary:

  • I didn't know
  • You could have knocked (two auxiliaries there! It's always the first one that gets the inflection)
  • I would go if I could.

Not so different from Wir würden uns freuen...)

Change 189239 merged by jenkins-bot:
Fix toggling when level 0 sections are used

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