[RCD] Folder name abbreviation in folder list

White white.lists.roundcube.net at xs4all.nl
Mon Jan 11 13:07:30 CET 2010

Dear folks,

I want to share my thoughts about the folder name abbreviation in the
folder list. I am new out here, so bear with me.

I really dislike the abbreviation of folder names. I also don't understand
why abbreviation is necessary. I can understand the abbreviation if the
folder list has a fixed width. But since you can move the splitter at your
convenience to show more of the folder names, I don't see why the folder
names are abbreviated. Could it be a remnant of the past?

If I understand the information from http://trac.roundcube.net/ correctly
the abbreviation was added as early as changeset 38 in October 2005. The
vertical splitter seems to be added with changeset 1766 in September 2008.
Doesn't the vertical splitter make abbreviation unnecessary?

1) I suggest to remove the abbreviation of folder names in the folder
list. At least make it optional for people who really dislike it (like me).

Looking at the tracker site I noticed some things I want to share also.

2) Changeset 1792 increased the maximum length of folder names in the
folder list from 16 to 25. But only for "Message mode" (when an e-mail was
opened)! When you go back to the message list you will see the folder names
get shortened! It seems like it was forgotten to change the maximum length
in skins\default\templates\mail.html also.

3) The abbreviation routine "abbreviate_string" seems to be added as early
as changeset 37. The used algorithm has not changed since then but it is
totally bogus! The function does not shorten the string in the exact middle
and the function makes the string two characters longer than the allowed
maximum length!

The algorithm would only work if the place holder for the removed part is
only one character. I suggest to change the function into something like
this (untested!):

function abbreviate_string($str, $maxlength, $place_holder='...')
  $length = mb_strlen($str);
  if ($length > $maxlength)
    $place_holder_length = mb_strlen($place_holder);
    $first_part_length = floor(($maxlength - $place_holder_length) / 2);
    $second_starting_location = $length - $maxlength + $first_part_length
+ $place_holder_length;
    $str = mb_substr($str, 0, $first_part_length) . $place_holder .
mb_substr($str, $second_starting_location);

  return $str;

I also wonder if the place holder "..." is a candidate for localization.

Thanks for your attention.

List info: http://lists.roundcube.net/dev/

More information about the Dev mailing list