Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWIKI-22504: Update icon names to respect our icon naming convention #2986

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Sereza7
Copy link
Contributor

@Sereza7 Sereza7 commented Mar 14, 2024

Jira URL

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

Changes

Description

  • Reordered the icon mappings for the three icon sets in the default flavor (default-- Silk, Silk and Font Awesome) to be alphabetical and not an approximative time order (that didn't help in any way when looking for a mapping).
  • Changed some icon names to fit the new icon naming convention
  • Added the legacy mappings in a special deprecated section.

Clarifications

  • These changes do not break any backwards compatibility. The introduction of the versioning for mappings will make it easier to maintain on the long term :)

Screenshots & Video

N/A

Executed Tests

N/A

A typo might break a mapping in one of the three themes. I don't think we have auto tests for those mappings.
I did my best to stay focused and provide the changes on the three files at the same time, but the risk for breaking a mapping is still here. Note that breaking a mapping shouldn't be a large regression because:

  • Iconthemes can still fall back on the default mapping (if it's not broken too) to provide an icon
  • Worst case scenario, the icon is just not displayed and it doesn't break any more of the interface

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • None, it's dev only changes and they are a bit dangerous because of the lack of tests.

*Reordered the icon set variables in alphabetical order
* Fixed some of the names that didn't fit the new convention.
* Updated and deprecated icon names to fit the new naming conventions
* Updated version of deprecation comments
* Improved deprecation comments
Copy link
Contributor

@manuelleduc manuelleduc left a comment

Choose a reason for hiding this comment

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

lgtm

Comment on lines 1169 to 1178
## Deprecated since 16.2.0 to conform to the new naming convention.
bullet_black = bullet_black
credit-card = creditcards
emoticon_smile = emoticon_smile
fast-backward = control_rewind
arrow_in = arrow_in
fast-forward = control_fastforward
floppy-disk = disk
log-in=user_go
log-out=user_go
shopping-cart = cart
Copy link
Contributor

Choose a reason for hiding this comment

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

Preferably those would be moved in a legacy module. But, I'm not sure we have an easy way to do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's the same kind of deprecated block in all icon themes. I'd rather have the same structure as the one we already have in translation files. It keeps things easy to maintain and understand, even if it might not the most optimized.

* Updated deprecation comments
@Sereza7 Sereza7 marked this pull request as draft August 26, 2024 16:23
@Sereza7 Sereza7 marked this pull request as ready for review September 6, 2024 15:32
@@ -60,7 +60,7 @@ function initWrapper({provide} = {}) {
id: 'sortPanel',
title: 'Sort',
component: 'LivedataAdvancedPanelSort',
icon: 'table_sort'
icon: 'table-sort'
Copy link
Member

Choose a reason for hiding this comment

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

I'm a bit confused here: in Silk I see table-sort and in FA I see table_sort?

Copy link
Contributor Author

@Sereza7 Sereza7 Sep 11, 2024

Choose a reason for hiding this comment

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

https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/FrontendResources/Icons/#HIconnamingconvention

I remapped everything in the standard icon themes to match the convention that was introduced a few months ago.
I made sure to keep the old mappings as to avoid backward incompatibility

FA mapping :

This second mapping is only here for backwards compatibility:

The files are huge so this can be a bit confusing. I thought it would be the best solution to organize things like this. Let me know if I missed an obvious compromise that'd be better :)

@michitux
Copy link
Contributor

I think this should have a Jira issue as introducing new icon names and deprecating old ones affects users and developer. Further, I wonder if we should make any efforts to not list deprecated icon names, e.g., in the icon picker. Currently, both will be listed I think which will confuse users.

@Sereza7 Sereza7 changed the title [Misc] Icon theme code quality XWIKI-22504: Update icon names to respect our icon naming convention Sep 12, 2024
@Sereza7
Copy link
Contributor Author

Sereza7 commented Sep 12, 2024

I think this should have a Jira issue as introducing new icon names and deprecating old ones affects users and developer.

Created https://jira.xwiki.org/browse/XWIKI-22504 and updated this PR intro post with the relevant info. 👍

Further, I wonder if we should make any efforts to not list deprecated icon names, e.g., in the icon picker. Currently, both will be listed I think which will confuse users.

Until recently with https://jira.xwiki.org/browse/XWIKI-12013 the set of icons listed in the icon picker was hardcoded so there was no issue with this kind of deprecation. I failed to see the implications of listing all icons with this new deprecation system. Indeed we shouldn't use deprecated icons in the icon picker.

@Sereza7 Sereza7 marked this pull request as draft September 12, 2024 08:27
@Sereza7
Copy link
Contributor Author

Sereza7 commented Sep 12, 2024

Setting this PR as a draft until a solution for the iconPicker "deprecated" icons has been found and implemented here.

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.

4 participants