Page MenuHomePhabricator

Progressive buttons broken in OOUIHTMLForm
Closed, ResolvedPublic

Description

Default:

htmlform-progressive-button-old.png (46×138 px, 2 KB)

OOUI:
htmlform-progressive-button-ooui.png (66×166 px, 2 KB)

Screenshot made at Special:OAuthManageMyGrants/update.

Event Timeline

Tgr raised the priority of this task from to Needs Triage.
Tgr updated the task description. (Show Details)
Tgr added a project: MediaWiki-HTMLForm.
Tgr added a subscriber: Tgr.

Not sure if this is the same as T98903? The button is created via

$form->addButton( 'update',
	$this->msg( 'mwoauthmanagemygrants-update' )->text(),
	null,
	array( 'class' => 'mw-ui-button mw-ui-primary' )
);

Same for destructive buttons (e.g. Special:OAuthManageMyGrants/revoke).

Cherry-picking https://gerrit.wikimedia.org/r/#/c/218149/1 does not help, so this is probably an unrelated bug.

Hmm. The current code results in a plain OOUI button with additional 'mw-ui-button mw-ui-primary' CSS classes, which obviously doesn't work well. We should either try to "parse" the 'class' attribute and convert some magic classes to OOUI\ButtonInputWidget 'flags' config option, or allow passing flags to addButton() somehow and update callers. Not sure which would make more sense.

I don't know which is easier to implement, but from a distance, passing flags certainly sounds cleaner.

Hmm. It seems that you should already be able to do it. Does passing array( 'flags' => array( 'primary' ) ) instead of array( 'class' => 'mw-ui-button mw-ui-primary' ) give the desired result?

(You'll actually want array( 'flags' => array( 'primary', 'progressive' ) ); OOUI 'primary' flag doesn't include 'progressive' flag, unlike MediaWiki UI.)

Tgr claimed this task.

That works, thanks!