The status quo doesn’t make sense to me, as I only want the current trust level to be apparent in a badge collection. Ideally I’d like it to be the most obvious badge on the user card too (i.e. always displayed in the same prominent location), but not as in-your-face as an avatar flair.
I’ve achieved close to this by replacing the default trust badges with some custom ones that use SQL and revert automatically. Can share them if you like.
I’m sorry, but I’m still not understanding. You started with “We updated our trust_levels unlocking them all” — doesn’t that, by simple definition, mean that all users have reached TL4, the top trust level?
You are correct - the SQL is visible in the ‘official’ badges and that is what it does. It also is set up to deliberately let the ‘lesser’ trust level badges hang around.
For example, here is the SQL for TL3:
SELECT u.id user_id, current_timestamp granted_at FROM users u
WHERE trust_level >= 3 AND (
:backfill OR u.id IN (:user_ids)
As you can’t edit the SQL on ‘official’ badges, my workaround was to simply clone each official badge and change the >= to simply =. This ensures that only one badge is given (at least once the old one has been revoked overnight).
I see now that this might be your actual problem - that the Titles remain on folk after they have lost their trust levels (and badges once revoked on the daily SQL check). I haven’t looked at this in detail to try and repro it, but have you unchecked “Allow badge to be used as title” for those?
I note that this is sorted on the new User Card experiment here in Meta :
That pretty much deals with the issue from my perspective. But it would be nice if it was also sorted on the /u/username/summary.
I’ve edited the title of the OP to reflect the focus more tightly. Had moved it to feature but then realised that we aren’t actually clear on that (yet) - keep going!