Page MenuHomePhabricator

Spike [24 hrs]: Entry points for reporting system
Closed, ResolvedPublic

Description

Background information

One of the biggest reporting issues to solve is how users find ways to report. This task is to capture the technical ways that we might help create entry points. @aishwaryavardhana created a loom video that shows some options. It appears we are considering reporting on user pages, and on individual comments on discussion pages (any talk page).

After talking with the team, it seems that perhaps using hooks mioght be the way forward for this task. We are not sure about the various locations of links because we do not want to make any changes to core if it can be avoided.

We believe this can all be done with hooks wihtin the pirs extension

Questions

  • [ x] How could an extension add a link to the top bar on desktop? add code to /includes/skins/SkinTemplate.php function buildPersonalUrls,
  • [ x] How could an extension add a link on a users page (scenario 2 in Aishwarya's video)? we may be able to access a hook to bring the link in, not sure about the format of the url (look/feel)

image.png (1,200×357 px, 64 KB)

  • [x ] How could an extension add an overflow menu to a comment on a talk page (scenario 3 in Aishwarya's video)?

Again, it looks as if hooks are the way to go with this

image.png (975×562 px, 158 KB)

multiple examples MediaWiki hooks included in SkinTemplate.php

Event Timeline

@Madalina and I talked and she mentioned it is a bit too early to look into specifics until the project brief is written and reviewed. So for now we will hold on working on this task until she says so.

Extensions to look at:

Extension with a link addition

  • Echo
  • Growth Extension

Open question: Where can we put the link within current technical limitation that would be universal?

  • Challenge -- menus are theme/device specific
  • Goes back to entry point discussion -- expore options
  • Toolbox (left navigation on desktop/top on mobile)
  • Nav (top on desktop)

looking at extension Echo, cannot find Growth Extension, could it be Growth Experiments?

Yeah, Growth Experiments is it.

As an FYI, the extension Echo is needed for GrowthExperiments, so suggest just installing GrowthExperiments -

NOTE: there will be database changes
NOTE: the are many extensions and skins needed for GrowthExperiments to play

skins
wfLoadSkin( 'Vector' ); - prop already have
wfLoadSkin( 'MinervaNeue' ); - prob already have

additional extensions - this is all in the GrowthExperiments doc
https://www.mediawiki.org/wiki/Extension:GrowthExperiments/developer_setup?useskin=vector-2022#Installation
wfLoadExtension( 'GrowthExperiments' );
wfLoadExtension( 'CirrusSearch' );
wfLoadExtension( 'Echo' );
wfLoadExtension( 'Elastica' );
wfLoadExtension( 'PageViewInfo' );
wfLoadExtension( 'MobileFrontend' );
wfLoadExtension( 'VisualEditor' );

For more fun there are database update scripts which I am sort of stuck at right now

At what point should the 'WhateverItIsWeAreCallingTheLink' link be used? If a user is logged in? If is a temp user or not logged in?

OK, have logged in(windows), not logged in (firefox), and Admin (chrome), will do side in morning

image.png (1,472×1,332 px, 179 KB)

To be discussed in engineering tomorrow, and timeboxed until the end of the week.

mepps renamed this task from Investigation: Entry points for reporting system to Spike [24 hrs]: Entry points for reporting system.Jan 23 2023, 7:39 PM
mepps updated the task description. (Show Details)
mepps added a subscriber: aishwaryavardhana.

we have pirs extension and able to install, db updates done, all extensions for GrowthExperiments downloaded and installed to view for creating link, should have link in pirs done tomorrow with at least one entry point

As this is a spike, I guess I have about 8 more hours to play

may be reading this wrong, but it looks as if we need to enter the pirs link into a table:
https://www.mediawiki.org/w/index.php?title=Manual:Pagelinks_table&useskin=vector-2022

pl_from
The page_id of the page containing the link.

pl_namespace
The page_namespace of the target page. The target page may or may not exist, and due to renames and deletions may refer to different page records as time goes by.

pl_title
The title of the target page in the page_title format. The target page may or may not exist, and due to renames and deletions may refer to different page records as time goes by. Spaces are converted to underscores, and the first letter may be automatically capitalized. So for example, a link to foo bar would have a pl_title of "Foo_bar" assuming $wgCapitalLinks = true; and no $wgCapitalLinkOverrides.

pl_from_namespace
MediaWiki version:	
≥ 1.24
The page_namespace of the page containing the link.

Schema summary
MediaWiki version:	
≥ 1.36
DESCRIBE pagelinks;

+-------------------+------------------+------+-----+---------+-------+
| Field             | Type             | Null | Key | Default | Extra |
+-------------------+------------------+------+-----+---------+-------+
| pl_from           | int(10) unsigned | NO   | PRI | 0       |       |
| pl_namespace      | int(11)          | NO   | PRI | 0       |       |
| pl_title          | varbinary(255)   | NO   | PRI |         |       |
| pl_from_namespace | int(11)          | NO   | MUL | 0       |       |
+-------------------+------------------+------+-----+---------+-------+

Looks like to add to the side of page nav on side in the desktop view will need to use
Skin::buildSidebar line approx 1450
or
Skin:buildNavUrls line approx 1263

seem to keep going in a loop, start looking for where the link should go, then get caught up on how to use a link made in an extension, and wander off to another rabbit hole. All changes will go in the includes/skins folder, from what I can understand. Also looking at includes/linker folder, since it says link -

javascript
php hard coded
class::function->value
this will get url
$nav_urls[ 'pirs' ] = [ 'href' => SpecialPage::getTitleFor( 'pirs', $thispage ) -> getLocalURL() ];

not in core, but probably in skin, may not put in side bar or top personal nav, it sounds like it is the skin
as of now we believe we would have to put something into skin

not in core, but probably in skin, may not put in side bar or top personal nav, it sounds like it is the skin
as of now we believe we would have to put something into skin

I believe we revised this by the end of the call to say we could put into an extension using the hooks.