Page MenuHomePhabricator

Indicate when search results are from redirects (sometimes)
Closed, ResolvedPublic3 Estimated Story Points

Description

Follow up work to T303013

Background

Typeahead Search results do not handle redirects properly.

User story

As a searcher I want to get the relevant content to my search.

Requirements

BDD

  • For QA engineer to fill out

Test Steps

  • For QA engineer to fill out

Design

Sometimes we should indicate that the search result is a redirect, for example:

image.png (1,092×502 px, 155 KB)

However sometimes we should not indicate that the search result is a redirect because it would be redundant, for example:

image.png (1,092×332 px, 94 KB)

Acceptance criteria

  • Add acceptance criteria

Communication criteria - does this need an announcement or discussion?

  • Add communication criteria

Rollback plan

  • What is the rollback plan in production for this task if something goes wrong?

This task was created by Version 1.2.0 of the Web team task template using phabulous

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

On Weird Gloop's wikis, we've actually backported Vector 2022's search into old Vector (we don't intend to switch to Vector 2022 in the near-term, but desire the new search functionality). Part of this has been implementing a change that allows us to show the names of redirects on the suggestion items.

I'm happy to adapt & submit a patch here that shows the name of the redirect in supportingText, as it seems relatively straight forward. Would you prefer using the exact text from the Redirectedfrom i18n message that already exists? (if so, should we use that message directly or create a new one?)

Aklapper changed the task status from In Progress to Open.Mar 22 2025, 7:24 AM

Resetting task status from "In Progress" to "Open" as this task has been "in progress" for more than two years.

Change #1180541 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/core@master] [skinning.typeaheadSearch] Add redirectedfrom for redirects

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

Test wiki created on Patch demo by Jdlrobson using patch(es) linked to this task:
https://fbc97568da.catalyst.wmcloud.org/w/

Jdlrobson-WMF added subscribers: Sneha, Jdlrobson-WMF.

LGTM but in the mock the font size is a little smaller

Screenshot 2025-08-28 at 5.12.13 PM.png (1,176×1,454 px, 323 KB)

I'd want @Sneha to look at this before committing to a fix.

@Jdlrobson The ‘redirect’ text in the screenshot above seems to be using the same style as the short description. However, the mocks attached in the task description has different style (colour, size). It would be better to match the original mocks as it would help prevent the ‘redirect’ text from blending too closely with the short descriptions.

Sorry I could have rephrased that better:

  1. Are the mocks in the description still up to date?
  2. What specific size and color from Codex design tokens should be used?

@Jdlrobson I don't have visibility on the original mocks. But the styling looks good to me and I tried to recreate it in Figma and seems like the size we should be using here is 12/normal weight

Okay starting a estimation thread!

Jdlrobson-WMF set the point value for this task to 3.

Per async estimation

Test wiki created on Patch demo by Jon (WMF) using patch(es) linked to this task:
https://7e2b2fc582.catalyst.wmcloud.org/w/

This LGTM
https://7e2b2fc582.catalyst.wmcloud.org/
Please try searching for "Corn"

@Sneha @HFan-WMF any issues with merging this?

The patch demo looks great to me. Can we test it on a couple non-english wikis? Although I can't think of good redirects off the top of my head.

Someone should try with long words and long redirects

@Jdlrobson in the patch demo the title is vertically centred aligned without a caption. The layout looks different from the standard search result and what is shown in the design.

For long titles, I am guessing the line will get truncated with three dots?

As a follow-up of T306150: API: Include redirects to sections or anchors (with fragment), the UI should display section name when redirect target is a section. The current patch does not solve this use case.

Change #1328669 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] DO NOT MERGE: patchdemo config

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

Change #1328670 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] DO NOT MERGE: patchdemo config

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

Test wiki created on Patch demo by Jon (WMF) using patch(es) linked to this task:
https://06fd5c7390.catalyst.wmcloud.org/w/

Test wiki created on Patch demo by Jon (WMF) using patch(es) linked to this task:
https://6b172e07a0.catalyst.wmcloud.org/w/

Here's some patchdemos you can use with real content:

the UI should display section name when redirect target is a section

This is not in scope for this ticket. I suggest creating a ticket for this so it can be discussed separately in a follow up to avoid scope creep and delaying a fix here. The search item links to the right hash fragment so we're good on that part here.

For long titles, I am guessing the line will get truncated with three dots?
Someone should try with long words and long redirects

Try "The Sad But True Story of Ray Mingus, the Lumberjack of Bulk Rock City, and His Never Slacking Stribe in Exploiting the So Far Undiscovered Areas of the Intention to Bodily Intercourse from the Opposite Species of His Kind"

Screenshot 2026-08-24 at 9.39.17 AM.png (548×324 px, 69 KB)

The patch demo looks great to me. Can we test it on a couple non-english wikis?

See patchdemo links above.

Although I can't think of good redirects off the top of my head.

https://en.wikipedia.org/wiki/Special:ListRedirects
https://he.wikipedia.org/wiki/Special:ListRedirects

Change #1328741 had a related patch set uploaded (by Samwilson; author: Samwilson):

[design/codex@main] MenuItem: Small font size for supporting text

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

the UI should display section name when redirect target is a section

This is not in scope for this ticket. I suggest creating a ticket for this so it can be discussed separately in a follow up to avoid scope creep and delaying a fix here. The search item links to the right hash fragment so we're good on that part here.

I thought it was in scope since you wrote

The UI portion of this fix is now fully captured in T303013.

Never mind, I just open T436025: Page search UI should display section name when redirect target is a section.

Change #1328741 merged by jenkins-bot:

[design/codex@main] MenuItem: Small font size for supporting text

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

Change #1328670 abandoned by Jdlrobson:

[mediawiki/skins/Vector@master] DO NOT MERGE: patchdemo config

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

Change #1328669 abandoned by Jdlrobson:

[mediawiki/skins/Vector@master] DO NOT MERGE: patchdemo config

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

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

https://fbc97568da.catalyst.wmcloud.org/w/

Change #1338266 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/core@master] Update Codex from v2.6.2 to v2.7.0

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

Change #1338266 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v2.6.2 to v2.7.0

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

Change #1180541 merged by jenkins-bot:

[mediawiki/core@master] [skinning.typeaheadSearch] Add redirectedfrom for redirects

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

Jdlrobson-WMF lowered the priority of this task from Medium to Low.Sep 10 2026, 11:27 PM

(This change will roll out on next week's train)

Test wiki on Patch demo by Jon (WMF) using patch(es) linked to this task was deleted by Catalyst admin via Cron DeleteExpiredWikis:

https://7e2b2fc582.catalyst.wmcloud.org/w/

stjn subscribed.

Would be nice to announce this change even if after it happened. Something like In the default skins on desktop and mobile, Vector 2022 and Minerva, search now informs users if their search suggestions come from page redirects. Old search experience in other skins does not have this feature.

Thanks for the nudge here, @stjn ! We'll include a short announcement in an upcoming TechNews. I appreciate you looking out for us and for the community, as always!

Test wiki on Patch demo by Jon (WMF) using patch(es) linked to this task was deleted by Catalyst admin via Cron DeleteExpiredWikis:

https://06fd5c7390.catalyst.wmcloud.org/w/

Test wiki on Patch demo by Jon (WMF) using patch(es) linked to this task was deleted by Catalyst admin via Cron DeleteExpiredWikis:

https://6b172e07a0.catalyst.wmcloud.org/w/