Page MenuHomePhabricator

[M] MediaSearch should include a redlink when no results are found
Open, Needs TriagePublic

Assigned To
None
Authored By
AntiCompositeNumber
Jun 19 2021, 7:24 PM
Referenced Files
F34551070: 02.jpg
Jul 14 2021, 4:24 PM
F34551072: 03.jpg
Jul 14 2021, 4:24 PM
F34551074: 01.jpg
Jul 14 2021, 4:24 PM
F34519275: 02.jpg
Jun 21 2021, 8:04 PM
F34519271: 03.jpg
Jun 21 2021, 8:04 PM
F34519256: 02.jpg
Jun 21 2021, 8:04 PM
F34519259: 01.jpg
Jun 21 2021, 8:04 PM
F34519241: 02.jpg
Jun 21 2021, 7:56 PM
Tokens
"Like" token, awarded by Sdkb.

Description

As a Commons administrator, I often have to navigate to pages that don't currently already exist (to create them, undelete them, view logs, etc). I usually do this by entering the page title into the search bar at the top of the page. If I enter the name of a nonexistent page into MediaSearch, I only see a message telling me there are no results. In Special:Search, I get a link to the page, even if it does not exist.

image.png (414×764 px, 39 KB)

Design and Acceptance criteria:
Add the red link into the same top left area and style as other search messaging like "Did you mean"

02.jpg (656×1 px, 96 KB)
If we have multiple lines of messaging, let's put the red link below
03.jpg (656×1 px, 100 KB)
Although less common of a use case, let's replicate this work on mobile web as well
01.jpg (1×726 px, 116 KB)

This update will only apply to the categories and pages tab

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Thanks @AntiCompositeNumber, this seems like an important addition to Media Search.

First two ideas that come to mind:

  1. At the top left of the results area
    02.jpg (656×1 px, 95 KB)
  1. Below the "No results found" messaging
    01.jpg (656×1 px, 95 KB)

I think I prefer #1 as it matches to where I'd expect to find it and how Special:Search currently treats it.

The "Did you mean" link also appears in that top-left corner, so that makes sense to me. Since they'll often appear together, it's worth considering the relative order there too.

Redlink below:

image.png (570×943 px, 96 KB)

Redlink above:

image.png (664×945 px, 114 KB)

I think redlink below works better.

Good point. I agree that the red link works better below any spelling correction messaging. I'll bring this ticket up in our next team/estimation meeting to keep it moving, thanks!

02.jpg (656×1 px, 95 KB)
01.jpg (656×1 px, 100 KB)

Will pick this up as a task post estimation.

Question about this – a redlink is used to create a new text page at a specific name. But most of the results here will really correspond to File pages. Most Commons users probably use UploadWizard to create new File pages as opposed to following redlinks (and then the name is based on the name of the uploaded file by default).

How often will it be useful to prompt users to create a new wikipage in the general namespace when a result is not found?

Question about this – a redlink is used to create a new text page at a specific name. But most of the results here will really correspond to File pages. Most Commons users probably use UploadWizard to create new File pages as opposed to following redlinks (and then the name is based on the name of the uploaded file by default).

How often will it be useful to prompt users to create a new wikipage in the general namespace when a result is not found?

I believe @mwilliams was going to revise the design to just include redlinks on the Categories & Pages tab?

@CBogen @egardner Updated the description and designs to show that this happens on the Categories & Pages tab.

CBogen renamed this task from MediaSearch should include a redlink when no results are found to [M] MediaSearch should include a redlink when no results are found .Jul 14 2021, 4:32 PM

Currently there is no readily available and performant method of checking whether or not an article exists with javascript.

mw.title.exists() doesn’t actually do what it implies. An API query call to check the page’s existence isn't that performant from a user experience perspective.

Me and Eric will be looking over this task together on his return.

From @egardner :

This is blocked by a piece of the core MW js API (mw.title.exists) not doing what we need to do to support this feature in Special:MediaSearch. It may be possible to change that behavior but that's probably a spike or task unto itself.

Special:MediaSearch relies much more heavily on Javascript than Special:Search does (it's more interactive, etc). The ability to determine when you need a redlink is much better supported in PHP than in JS. So Special:Search can rely on this behavior but it is harder for us to do so.

We may be able to update the relevant part of Mediawiki code to change this but more investigation will be required.

Special:Search runs every search through PHP as a new page request (and thus can get the proper info about whether or not a given page exists). Mediasearch runs the first query through PHP and then all subsequent searches through JS unless the user forcibly reloads the page. This is a smoother user experience but has certain limits as well.

Whether the page exists or not is not that important. If it exists, a link to the page should naturally be given, if not, we want the redlink. With some neutral wording, MediaSearch does not need to know whether the page exists. It could e.g. tell "You searched for [link]."

Whether the page exists or not is not that important. If it exists, a link to the page should naturally be given, if not, we want the redlink. With some neutral wording, MediaSearch does not need to know whether the page exists. It could e.g. tell "You searched for [link]."

The interface still needs to know if the page exists or not to determine whether to show a redlink or a bluelink.

I think it would make most sense to add it to the searchinfo field from the search generator API response.