Skip to content

BUG: Improve email truncation logic #545

@andrinoff

Description

@andrinoff

Describe the bug

The truncateEmail function in tui/inbox.go only truncates the local part of the email address if it's longer than 8 characters. This can lead to very long email strings in the "ALL" view account indicators.

To reproduce

  1. Use an account with a long local part or a long domain.
  2. View emails in "ALL" view.
  3. Observe the account indicator truncation.

Expected behavior

Better truncation that balances local part and domain, or fits within a fixed width more gracefully.

Additional context

func truncateEmail(email string) string {
	parts := strings.Split(email, "@")
	if len(parts) >= 1 && len(parts[0]) > 8 {
		return parts[0][:8] + "..."
	}
	if len(parts) >= 1 {
		return parts[0]
	}
	return email
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions