Page MenuHomePhabricator

[MEX] M1 - First iteration stub Build an initial UI element:
Closed, ResolvedPublic

Description

Under the Statements section on an item page display text box that says “This item has n statements.”

  • Only enabled to mobile mode (as interpreteed in team's document), and Items
  • For feature-enabled wikis only (via a config flag $wgWBRepoSettings['tmpMobileEditingUI'] on patch demo env)
  • Non-JS experience: Provide the same text box for non-JS enabled clients

Acceptance Criteria:

Details

Event Timeline

Change #1146011 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] POC: Add new mobile statement UI config flag

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

karapayneWMDE renamed this task from MEX First iteration stub Build an initial UI element: to [MEX] M1 - First iteration stub Build an initial UI element:.May 19 2025, 4:50 AM

Not quite sure where to leave this, so I'll put it here. Currently EntityView expects that it can produce html only depending on the language (code) that can canonically be used (and cached!). If we want to allow this feature, at least temporarily, to depend on the user (settings), we will need to break this assumption. One way to adopt the above change to T394704: [MEX] M1 - Create a beta feature (untested):

Make the wbMobile parser option tri-state (true, false and something else for the new mobile UI) and set it according to the beta feature (in RepoHooks::onParserOptionsRegister). Get the value of that option (or retrieve the setting in some other way) in FullEntityParserOutputGenerator::addHtmlToParserOutput and pass it to ItemView::getContent.

While this is a little unclean, I think it might be ok for a temporary feature. Alternatively the setting value could be passed to the EntityView / ItemView constructor. But as these instances are created without access to the user (except for global state) more thorough changes would be needed to properly inject it there.

handover notes:

  • as far as I can tell, the acceptance criteria are fulfilled. There is both a server-side-rendered HTML placeholder and a JS-added placeholder based on the temporary flag.
  • the previously-failing tests pass
  • ItemViewTest is extended to confirm that the placeholder is there when the flag is enabled, and not there when it isn't
  • FullEntityParserOutputGeneratorTest confirms the expected modules load under all combinations of $isMobileView and $tmpMobileEditingUI
  • I wasn't sure whether handling the beta feature flag was in scope for this ticket, and left it out

One way to adopt the above change to T394704: [MEX] M1 - Create a beta feature (untested):

Make the wbMobile parser option tri-state (true, false and something else for the new mobile UI) and set it according to the beta feature (in RepoHooks::onParserOptionsRegister). Get the value of that option (or retrieve the setting in some other way) in FullEntityParserOutputGenerator::addHtmlToParserOutput and pass it to ItemView::getContent.

While this is a little unclean, I think it might be ok for a temporary feature. Alternatively the setting value could be passed to the EntityView / ItemView constructor. But as these instances are created without access to the user (except for global state) more thorough changes would be needed to properly inject it there.

That sounds promising to me. I was thinking of reusing the wbMobile parser option for “old vs. new mobile UI” anyway, because that way we hopefully don’t invalidate any existing parser output with wbMobile=0 / wbMobile=1 (whereas adding a separate flag might result in that not being used? idk).

Test wiki created on Patch demo by Arthur Taylor (WMDE) using patch(es) linked to this task:
https://patchdemo.wmcloud.org/wikis/1f52abea58/w/

Change #1146011 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Add new mobile statement UI config flag

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

Arian_Bozorg claimed this task.
Arian_Bozorg subscribed.

Thank you! I am assuming the text has changed from the initial acceptance criteria to "TODO: Add Vue Statements View (text added by wikibase.mobileUi.entityViewInit.js)"

Yeah, it used to display that text for a bit and then we moved beyond it :)

Test wiki on Patch demo by Arthur Taylor (WMDE) using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org//wikis/1f52abea58/w/

Test wiki on Patch demo by Arthur Taylor (WMDE) using patch(es) linked to this task was deleted:

https://patchdemo.wmcloud.org//wikis/1f52abea58/w/