Talk:OOUI

Jump to navigation Jump to search

About this board

Previous discussion was archived at Talk:OOjs UI/Archive 1 on 2016-12-12.

OOUI widgets are painful to style via MediaWiki:Common/SkinName.css

1
88.113.111.150 (talkcontribs)

Wdgets implemented with OOUI, such as the new recent changes widget and its filters, are painful to style for wiki admins who maintain a custom theme but only have interface admin access. As far as I understand, the "correct" method for styling OOUI is described in OOUI/Themes and would require access to the server. I haven't studied this method of styling OOUI since it is of no use to me, but I assume it would be better than using MediaWiki interface message pages to override the default style.

By "painful" I mean several things, compared to modifying the core mediawiki CSS:

  • OOUI has far greater number of CSS rules than the entire core MediaWiki + skin!
  • Styling comparable wiki interface elements (in mw-ui, I believe) before OOUI was doable with a few simple CSS rules
    • Now the same level of interface skinning takes hundreds of high-specificity CSS rules
  • Redoing all the images takes a lot of work
    • Also requires questionable hosting choices or embedding into CSS as data-URIs. (Again, for wiki content admins with no access to the server)
  • The selectors are long with high specificity
    • Resulting in barely human-readable CSS
    • No easy way to style larger groups of elements at once (simplifying the style and selectors)
  • OOUI, especially when partially reskinned through MediaWiki interface pages, has measurable impact on page loading speed on slower end-user hardware.
    • The reskinned OOUI is loaded on every page load, and the full original OOUI CSS is also loaded when needed.

I don't know how common my position is (MediaWiki content admin also maintaining custom skin w/o direct server access) and I don't know the backend well enough to suggest a solution. Perhaps OOUI stylesheets could be moved to MediaWiki interface messages to at least allow ResourceLoader could handle it better in cases like this? In any case, the seperation of interface widget style from the rest of the skin seems counterproductive.

In my opinion OOUI styles are also too complex for what they do and could be greatly simplified with minimal loss of features, but I understand there may be use cases that require such a heavy interface library. OOUI definitely is on a different level than the rest of MediaWiki styling, for good or for bad.

Reply to "OOUI widgets are painful to style via MediaWiki:Common/SkinName.css"
GZWDer (talkcontribs)

See phab:T241180 - does it mean after migration from jQuery UI and MediaWiki UI to OOUI, we will migrate all special pages to Vue.js?

Jdforrester (WMF) (talkcontribs)

We don't know yet. Possibly we'll be able to re-tool OOUI to use Vue.js, possibly we'll create a new library for the same use cases, possibly something else. We're still at the exploratory stages.

Volker E. (WMF) (talkcontribs)

What @Jdforrester (WMF) said, we're currently exploring and evaluating different paths. In the short-term we're commited to continue development and maintainenance of OOUI as it's used widely in our ecosystem. When alternatives have been reached a production-ready level, it will highly-probable be deprecated.

76.68.157.110 (talkcontribs)

Will there be an attempt to remove jquery from ooui and switch to vanilla javacript?

Jdforrester (WMF) (talkcontribs)

No. We're already exceedingly sparing in where we use jQuery (only when it's faster than falling back to writing bespoke wrappers around native methods). As MediaWiki isn't planning to get rid of jQuery ever, the work to remove the last few uses when it's always around in the main environment for which we've built it isn't worth it.

76.68.157.110 (talkcontribs)

There seems to be a push to remove jquery from existing software (like github did). What exactly is the point of doing this? Is it really much slower in terms of execution and loading up the jquery file ? I'm debating whether I should try to remove jquery from my wikipedia setup. The thing is that I use OOUI rather extensively (dialogs and forms) and I'd have to say goodbye to OOUI. I feel like OOUI is too complicated, large and slow to load. My gut tells me I should stop doing anything with OOUI for the time being. I tried to use OOUI as much as possible instead of using other third party libraries, but I find it annoying that I have to load the entire thing just to infuse a form and get a modern look.

Jdforrester (WMF) (talkcontribs)

As I said, we aren't planning to get rid of jQuery from MediaWiki. Attempting to do so on a third party installation is very likely to go poorly. I would not advise it.

Reply to "Will OOUI be deprecated?"
184.20.10.253 (talkcontribs)

w/load.php?modules=oojs-ui.styles.icons-movement&image=next&format=rasterized&lang=en&skin=moonlight&version=1fr1rkk


