Page MenuHomePhabricator

Break out search stuff in TextInputWidget into SearchInputWidget
Closed, ResolvedPublic

Description

From @matmarex's comment on https://gerrit.wikimedia.org/r/#/c/283652/

  • No changes to TextInputWidget (except maybe a deprecation warning?), introduce SearchInputWidget that just does calls parent constructor with { type: 'search' } – this would be just a deprecation, code depending on OOjs UI could be updated to use new SearchInputWidget
  • Revert changes from step 1 and do this change – this would be a breaking change, but hopefully all code was already updated by this point

Event Timeline

Change 283652 had a related patch set uploaded (by Prtksxna):
Break out parts of TextInputWidget into a new SearchInputWidget

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

@Jdforrester-WMF When should we schedule the second part of this?

Change 283652 merged by jenkins-bot:
Break out parts of TextInputWidget into a new SearchInputWidget

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

@Jdforrester-WMF When should we schedule the second part of this?

Deprecation will go out in the next release (0.18.0), flagged in the notes; following our practice, that means we should find and fix all users in Wikimedia git, and wait a couple of weeks.

Change 333584 had a related patch set uploaded (by Prtksxna):
[BREAKING CHANGE] TextInputWidget: Remove search related methods

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

Getting this on https://www.mediawiki.org/w/index.php?search=Example

TextInputWidget: config.type='search' is deprecated. Use the SearchInputWidget instead. See T148471 for details.

  • MwWidgetsTitleInputWidget
    • MwWidgetsSearchInputWidget
      • OO.ui.infuse

Eeeks!

mw.widgets.SearchInputWidget is using config.type = 'search'. It's doing so as it inherits from mw.widgets.TitleInputWidget, which inherits from OO.ui.TextInputWidget. We can't have TitleInputWidget inherit from OO.ui.SearchInputWidget because not all of its uses are search related. I am not able to figure out an obvious way to fix this.

Screen Shot 2017-03-09 at 3.14.20 PM.png (104×241 px, 17 KB)
Screen Shot 2017-03-09 at 3.14.24 PM.png (117×287 px, 21 KB)

Hm, I guess we need to implement OO.ui.SearchInputWidget functionality in mw.widgets.SearchInputWidget. That shouldn't be too difficult.

Change 342718 had a related patch set uploaded (by Bartosz Dziewoński):
[mediawiki/core] mw.widgets.SearchInputWidget: Do not pass type: 'search' to TextInputWidget

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

I'm not really sure why mw.widgets.SearchInputWidget inherits from mw.widgets.TitleInputWidget, most of its code seems to be workarounds for its behaviors… oh well, some other time.

Change 342718 merged by jenkins-bot:
[mediawiki/core] mw.widgets.SearchInputWidget: Do not pass type: 'search' to TextInputWidget

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

Change 342773 had a related patch set uploaded (by Jforrester; owner: Bartosz Dziewoński):
[mediawiki/core] mw.widgets.SearchInputWidget: Do not pass type: 'search' to TextInputWidget

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

Change 342773 merged by jenkins-bot:
[mediawiki/core] mw.widgets.SearchInputWidget: Do not pass type: 'search' to TextInputWidget

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

Mentioned in SAL (#wikimedia-operations) [2017-03-15T18:34:13Z] <legoktm@tin> Synchronized php-1.29.0-wmf.16/includes/widget/SearchInputWidget.php: mw.widgets.SearchInputWidget: Do not pass to TextInputWidget - T148471 (1/2) (duration: 00m 41s)

Mentioned in SAL (#wikimedia-operations) [2017-03-15T18:35:32Z] <legoktm@tin> Synchronized php-1.29.0-wmf.16/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js: mw.widgets.SearchInputWidget: Do not pass to TextInputWidget - T148471 (2/2) (duration: 00m 42s)

Change 333584 merged by jenkins-bot:
[oojs/ui@master] [BREAKING CHANGE] TextInputWidget: Remove search related methods

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

Jdforrester-WMF moved this task from Next-up to OOjs-UI-0.22.0 on the OOUI board.
Jdforrester-WMF edited projects, added OOUI (OOjs-UI-0.22.0); removed OOUI.