Page MenuHomePhabricator

Add functionality to favourite icon in search results
Closed, ResolvedPublic5 Estimated Story Points

Description

This follows on from T377455: Add favourite icon to search results and is part of T377186: [STORY] New widget to search and favourite templates.

  • Set initial state of favourite icons, from mw.user.options.templatedata-favorite-templates.
  • Handle changing state: setting and unsetting a template's favourite status. Use mw.Api.saveOption() and mw.user.options.set(), and update the icon state.

The favourites are stored as an array of page IDs in mw.user.options.templatedata-favorite-templates.

This doesn't handle validation (see T377460: Notify user if they try to favourite a template when they already have the max number of favourites and T377729: Use SaveUserOptions hook to validate template favourites for that).

Event Timeline

Change #1122975 had a related patch set uploaded (by Samtar; author: Samtar):

[mediawiki/extensions/TemplateData@master] [WIP] templateData.templateDiscovery: Begin adding favouriting functionality

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

Change #1122975 merged by jenkins-bot:

[mediawiki/extensions/TemplateData@master] templateData.templateDiscovery: Begin adding favouriting functionality

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

KSiebert set the point value for this task to 5.Mar 6 2025, 10:30 AM
KSiebert changed the task status from Open to Stalled.Mar 27 2025, 10:38 AM
dom_walden subscribed.

Resolving as needing no extra, specific testing.