I'm migrating a wiki via upgrade. The new installation uses ooui. It's images aren't rendering. I don't know what the requirement is. They appear as invisible user interfaces like with this (wiki/Sword_of_Moonlight/installing) slideshow. I finally realized they weren't showing at all, where previously I thought they were text labels only.


Wiki is en (dot) swordofmoonlight (dot) org


Volker E. (WMF) (talkcontribs)

Could you clarify what you mean by “not rendering”. Can you access one of the images directly? If not there could be several issues involved including a ResourceLoader issue. Are any icons shown. The URL you've provided doesn't seem to use an updated MediaWiki yet.

184.20.10.253 (talkcontribs)

The link is a direct link, that prints the error "Image generation failed". The wiki is upgraded to 1.33.1. The skin is based on an earlier version of MonoBook that I had to transfer to the new version. I think the new version is based on BaseTemplate instead of QuickTemplate but I didn't change that. I don't see anything in BaseTemplate that seems like OOUI would depend on its being there. But that's a possibility. I expect it's more likely something about my environment, but I'm open to anything.


BTW: I hacked in some Unicode triangles so that the slideshow buttons are visible, but those are unrelated to OOUI. Also there's a serious (unrelated) but in the slideshow I've reported here (Topic:Vcppuzq1pmnea4z3) that seems like staff should take very seriously and fix ASAP.

184.20.10.253 (talkcontribs)

*bug. Also, thank you for replying :)

MSchottlender-WMF (talkcontribs)

This sounds like there's a problem of the webserver itself to produce an image (png?) from the original svg. Could you check into whether imageMagick (or whatever library is set up?) works for you in general?

184.20.10.253 (talkcontribs)

ImageMagick is available and in use elsewhere. The upgrade web installer indicated it's in working order. I could try to do a test with an SVG file to see if can convert to a PNG for example... if you think that's a possibility. I don't know how to do that off the top of my head (I don't want to spend an afternoon figuring it out unless necessary.)

MSchottlender-WMF (talkcontribs)

The fact you're getting an empty message "Image generation failed" indicates to me that it's something about the server operation. I can be (very possibly) wrong, but I thought I'd point to this direction as something to verify, since I am not sure what else could prevent this other than making sure you run `composer update` and potentially `npm install`

Reply to "Image generation failed"

Getting OOUI object reference from an element?

2
137.147.133.11 (talkcontribs)

For example, I simply want to disable a button. Before I could just set the disabled property, but now I need to call the disable method on the button's OOUI object. If the button was a PHP object, I could infuse it to get the object, but for buttons created in JS (by other scripts I have no control over, for instance), infuse doesn't work.

Matma Rex (talkcontribs)

There is no way to do this. If the other script wanted you to be able to disable its button, it would allow you to get the OOUI object.

For example, the other script could do something like this:

fooWidget.$element.data( 'ooui', fooWidget );

…but if it doesn't, there's no way to get the OOUI object from the DOM element.

How I can binding widget to select?

2
37.45.167.171 (talkcontribs)

Hello. I want to add delete reasons by script.

OO.ui.DropdownWidget.static.infuse( $( '#' + $('#wpDeleteReasonList').parent().attr('id') ) ) .dropdownWidget.menu.addItems(new OO.ui.MenuOptionWidget({ data: data, label: label }), position);

It works fine, but when i choose one of my “custom reasons”, mediawiki not to provide it in delete log. For example, imgur.com/a/Bx9hb3m instead imgur.com/a/TI13zXT. What am I doing wrong?

37.45.167.171 (talkcontribs)

Sorry, wrong wikimarkup. I can’t edit previous message. My code:

OO.ui.DropdownWidget.static.infuse( $( '#' + $('#wpDeleteReasonList').parent().attr('id') ) ) .dropdownWidget.menu.addItems(new OO.ui.MenuOptionWidget({
    data: data,
    label: label
}), position);
Reply to "How I can binding widget to select?"
Ainz Ooal Gown (talkcontribs)

So I recently found out about OOUI and after that I have completely rewritten my script per OOUI. My script basically adds some buttons. I noticed that all buttons' styles are based on WikimediaUI. I want to use Apex and WikimediaUI together. How to do it? It's not like I don't like this WikimediaUI. It's just I don't prefer this style. Here's the link to my script w:en:User:Masumrezarock100/mobilemorelinks/common.js.

Jdforrester (WMF) (talkcontribs)

Hey there,

The OOUI theme is decided at the MediaWiki skin level, and not available for individual on-wiki tools to adjust, sorry.

Ainz Ooal Gown (talkcontribs)

Hmm, Thanks anyway.

Why OOUI has not been developed as a separate skin ?

2
Shawn (talkcontribs)

Can someone please explain to me why OOUI impacts all skins and has not been developed as a skin on its own. It would allows users to use the old beautiful "Vector" skin without all the ugly (on my opinon) changes made by OOUI. It makes using Wikipedia on a computer not very practical (widgets like text input, check boxes, radio buttons too big, too much spaces between elements...).

  • So why OOUI has not been developed as a separate skin ?
  • How to disable OOUI and revert back to legacy Vector skin ?
Jdforrester (WMF) (talkcontribs)

The OOUI library is not a skin, it's an interface toolkit designed to be the interface for all of MediaWiki. The equivalent question is why Firefox has been developed as a browser and not a website.

how can I see the code of the demos

2
ԱշոտՏՆՂ (talkcontribs)

Hi, there are nice demos here but I can't find there code. Help me, please.

Jayprakash12345 (talkcontribs)

Validating text field inputs as page names

2
Enterprisey (talkcontribs)

In a user script, how can I make a text field that validates its input as a page name?

Enterprisey (talkcontribs)

That would be a "TitleInputWidget", available in MediaWiki\Widget or mw.widgets.

How do I go back to mediawiki.UI for legacy reasons?

7
MitchTarps (talkcontribs)

I'm put in charge of a private wiki for a university here. I've been told to bring back the old UI, as apparently for the dean, "The new interface is too hard and fancy!". My job's on the line here. Can anyone tell me how the hell do I go back to mw-ui? I tried commenting all the dependencies in Resources.PHP and commented out OOjs style from ResourceLoader.PHP. Yet, I could not get a few forms like in the special:movepage to prevent generating the OOjs classes. Please tell me there is a way!

Whatamidoing (WMF) (talkcontribs)

I'm sorry; I don't know how to solve the technical problem. I can't even tell you whether it's possible.

On the human side, have you talked to the dean yourself about this? In my experience, these messages are not always accurately relayed, so if you think you're getting the message second- or third-hand, then it might be worth double-checking. Also, people's initial reaction often changes after they've used something a few more times. And, of course, it's possible that the dean has discovered a bug. In that case, I'd be happy to help you file a bug report.

MitchTarps (talkcontribs)

Yeah, I did. The university got used to the regular UI. They were using an old MediaWiki 1.21. I updated it on their request, fixed all the breaking changes. Now I'm tasked with removing the OOjs library or the UI elements for the least. So far, I have successfully stopped the OOjs core styles from loading up via resource loader. But most things like movepage and search are still using the OOjs UI elements. I see they are defined in that way. Is there a way to go back to mediawiki ui?

Jdforrester (WMF) (talkcontribs)

I'm afraid there's no easy way to keep a latest version of MediaWiki but without the OOUI design; moving all of MediaWiki to it has been a key part of the (still incomplete) marathon job of modernising all the interfaces. Depending on which skin you're using, the "Apex theme" (which loads for Monobook) might be more appealing to the design sensibilities of your users, but other than that I can only recommend reverting which version of MediaWIki you're using.

MitchTarps (talkcontribs)

I also noticed that due to this incomplete transition, some parts of MediaWiki is slow as well. I have submitted a request to revert back to the older version. The problem is I have to patch all the security updates manually. I literally fainted imagining that!

Matma Rex (talkcontribs)

I guess the OOjs UI widgets will mostly work fine if you remove (or heavily trim down) the styles. This is not supported and you will probably face all kinds of problems with tools which depend on OOjs UI more heavily (e.g. UploadWizard or VisualEditor), but if you're desperate… The style files are in /resources/lib/oojs-ui (see also Do not hack MediaWiki core).

Implementing an "unstyled" OOjs UI theme could probably be kind of cool, though. Maybe we should do that at some point.

Matma Rex (talkcontribs)

Also, like James suggested, try using the Apex theme instead – it's a lot less "modern-looking" (but still different from the old lack of styling). If you want it for Vector, you'll need to hack skins/Vector/skin.json and add the following at the end before "manifest_version": 1 (please note, the same warnings about hacking core apply here, but this is likely to cause a lot less problems):

	"SkinOOUIThemes": {
		"vector": "Apex"
	},