Modify

Opened 8 years ago

Closed 3 years ago

#4799 closed enhancement (fixed)

TagCloud should optionally be case-insensitive

Reported by: Jeff Hammel Owned by: Steffen Hoffmann
Priority: normal Component: TagsPlugin
Severity: normal Keywords: TagCloud
Cc: Michael Renzmann Trac Release: 0.11

Description (last modified by Ryan J Ollos)

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 Jeff Hammel 8 years ago.
patch to make TagCloud optionally case-insensitive
20111001_tagscloud_case_sorting.png (22.8 KB) - added by Steffen Hoffmann 5 years ago.
subtle tags cloud case-dependent sorting

Download all attachments as: .zip

Change History (16)

Changed 8 years ago by Jeff Hammel

Attachment: macros.py.patch added

patch to make TagCloud optionally case-insensitive

comment:1 Changed 8 years ago by Ryan J Ollos

See also #5347.

comment:2 Changed 7 years ago by Adrian Fritz

Owner: changed from Alec Thomas to Michael Renzmann

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 6 years ago by Steffen Hoffmann

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 5 years ago by Ryan J Ollos

Description: modified (diff)

comment:5 Changed 5 years ago by Ryan J Ollos

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 5 years ago by Steffen Hoffmann

Cc: Michael Renzmann added; John Hampton removed
Owner: changed from Michael Renzmann to Steffen Hoffmann

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

comment:7 in reply to:  5 ; Changed 5 years ago by Steffen Hoffmann

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 5 years ago by Steffen Hoffmann

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 5 years ago by Steffen Hoffmann

subtle tags cloud case-dependent sorting

comment:9 Changed 5 years ago by Steffen Hoffmann

Status: newassigned

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 5 years ago by Steffen Hoffmann

(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 5 years ago by Ryan J Ollos

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 5 years ago by Ryan J Ollos

Description: modified (diff)

comment:13 Changed 5 years ago by Steffen Hoffmann

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 3 years ago by Steffen Hoffmann

Resolution: fixed
Status: assignedclosed

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Steffen Hoffmann.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.