Skip to content

Conversation

@tomiiide
Copy link
Contributor

@tomiiide tomiiide commented Jul 17, 2025

Which Jira task is linked to this PR?

https://lifi.atlassian.net/browse/LF-8638

Why was it implemented this way?

The solution I explored was checking messages for hashes, and wrapping them with middle ellipsis, that way, the full error message is visible, but the hashes don't overflow.

Visual showcase (Screenshots or Videos)

Screenshot 2025-07-17 at 4 37 08 PM Screenshot 2025-07-17 at 4 36 59 PM

Checklist before requesting a review

  • I have performed a self-review of my code.
  • This pull request is focused and addresses a single problem.
  • If this PR modifies the Widget API, I have updated the documentation (or submitted a change request on GitBook).

@tomiiide tomiiide self-assigned this Jul 17, 2025
@tomiiide tomiiide marked this pull request as ready for review July 21, 2025 12:59
@tomiiide tomiiide requested review from chybisov and effie-ms July 21, 2025 12:59
@tomiiide tomiiide requested a review from chybisov July 22, 2025 09:20
})
}

export function wrapLongWords(text: string): string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with replace should be shorter, unless we have anything against regex here

text.replace(/\S{32,}/g, (word) => {
    return `${word.slice(0, 8)}...${word.slice(-4)}`
})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I didn't know of that function, yeah that is actually much cleaner

@chybisov chybisov merged commit 83da273 into main Jul 22, 2025
1 check passed
@chybisov chybisov deleted the LF-8638-fix-wrap-long-text branch July 22, 2025 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants