patternfly-yew / patternfly-yew/patternfly-yew
[Disucssion] handling the "middle" truncation option
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 166
- Forks
- 39
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 2
Description
Continuing from https://github.com/patternfly-yew/patternfly-yew-quickstart/pull/36#issuecomment-1820466741:
Looks good to me, it might be worth adding a comment in the docs saying that the truncate doesn't necessarily truncate num grapheme clusters but rather rounds down to the next unicode codepoint after num bytes.
I'm not sure if adding any extra complexity to the code is worth it though. At best you could maybe trim off num unicode codepoints by using s.char_indices().rev().nth(num) which will still look weird in a lot of cases and anything better than that will require an extra dependency. So a comment would probably be good, just so people aren't surprised that there are only 5 characters visible when they wanted to keep 10.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the discussion linked from PR #36 and review the existing truncation behavior, especially the proposed middle option and Unicode handling. Determine whether the desired outcome is an implementation change or documentation clarification; done should be an agreed behavior for middle truncation, with the relevant documentation updated if that is the selected resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100