Modify

Opened 6 years ago

Closed 9 months ago

#4799 closed enhancement (fixed)

TagCloud should optionally be case-insensitive

Reported by: k0s Owned by: hasienda
Priority: normal Component: TagsPlugin
Severity: normal Keywords: TagCloud
Cc: otaku42 Trac Release: 0.11

Description (last modified by rjollos)

Because of the use of sorted in tagsplugin/trunk/tractags/macros.py#L47, upper-case items precede lower-case items. These should optionally be intermingled. Patch attached.

Attachments (2)

macros.py.patch (1.8 KB) - added by k0s 6 years ago.
patch to make TagCloud optionally case-insensitive
20111001_tagscloud_case_sorting.png (22.8 KB) - added by hasienda 3 years ago.
subtle tags cloud case-dependent sorting

Download all attachments as: .zip

Change History (16)

Changed 6 years ago by k0s

patch to make TagCloud optionally case-insensitive

comment:1 Changed 5 years ago by rjollos

See also #5347.

comment:2 follow-up: Changed 5 years ago by AdrianFritz

  • Owner changed from athomas to otaku42

Reassign to new maintainer.

From #5347 (which is a duplicate of this), reported by: k0s

currently tags are case-sensitive. while it is desirable to have the ability to use case to denote information (e.g. America vs. plugin), it is undesirable to have different cases be different. That is, Plugin and plugin should be the same tag. I think by default that the first case should be the canonical one. Ideally, a way of managing tags should be implemented that allowed re-casing and canonizing, but a first step would just be treating tags independent of case, at least optionally.

comment:3 Changed 4 years ago by hasienda

  • Keywords TagCloud added

Seems like it aims at a similar thing as #4200 or even might get obsoleted by it.

However the configuration option to retain old/default behavior should definitely be considered. Thanks for contributing your changes.

comment:4 Changed 3 years ago by rjollos

  • Description modified (diff)

comment:5 follow-up: Changed 3 years ago by rjollos

This patch is nice and clean, and could easily be rebased againts the current trunk. What do you think about adding the configuration option that controls default behavior of the macro and the tags page, and also having an option for the ListTagged macro that can override the default?

comment:6 Changed 3 years ago by hasienda

  • Cc otaku42 added; pacopablo removed
  • Owner changed from otaku42 to hasienda

I'll take care to bring this in now. Ryan, thanks for your vote.

comment:7 in reply to: ↑ 5 ; follow-up: Changed 3 years ago by hasienda

Replying to rjollos:

This patch is nice and clean, and could easily be rebased againts the current trunk.

Right, already done so. But this is more specifically just a caseless sort, not totally caseless treatment - that would include most notably tag consolidation (collecting taggged resources under one tag label, if their tags only differ by case). So I'll rename the option to reflect this: cloud_caseless_sort

What do you think about adding the configuration option that controls default behavior of the macro and the tags page, and also having an option for the ListTagged macro that can override the default?

Here you refer to functionality including such tag consolidation as requested by #4200, right? Just looking into it.

comment:8 in reply to: ↑ 2 Changed 3 years ago by hasienda

A note for completeness of feature request tracking:

Replying to AdrianFritz:

Reassign to new maintainer.

From #5347 (which is a duplicate of this), reported by: k0s

![...] Ideally, a way of managing tags should be implemented that allowed re-casing and canonizing, but ...

This has been implemented meanwhile by the mass tag replacement functionality for admin users (one-to-one and many-to-one, see #9061).

Changed 3 years ago by hasienda

subtle tags cloud case-dependent sorting

comment:9 Changed 3 years ago by hasienda

  • Status changed from new to assigned

Testing the proposed implementation of "caseless" sorting I noticed, that it reversed the order of upper-case and lower-case words while intermingling them.

This is demonstrated in the upper part of my cloud snapshot: subtle tags cloud case-dependent sorting

I resorted to a slightly more complicated sort to ensure, that lower-case tags still come after upper-case ones with same letter.

For the special case of tags containing several upper-case letters the result is still not as I'd expect it (notice 'TEST' next to 'test'), but this is just a curiosity of the sort function and doesn't mean more than a minor annoyance to me.

comment:10 Changed 3 years ago by hasienda

(In [10736]) TagsPlugin: Allow mixing of upper- and lower-case tags in sorted tags cloud, refs #4200 and #4799.

This is controlled by a new option cloud_caseless_sort that defaults to False for backwards-compatibility and doesn't touch the more general issue of case-sensitive tag handling (in TagsQuery) as detailed in #4200.

Thanks to Jeff Hammel for contributing the code for this enhancement.

comment:11 in reply to: ↑ 7 Changed 3 years ago by rjollos

Replying to hasienda:

Right, already done so. But this is more specifically just a caseless sort, not totally caseless treatment - that would include most notably tag consolidation (collecting taggged resources under one tag label, if their tags only differ by case). So I'll rename the option to reflect this: cloud_caseless_sort

Yes, good clarification. The "consolidation" feature seems to be one of the intents of #8747 as well as #4200.

Here you refer to functionality including such tag consolidation as requested by #4200, right? Just looking into it.

Actually, what I was thinking about here, is allowing control of cloud_caseless_sort from the ListTagged macro. For example,

[[ListTagged(-dummy, caseless_sort=true)]]

I've tested r10736 on Trac 0.11.7 and it seems to be working well.

comment:12 Changed 3 years ago by rjollos

  • Description modified (diff)

comment:13 Changed 3 years ago by hasienda

Thanks for the hint on #8747, missed that by now, so I'm glad now to not have factored the whole thing by now.

comment:14 Changed 9 months ago by hasienda

  • Resolution set to fixed
  • Status changed from assigned to closed

In 13815:

TagsPlugin: Completing preparation for v0.7 release.

Availability of that code as stable, tagged release
closes #2429, #3359, #3610, #3624, #3677, #3754, #3864, #3947, #3983, #4078, #4277, #4503, #4799, #5523, #7787, #7857, #8638, #9057, #9058, #9059, #9060, #9061, #9062, #9063, #9149, #9210, #9521, #9630, #9636, #10032, #10416, #10636, #11096, #11147, #11152, #11274, #11302, #11658 and #11659.

Additionally there are some issues and enhancement requests showing progress,
but known to require more work to resolve them satisfactorily, specifically
refs #2804, #4200, #8747 and #9064.

Thanks to all contributors and followers, that enabled and encouraged a good
portion of this development work.

Add Comment

Modify Ticket

Action
as closed The owner will remain hasienda.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.