ProfessionalWiki / chameleon

Provides a highly flexible and customizable skin using Bootstrap 4
https://www.mediawiki.org/wiki/Skin:Chameleon
Other
115 stars 63 forks source link

Display only username in PersonalTools #343

Closed mdoggydog closed 1 year ago

mdoggydog commented 1 year ago

I'd like to be able to display only the username on the PersonalTools dropdown button. The current behavior when showUserName is enabled is to show the user's realname, and only show the username if the user has no realname. In our environment, not all of our users have realnames and we uniformly identify ourselves by username, so that inconsistency is kind of off-putting.

I'd be happy to try submitting a patch for this myself, but my main question is, what would be the preferred way to address this functionality in a layout file? Some options that come to mind:

  1. Retain backwards compatibility with the existing but-confusingly-named showUserName option:
    • showUserName = "no" - show nothing
    • showUserName = "yes" - try showing a realname, but fallback to username
    • showUserName = "username-only" - show only the username
  2. Take the opportunity to clear-up the meaning of showUserName:
    • showUserName = "no" - show nothing
    • showUserName = "yes" - show only the username
    • showUserName = "try-realname" - try showing a realname, but fallback to username
  3. Retain boolean values (as deprecated) for backwards compatibility, but focus on clear new non-boolean values:
    • showUserName = "none" - show nothing
    • showUserName = "try-realname" - try showing a realname, but fallback to username
    • showUserName = "username-only" - show only the username
    • showUserName = "no" (deprecated) - show nothing
    • showUserName = "yes" (deprecated) - try showing a realname, but fallback to username

Personally, I prefer option 3 (because it bugs me that "showUserName = yes" does not just show a username).

mdoggydog commented 1 year ago

I went ahead and submitted a PR (#347) implementing "option 3", which I think will make the most sense to all of our future-selves.

(For what it's worth, I tested out all the new/old option values locally, and the code appears to actually do what it claims to do.)