Page MenuHomePhabricator

42: Add icons to some buttons in GlobalWatchlist.js
Closed, ResolvedPublic

Description

The script is currently icon-less. Let's decorate it with relevant icons.

User story

As a regular user of the GlobalWatchlist, I'd like to see some icons added to some OOUI buttons that are present in the script. It will look good too.

Icon list

All of these icons are present in OOUI.

In Special:BlankPage/GlobalWatchlist

Depends on oojs-ui.styles.icons-interactions

  • Add settings icon to the Settings button.
  • Add reload icon to the Refresh button.
  • Add check icon to Mark as seen buttons.
  • Add checkAll icon to Mark all sites as seen button.

In Special:BlankPage/GlobalWatchlistConfig

Depends on oojs-ui.styles.icons-movement

  • Add previous icon to the Global Watchlist button and probably rename the label to something like Return to Global watchlist.

Depends on oojs-ui.styles.icons-interactions

  • Add add icon to Add more button.
  • Add subtract icon to Remove buttons. (Declined)
  • Add clear icon to Reset changes made button. (used historyicon instead)

Event Timeline

Masumrezarock100 renamed this task from Add icons to some buttons to Add icons to some buttons in GlobalWatchlist.js.Oct 9 2019, 3:02 AM
Masumrezarock100 updated the task description. (Show Details)
DannyS712 renamed this task from Add icons to some buttons in GlobalWatchlist.js to 42: Add icons to some buttons in GlobalWatchlist.js.Oct 10 2019, 3:53 AM

To do list:

  • Investigate how icons are added to elements
  • Adapt OOUI helpers to allow optional icons
  • Add icons to elements

Icons can be added to buttons and other supported OOUI widgets. See the help page for adding icons to buttons on Mediawiki. If I am not mistaken, your script uses OO.ui.ButtonWidget to add normal buttons and OO.ui.ButtonInputWidget to add buttons to the form. So you can just use the icon attribute to add icons. Your script needs to be depended on some OOUI icon packs though.

I am not sure if terms such as Add more and Remove are needed. Those button label texts needs translation. IMO, they can be replaced by just icons (add and substract). I might be wrong though.

@DannyS712 If you don't mind, can I claim this task and submit a pull request? If so, then what version should I fork? Development version or the stable one?

And you have made the OOUI buttons widgets complicated functions. I will need to investigate too before submitting a patch. Lol

@DannyS712 If you don't mind, can I claim this task and submit a pull request? If so, then what version should I fork? Development version or the stable one?

And you have made the OOUI buttons widgets complicated functions. I will need to investigate too before submitting a patch. Lol

Absolutely. I've been meaning to come up with guidelines for others to contribute. You should

  • Claim this task
  • Fork the development version
  • Figure out if any new dependencies are needed for the icons
    • If so, add it to the `mw.loader.using
  • Take a look at my OOUI helpers
    • Note: These helpers are a poor man's version of factories
    • GlobalWatchlist.OOUI.makeButtonInput, .makeButtonInputSimpleE, and .makeButtonE are the ones to focus on
    • Tip: If the function name ends with E, it returns the .$element, not the object
  • Acceptance criteria:
    • Icon is optional - it is still possible to create ooui elements without icons
    • Whatever else you wanted

Ok, let me add all dependencies to the task description first and then I will work on this.

All of the icons except three last ones has been added. I also renamed the Global Watchlist name. I am having trouble understanding those last three buttons. You'll have to do the rest of the work. The diff is https://meta.wikimedia.org/w/index.php?title=User%3AMasumrezarock100%2FGlobal_watchlist.js&type=revision&diff=19555961&oldid=19555873.

All of the icons except three last ones has been added. I also renamed the Global Watchlist name. I am having trouble understanding those last three buttons. You'll have to do the rest of the work. The diff is https://meta.wikimedia.org/wiki/Special:Diff/19555873...19555961.

I was just reading through your edits. I'm not sure what last 3 buttons you are referring to?

This comment was removed by DannyS712.

All of the icons except three last ones has been added. I also renamed the Global Watchlist name. I am having trouble understanding those last three buttons. You'll have to do the rest of the work. The diff is https://meta.wikimedia.org/wiki/Special:Diff/19555873...19555961.

I was just reading through your edits. I'm not sure what last 3 buttons you are referring to?

Check the task description. I marked all of the tasks as done except last three buttons. Add more, Remove, and Reset changes made

All of the icons except three last ones has been added. I also renamed the Global Watchlist name. I am having trouble understanding those last three buttons. You'll have to do the rest of the work. The diff is https://meta.wikimedia.org/wiki/Special:Diff/19555873...19555961.

I was just reading through your edits. I'm not sure what last 3 buttons you are referring to?

Check the task description. I marked all of the tasks as done except last three buttons. Add more, Remove, and Reset changes made

Okay. https://en.wikipedia.org/w/index.php?title=User:DannyS712_test/Global_watchlist.js&oldid=926105217 should do the trick, but the "remove" icons take up a lot of room...

Okay. https://en.wikipedia.org/w/index.php?title=User:DannyS712_test/Global_watchlist.js&oldid=926105217 should do the trick, but the "remove" icons take up a lot of room...

See M289#4853 . It takes up a lot of room but if we omit the label, it would not.

Okay. https://en.wikipedia.org/w/index.php?title=User:DannyS712_test/Global_watchlist.js&oldid=926105217 should do the trick, but the "remove" icons take up a lot of room...

See M289#4853 . It takes up a lot of room but if we omit the label, it would not.

True, but I think the text is needed.

DannyS712 reassigned this task from DannyS712 to Masumrezarock100.

Icon for removing sites removed, everything else deployed as 5.3.0

Okay. https://en.wikipedia.org/w/index.php?title=User:DannyS712_test/Global_watchlist.js&oldid=926105217 should do the trick, but the "remove" icons take up a lot of room...

See M289#4853 . It takes up a lot of room but if we omit the label, it would not.

True, but I think the text is needed.

I see.

@DannyS712 not sure history icon is the best fit for Reset changes made button.

@DannyS712 not sure history icon is the best fit for Reset changes made button.

It looks the closest, imo. Feel free to suggest another icon. Unfortunately, I have to get off for a while - real life calls

clear icon was the most similar icon I could find and their names are kinda similar. And depending on another icon pack means, loading the whole icon pack (extra data usage). Well it's your script, you decide what to do.