Skip to content

Conversation

Sereza7
Copy link
Contributor

@Sereza7 Sereza7 commented Aug 28, 2025

Jira URL

https://jira.xwiki.org/browse/XWIKI-22602

Changes

Description

  • Updated the flamingo theme class to add a text alternative
  • Updated the theme editor
  • Used the new variable in the template (default is the value used previously)

Clarifications

  • Note that AFAIK this has no impact for sighted users. When hovering the picture, since it's part of the anchor with a title, the title of the anchor is shown ("Home"). However it's useful information for screen reader users and any assistive tech users :)
  • I just took the first unused number for the logo-description field of the theme class. This means that in the class editor it's far from the logo field, but since this class has a custom editor it doesn't matter much. I'd rather do that than increment the numbers of all the fields after logo...

Screenshots & Video

Here is a view of the generated DOM with the changes applied and the value Organization Name set as the logo description:
image

We can see that the tooltip on hover just displays "Home", but the image has the proper text alternative.

Executed Tests

Built changes successfully with mvn clean install -f xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources -Pquality and mvn clean install -f xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-theme/xwiki-platform-flamingo-theme-ui -Pquality
Tested the change on my local instance, it worked as expected (see above).

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • None, this is a change to a pretty sensitive class.

…xt from the colorTheme

* Updated the flamingo theme class to add a text alternative
* Updated the theme editor
* Used the new variable in the template (default is the value used previously)
…xt from the colorTheme

* Changed the prettyName to fit with other prettyNames in the ThemeClass
Copy link
Contributor

@michitux michitux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much! I think in general this is a great feature, my primary complaint is that it is probably non-obvious for admins where this value is used and how it should be set.

…xt from the colorTheme

* Updated the object number
…xt from the colorTheme

* Added the hint on the logo-description field
@Sereza7 Sereza7 requested a review from michitux September 4, 2025 14:44
@@ -745,6 +754,12 @@ require(['jquery', 'xwiki-l10n!xwiki-flamingo-theme-messages', 'bootstrap'], fun

#iframe {
height: 400px;
}

.xHint {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if we didn't need that. Putting the xform class on any parent element wasn't an option/would break too much?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/FrontendResources/VerticalForms/ , we should put it on the parent form tag.

I tested quickly in the inspector and it seems like it overrides the custom boldness of field names:

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, probably not good to perform this change now. Maybe just add a comment in the CSS that this should be refactored to properly use the vertical forms standard (currently, it's missing the wrapping definition list).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this again, I just noticed that this selector is very broad. Please scope this selector to really only affect the color theme editing form.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a On demand only style sheet used only in this context, I figured it was okay. Note that extension.css has a similarly very wide selector for the class:

.xHint {
color: $theme.textSecondaryColor;
font-size: smaller;
margin: 0.3em 0;
}

I increased specificity in 1f101d5 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These kinds of wide selectors tend to create problems when other UI elements use the same class. Imagine a panel containing a form with a hint. I remember fixing a similar issue with the quick search that was influenced by some other CSS (but I can't find the Jira issue anymore).

@@ -108,6 +108,7 @@ platform.flamingo.themes.defaultvalue=Default
platform.flamingo.themes.lessCode.description=In this field, you can directly write LESS code which will be added into the skin.
platform.flamingo.themes.local=Local
platform.flamingo.themes.global=Global
FlamingoThemesCode.ThemeClass_logo-description.hint=Alternative text to the logo. It should describe the logo's meaning. Default: "Logo of the wiki"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a comment above this to mention the other translation key with which the default value needs to be synchronized.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the mention of the translation inside the hint itself, from what you described in your other comment it made more sense.

Added in 913ce37 👍

@michitux
Copy link
Contributor

michitux commented Sep 4, 2025

Seeing the translation with the default value mentioned, I'm wondering something: in a multilingual wiki, shouldn't it be possible to localize the description of the logo? In theory, actually, also the logo itself should be localized (at least some organizations include a slogan in their logo that is translated in other languages)…

…xt from the colorTheme

* Updated the translation to mention the localized value.
@Sereza7
Copy link
Contributor Author

Sereza7 commented Sep 8, 2025

Seeing the translation with the default value mentioned, I'm wondering something: in a multilingual wiki, shouldn't it be possible to localize the description of the logo?

I added info in the hint to make it a bit clearer that by using this field, the user is losing on the default localization. In a multilingual wiki, it's still possible to localize the description of the logo, but instead of filling up this field, the user needs to update all the translations.

Copy link
Contributor

@michitux michitux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for the changes. Overall, this looks good to me, just two last comments.

@@ -745,6 +754,12 @@ require(['jquery', 'xwiki-l10n!xwiki-flamingo-theme-messages', 'bootstrap'], fun

#iframe {
height: 400px;
}

.xHint {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, probably not good to perform this change now. Maybe just add a comment in the CSS that this should be refactored to properly use the vertical forms standard (currently, it's missing the wrapping definition list).

…xt from the colorTheme

* Added a comment for further improvements.
@Sereza7
Copy link
Contributor Author

Sereza7 commented Sep 9, 2025

Yeah, probably not good to perform this change now. Maybe just add a comment in the CSS that this should be refactored to properly use the vertical forms standard (currently, it's missing the wrapping definition list).

Done in 5f1ab3c 👍

…xt from the colorTheme

* Increased specificity of the added styles
…xt from the colorTheme

* Replaced curved quote in the translation with a double quote.
@michitux michitux merged commit 23ce728 into xwiki:master Sep 9, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants