Wolfite.dev / Highlights

Obby Wiki•

IntegratedProfiles v0.7.0

Obby WikiMediaWiki

Originally I wasn't going to add anything to this post and just link to the release, but... I've decided to do it! There's some cool features anyway, and besides, it's always cool to write things as it gives you the chance to look back on it from the past. So, for the very few people actually reading this post, here are the new features in IntegratedProfiles v0.7.0!

Let me start off with the first breaking change; get_card_payload is getting swapped to get_preview_payload, and no longer requires the user cards feature! This feature was released relatively recently, so I don't expect anyone to be using it yet, but if you are, I'm sorry; I'll try to keep the breaking changes down to a minimum, but it is pre-v1 software, after all.

But, if you previously did not use the user cards feature at all, you can now use this new endpoint to get a bunch of details at once in order to construct your own mini-profile, or something like that. It returns a lot and is pretty optimized, especially for batched calls (get_preview_payloads_for_users).

For extensions:

if ( ExtensionRegistry::getInstance()->isLoaded( 'IntegratedProfiles' ) ) {
$profiles = MediaWikiServices::getInstance()
->get( 'IntegratedProfiles.ProfileService' );
$preview = $profiles->get_preview_payload( $user, $viewer );
// Or alternatively, for many users in a batch:
// $profiles->get_preview_payloads_for_users( $users, $viewer );
}

Or from the Action API:

action=query&list=integratedprofilepreview&ippuser=User1|User2|User3

It returns:

  • user
  • user_id
  • real_name (if applicable, this is just the MediaWiki setting)
  • about
  • location (self-described field on the user page)
  • website
  • edit_count
  • registration
  • avatar_url
  • has_custom_avatar
  • banner
  • banner_url
  • featured_article
  • is_private

Of course, privacy still applies to this API, so private user details will be omitted when appropriate.

This gives you the ability to integrate profiles anywhere with IP as the canonical source and editor, it is called IntegratedProfiles after all.

That's a larger feature than I thought it'd be, so I hope this next one doesn't disappoint, because I'm pretty happy with how it turned out:

IntegratedProfiles now has a built-in upload cropper! What that means is that during the process of uploading an image like an avatar or a banner, the user can now crop it however they'd like it.

You can drag around the frame or resize it. It also gives you a circular preview of what areas will be cut out from the masthead. Here's an example:

Say that I want to update my avatar to the new ALT image I made for Autumn Stage Tower for Halloween this year, I'd upload it, see that it'd be cropped (rather than awkwardly stretched), and adjust the image the way I want to.

This also works with banners, although it's more for guidance rather than enforcing an aspect ratio, since it differs between devices. It does, however, dim out anything surrounding what the frame would include for the user's current screen size.

I fixed a lot of issues with this before release, so if you had any issues with it previously (on the main branch), check it out again!

And that's it for large features. The rest of it was pretty much just housekeeping and chores. There were some pretty annoying bugs, so consider upgrading, including a lot of bugs in newer Citizen versions. You can also preview banners without them saving automatically, thanks to @t7ru!

You can check the full release notes for the release for more, it's on GitHub. The next release will probably focus on a few features regarding stability on farms, especially how cache is handled across clusters.

A few wikis are using this in production right now, but no farms are, I believe (aside from us, technically speaking). I still think it's fine to enable in production, but I wouldn't put it as a default or anything at least until v1.0.0; the first stable release (no schedule for that yet).

Maybe more next time?

TL;DR: get_card_payload turns into get_preview_payload and doesn't require user cards being enabled, you can now crop avatars and banners that you're uploading, performance improvements, both minor major improvements for Citizen, a few other bug fixes and performance improvements. Worth updating, migration should be pretty light.

Update•

Amendment: v0.6.0

It's a few days later, and I've remembered that I never made a post for v0.6.0. Here's a quick summary ICYMI.

You can now configure banner presets per-wiki, including on a farm!

$wgIntegratedProfilesBannerPresetImages = [
'custombanner1' => '/images/banners/custombanner1.webp',
'custombanner2' => 'https://static.wiki.local/banner2.webp'
];
$wgIntegratedProfilesBannerPresetDefault = 'custombanner1'; // only useful for single-wiki setups

On a single wiki these replace the gradient presets. Users without a custom upload get $wgIntegratedProfilesBannerPresetDefault if set, otherwise the first map entry. On a farm they appear below the gradients and only apply on that wiki. Do not set the map globally.

That's the only major feature, the rest in that update was mainly UI improvements and features. For one, the editor app is now lazy-loaded. Some checks were added to prevent unecessary requests, among other things.