Page MenuHomePhabricator

Create new widget for selecting a timezone
Closed, ResolvedPublic

Description

Special:Preferences has a cool timezone selector, but all the relevant code is inside DefaultPreferencesFactory. It should be moved out of there, and become a reusable widget.

Acceptance Criteria:

  • Pull the list of timezone preferences so we can have a list of timezone options
  • Create a new widget for selecting a timezone

Event Timeline

Change 802495 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] Simplify timezone-related code for user preferences

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

Daimona renamed this task from Factor out list of timezones from preferences to Create new widget for selecting a timezone.Aug 19 2022, 5:36 PM
Daimona updated the task description. (Show Details)
Daimona removed the point value for this task.

Change 802794 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] Create an HTMLForm field for selecting a timezone

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

ldelench_wmf subscribed.

Hello Platform PMs and everyone involved with Foundational Technology Requests - the Campaigns team is looking for code review of the two attached patches:

We're targeting an end-of-October release date.

Hey @Daimona, @lbowmaker recommended that we ask @Samwilson if he has capacity to review these patches since he appears to have last touched the code in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/802794.

@Samwilson @NRodriguez @JMcLeod_WMF - would this be possible? We're in a bit of a bind here.

Change 802495 merged by jenkins-bot:

[mediawiki/core@master] Simplify timezone-related code for user preferences

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

Change 802794 merged by jenkins-bot:

[mediawiki/core@master] Create an HTMLForm field for selecting a timezone

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

Daimona added a subscriber: vaughnwalters.

@vaughnwalters We're not using the new widget yet, as this was only a core change. The only place that uses the new widget right now is Special:Preferences#mw-prefsection-rendering-dateformat. There should be no change in behaviour, so you could perhaps test that the timezone selector there works the same as it did before commit 090599c048b7827b138afb7851cfcd26d3c8bd2b.

Noting here that the timezone selector in the preferences is already broken for negative offsets, see T318455.

In the screencaps, The left side is before this commit , The right side is what is currently on betacluster.

The time offset widget is still functioning the same:

Screen Shot 2022-10-04 at 10.15.21 AM.png (872ร—3 px, 202 KB)

Negative offsets still broken in the same way as noted in T318455:

Screen Shot 2022-10-04 at 10.19.44 AM.png (508ร—3 px, 95 KB)

In Special:Preferences#mw-prefsection-rendering-dateformat I could find no discrepancies between before and after the refactoring to make it a reusable widget, so am moving this to product sign off.

The timezone widget has been implemented, so I'm marking this as Done. The work in T318455 will be handled separately.