Page MenuHomePhabricator

Indicate when search results are from redirects (sometimes)
Open, MediumPublic3 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 (502×1 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 (332×1 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

Event Timeline

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

The DST tentatively agreed that this task shouldn't be considered a blocker for the first release of Codex's TypeaheadSearch. We'll have to decide whether the improvement should be implemented by Codex (e.g. include a slot in menuItem) or handled by the application.

Removing WVUI with TypeaheadSearch now building on top of Codex and T310243.

@Jdlrobson @TJones — what is needed in order to make this change? Is there Search API stuff that needs to be changed, or is it mostly client/front-end work? cc @ovasileva @ldelench_wmf

@Jdlrobson @TJones — what is needed in order to make this change? Is there Search API stuff that needs to be changed, or is it mostly client/front-end work? cc @ovasileva @ldelench_wmf

Sorry, I don't know. I'm not familiar with the implementation plan. If whoever is doing the implementation needs help with the API or other implementation details, they can come talk to the Search team.

This is purely a Codex task at this point for the design systems team (with assistance from web team).

The API currently returns matchedTitle field to significant a redirect: https://en.wikipedia.org/w/rest.php/v1/search/title?q=Corn&limit=10 so I don't think any API changes are needed at this point. The TypeaheadSearch component would need an update to support an optional title annotation field at which point Vector would be able to pass in the content in the brackets.

The TypeaheadSearch component would need an update to support an optional title annotation field at which point Vector would be able to pass in the content in the brackets.

This sounds sensible to me. In the context of the WiKit Design System, we encountered a similar scenario where we needed to indicate extra information about particular suggestions in the Lookup component. We decided to make room for these labels in the component configuration:

Screenshot 2022-09-30 at 18.19.37.png (397×601 px, 49 KB)

From a system's perspective, we should decide whether the potential new slot should live in TypeaheadSearch or maybe (in order to cover further use cases) the MenuItem component.

The component spec sheet for the menu item with supporting text has been created in T323987 and it's ready to be implemented in Codex.

AnneT moved this task from Inbox to Following on the Design-System-Team board.

Moving this to "following" since we are completing the Codex part (T323987) but likely won't implementing supporting text for redirects in Vector (this task).

@ovasileva @Jdlrobson this is ready for us to pick up, though temporarily blocked until on the release of the updated MenuItem component, which will happen next week (which means it’ll ride the train the following week).

ovasileva triaged this task as Medium priority.Nov 29 2022, 5:45 PM
ovasileva moved this task from Incoming to Current Fiscal Year on the Web-Team-Backlog-Archived board.

MenuItem is now available AFAIK

Indeed, the new supportingText prop was included in the Codex release yesterday (0.4.0).

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×1 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