def shorten_str(text: str, width: int = 30, suffix: str = "[...]") -> str:
    """Custom string shortening (`textwrap.shorten` collapses whitespace)."""
    if len(text) <= width:
        return text
    else:
        return text[: width - len(suffix)] + suffix