Page MenuHomePhabricator

Replacement for jquery.ui.position in Translate
Closed, ResolvedPublic

Description

I would suggest creating a task capturing how you are using jquery.ui.position and we can take it from there. As @Legoktm suggests I think we can create separate tickets for new deprecated modules and for rethinking existing deprecations. Please tag ResourceLoader and Frontend standards group on the new ticket.

I am using it for what it is made for: positioning an element relative to another element. For example:

280-            if ( $( 'body' ).hasClass( 'rtl' ) ) {
281:                    position = {
282-                            my: 'right top',
283-                            at: 'right+80 bottom+5'
284-                    };
285-            }
286-            $( '.tux-breadcrumb__item--aggregate' ).msggroupselector( {
287-                    onSelect: mw.translate.changeGroup,
288-                    language: state.language,
289:                    position: position,
290-                    recent: mw.translate.recentGroups.get()
291-            } );

This is part of the API for the module, so it is hard to think of any replacement which wouldn't basically do the same thing. I don't have ideas. I am puzzled why the module has been deprecated before possible replacements have been considered.

Event Timeline

I'm curious to what the following line does.

$( '.tux-breadcrumb__item--aggregate' ).msggroupselector

Could you add a screenshot.
I'm wondering if an existing OO.ui widget could be used in its place or if it's similar to any existing ones.

cc @matmarex

You could probably start with OO.ui.SearchWidget inside a OO.ui.PopupWidget. But this is a custom interface, so you'd need to do some custom coding.

If you just want to get rid of jquery.ui.position without changing the rest, it would probably be fairly easy to just move the DOM of that popup near to where the "All" link is (currently it's at the end of <body/>) and give it position: absolute and some margins in CSS to display it where you want it. But I don't know your codebase.

You could probably start with OO.ui.SearchWidget inside a OO.ui.PopupWidget. But this is a custom interface, so you'd need to do some custom coding.

And there go my hopes of getting visible progress on T102922 this quarter. I don't have any designer time allocated on this project. Just rewriting alone would be far from trivial to me.

If you just want to get rid of jquery.ui.position without changing the rest

I don't really want to get rid of jquery.ui.position. As far as I can see it is fulfilling my need to position elements well.

I don't see any reason why we can't set mobile targets on that module and keep its deprecated state if that's your only blocker and it's stopping you making progress. The module is not removed its only marked as deprecated. If making it available on mobile helps us improve the translate interface that's great.

I doubt it will work well in a mobile screen however where orientation can change so I suspect you will need to rework it later anyway.

I don't see any reason why we can't set mobile targets on that module and keep its deprecated state if that's your only blocker and it's stopping you making progress.

That would be lovely. As far as I know it's the only non-mobile module in Special:Translate which doesn't yet have a patch.

I doubt it will work well in a mobile screen however where orientation can change so I suspect you will need to rework it later anyway.

Yes there is definitely more work to do with incremental improvements. It will be easier to prioritize remaining issues when Special:Translate starts to work on mobile view, as then one can actually start using and testing it and seeing what are the pain points.

Thanks for your patience @Nikerabbit I really appreciate all the progress you've made on this so far.

Nikerabbit claimed this task.

This is resolved (for now).

I should try to remember to document in some release notes that Special:Translate will work in mobile view only in 1.28+.