@staticmethod
def truncate_ellipsis(text: str, length: int) ->str:
    """Truncate a string with ellipsis added to the end if needed."""
    if len(text) <= length:
        return text
    return text[:length - 1] + '…'
