-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Wrap long file paths in issues drawer #1761
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The full file path text is displayed but now the drawer requires horizontal scrolling:
Maybe there is a way to have the text wrap at directory delineation?
TIL about <wbr />
: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr
Not safe but works as a POC:
<div
dangerouslySetInnerHTML={{ __html:
fileReport?.file.split("/").join("/<wbr />") || "<unknown>"
}}
/>
Signed-off-by: Ian Bolton <ibolton@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting up the PathDisplay
looks nice. Only question to about the path separator character.
Signed-off-by: Ian Bolton <ibolton@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After thinking about edge cases for path strings, I think this should work out well.
The edge case I got hung up on was, "what about if the path has an escaped separator character". But then 2 things. First, it only give text wrapping boundaries, so not a big impact. Second, I don't think you can have an escaped separator character in a full file name.
> touch "Hello\\There.txt"
> touch "Hello\/There.txt"
touch: cannot touch 'Hello\/There.txt': No such file or directory
The first one works file on linux. The second one does not. Edge case solved!
Resolves https://issues.redhat.com/browse/MTA-1961?filter=12422675 --------- Signed-off-by: Ian Bolton <ibolton@redhat.com> Signed-off-by: Cherry Picker <noreply@github.com>
Resolves https://issues.redhat.com/browse/MTA-1961?filter=12422675 --------- Signed-off-by: Ian Bolton <ibolton@redhat.com> Signed-off-by: Cherry Picker <noreply@github.com> Signed-off-by: Ian Bolton <ibolton@redhat.com> Signed-off-by: Cherry Picker <noreply@github.com> Co-authored-by: Ian Bolton <ibolton@redhat.com>
Resolves https://issues.redhat.com/browse/MTA-1961?filter=12422675