code: public static String shortenComment(String comment) {
      int maxCommentLength = 100;
      String shortComment = comment;
      if (shortComment.length() > maxCommentLength) {
        // if there is text in brackets, drop it (beginning at the end)
        while (shortComment.lastIndexOf(" [") > 0
                && shortComment.lastIndexOf(']') > shortComment.lastIndexOf(" [")
                && shortComment.length() > maxCommentLength) {
          shortComment = shortComment.substring(0, shortComment.lastIndexOf(" [")) + shortComment.substring(shortComment.lastIndexOf(']')+1);
        }
        while (shortComment.lastIndexOf(" (") > 0
                && shortComment.lastIndexOf(')') > shortComment.lastIndexOf(" (")
                && shortComment.length() > maxCommentLength) {
          shortComment = shortComment.substring(0, shortComment.lastIndexOf(" (")) + shortComment.substring(shortComment.lastIndexOf(')')+1);
        }
        // in case it's still not short enough, shorten at the end
        if (shortComment.length() > maxCommentLength) {
          shortComment = shortComment.substring(0, maxCommentLength-1) + "…";
        }
      }
      return shortComment;
    }
docs: LibO shortens menu items with more than ~100 characters by dropping text in the middle.
  That isn't really sensible, so we shorten the text here in order to preserve the important parts.