Page MenuHomePhabricator

mobile-html: allow clients to adjust tables
Closed, DeclinedPublic

Description

Context
On iOS, users can define whether they want article tables to be collapsed or expanded by default. This means that we need to be able to communicate that preference to the html.
We also need to be able to pass our localized strings for table titles. (T205550)

Proposed solution
Provide a JS function that allows clients to adjust tables.
For example (once T205550 is completed):

wmf.adjustTables = (collapse, locale) => {
    // adjust tables
    if (callback) {
        callback();
    };
};

Questions
Currently, on iOS, when the user taps on a collapsed table's footer, we scroll them back to the top of that table. Is this behavior going to move up to page library or are we expected to continue handling it ourselves?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 11 2019, 5:22 PM
NHarateh_WMF updated the task description. (Show Details)Mar 11 2019, 6:06 PM
Jhernandez added subscribers: bearND, Jhernandez.

@bearND to move under the appropriate epic and prioritise. This could be blocked on figuring out how the app injects settings to the web view.

LGoto triaged this task as Normal priority.Mar 27 2019, 3:54 PM
bearND claimed this task.May 29 2019, 3:35 PM
bearND moved this task from To Do to Doing on the Product-Infrastructure-Team-Backlog (Kanban) board.

@Sharvaniharan @NHarateh_WMF Is this used by the apps by itself (just collapseTables)? If so how or where is it used? This functionality is exposed by the setMulti() function which should be called when a page loads.
Having a separate call for this, when we cannot reasonably assume what the state of the table collapsing is would require some refactoring work. That's why I wanted to check first if this is even needed as a stand-alone function.

@bearND on iOS, it's not used by itself so it's not needed right now. We pass that preference when we create a page - https://github.com/wikimedia/wikipedia-ios/blob/a6e456d797732fda9eb362cab9691ff23fef7ad3/Wikipedia/Code/WebViewController.m#L316

Same on android @bearND . We use it while loading the leas section as a meta preference.:
https://github.com/wikimedia/apps-android-wikipedia/blob/master/app/src/main/java/org/wikipedia/page/PageFragmentLoadState.java#L412
Further we have a native transform for it.

bearND closed this task as Declined.Jun 11 2019, 4:29 PM

Then we can close this. Thanks, @NHarateh_WMF and @Sharvaniharan!