Page MenuHomePhabricator

PopupWidget header should allow for an icon and an optional 'x' close button
Closed, ResolvedPublic

Description

Right now, OO.ui.PopupWidget allows for a header, but the option takes header text only, and inserts it as a label. Also, if a header exists, we automatically get an "x" close button - that's not always necessarily needed, and the fact of having a header shouldn't be the thing that decides that.

We should:

  • Allow for an icon in the header, as follows from most other interfaces we have, that if exists, is placed before the header label
  • Make the 'x' close button a config option. Ideally, it would appear regardless of having a header, but at the very least give the option so it will not always appear with a header either.

Event Timeline

Mooeypoo created this task.May 10 2017, 4:59 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 10 2017, 4:59 PM

@Mooeypoo As from our conversation, I think the icon makes full sense.
I'm not sure about the config option of the 'x' icon though. What problem do you like to see solved here?

@Mooeypoo As from our conversation, I think the icon makes full sense.
I'm not sure about the config option of the 'x' icon though. What problem do you like to see solved here?

The problem is that our design dictates removing the 'x' icon for cases where your popup includes a form that has a "Cancel" button (which we use)

I'm not entirely sure if it's useful or not in this case, but since it was requested (For both RCFilters 'save link' feature, and for Echo popup) I thought it could be useful as a config option.

@Mooeypoo I see, that makes sense.

Volker_E triaged this task as Low priority.Jun 19 2019, 4:43 AM
Volker_E added a project: good first task.
Soda claimed this task.EditedMar 7 2020, 7:20 PM
Soda added a subscriber: Soda.

Try to figure it out ...

Soda added a comment.Mar 9 2020, 10:12 AM

@Volker_E I've been able to add code to widget/PopupWidget.js that allows adding an icon to the header and a config for toggling the x button. Do I need to get it to display on the demos page?

@Soda Yes, the demos should either update a PopupWidget with new configuration or if it's a specific enough, additional configuration add another one.

Change 578466 had a related patch set uploaded (by Sohom Datta; owner: Sohom Datta):
[oojs/ui@master] Added option to remove close button and add icon to PopupWidget head

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

Soda added a comment.Mar 14 2020, 11:30 AM

@Volker_E I've submitted a patch, could you take a look at it :)

Change 578466 merged by jenkins-bot:
[oojs/ui@master] PopupWidget: Add option to remove close button and add icon to widget head

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

Volker_E closed this task as Resolved.May 6 2020, 12:47 AM
Volker_E raised the priority of this task from Low to Medium.
Volker_E moved this task from Backlog to OOUI-0.39.0 on the OOUI board.
Volker_E edited projects, added OOUI (OOUI-0.39.0); removed OOUI.
Volker_E removed a project: Patch-For-Review.

Change 594750 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@master] Update OOUI to v0.39.0

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

Change 594750 merged by jenkins-bot:
[mediawiki/core@master] Update OOUI to v0.39.0

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