Last modified: 2014-11-01 01:22:50 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T72968, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70968 - OOjs UI: InlineMenuWidget is not a kind of MenuWidget and should be renamed
OOjs UI: InlineMenuWidget is not a kind of MenuWidget and should be renamed
Status: RESOLVED FIXED
Product: OOjs UI
Classification: Unclassified
Technical Debt (Other open bugs)
unspecified
All All
: Normal enhancement
: ---
Assigned To: Bartosz Dziewoński
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-17 22:24 UTC by Tisza Gergő
Modified: 2014-11-01 01:22 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Tisza Gergő 2014-09-17 22:24:08 UTC
Expected syntax:

  var menu = new oo.ui.InlineMenuWidget();
  menu.addItems( items );
  menu.chooseItem( item1 );
  menu.on( 'select', doStuff );

Actual syntax:

  var menu = new oo.ui.InlineMenuWidget();
  menu.getMenu().addItems( items );
  menu.getMenu().chooseItem( item1 );
  menu.getMenu().on( 'select', doStuff );

This feels unintuitive (especially with on() which is misleading to debug since InlineMenuWidget has its own event handling but it never fires any events). That InlineMenuWidget calls the functionality of MenuWidget via composition is an implementation detail that should have no effect on the interface.
Comment 1 Bartosz Dziewoński 2014-10-04 20:31:26 UTC
InlineMenuWidget is just one of the wrappers for MenuWidget (the other is ComboBoxWidget) and not a MenuWidget itself, so it kind of makes sense for it to have a different interface (even if it is surprising at first).

Do you think we should duplicate the public API of MenuWidget on InlineMenuWidget (including re-emitting events)? We'd probably want to do the same for ComboBoxWidget if yes (I think there is value in keeping their interfaces similar). I'm not entirely sure if we should do this, though.

Or perhaps we should just rename InlineMenuWidget to DropdownWidget or something to avoid name confusion?
Comment 2 James Forrester 2014-10-29 22:53:18 UTC
Renaming seems sane.
Comment 3 Gerrit Notification Bot 2014-10-30 21:35:27 UTC
Change 170171 had a related patch set uploaded by Bartosz Dziewoński:
[BREAKING CHANGE] Rename InlineMenuWidget → DropdownWidget

https://gerrit.wikimedia.org/r/170171
Comment 4 Gerrit Notification Bot 2014-10-30 21:54:33 UTC
Change 170175 had a related patch set uploaded by Bartosz Dziewoński:
Update OOjs UI to v0.1.0-pre (d6dbeb1ce6)

https://gerrit.wikimedia.org/r/170175
Comment 5 Gerrit Notification Bot 2014-10-30 21:55:04 UTC
Change 170179 had a related patch set uploaded by Bartosz Dziewoński:
Change OO.ui.InlineMenuWidget → OO.ui.DropdownWidget for OOUI upgrade

https://gerrit.wikimedia.org/r/170179
Comment 6 Gerrit Notification Bot 2014-10-31 23:00:37 UTC
Change 170171 merged by jenkins-bot:
[BREAKING CHANGE] Rename InlineMenuWidget → DropdownWidget

https://gerrit.wikimedia.org/r/170171
Comment 7 Gerrit Notification Bot 2014-10-31 23:37:28 UTC
Change 170175 merged by jenkins-bot:
Follow-up Ifb7ffb1: Update demo.js for breaking OOUI change

https://gerrit.wikimedia.org/r/170175
Comment 8 Gerrit Notification Bot 2014-11-01 01:22:21 UTC
Change 170179 merged by jenkins-bot:
Change OO.ui.InlineMenuWidget → OO.ui.DropdownWidget for OOUI upgrade

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links