Skip to content
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

Merged
merged 5 commits into from
Mar 22, 2024

Conversation

ibolton336
Copy link
Member

Copy link
Member

@sjd78 sjd78 left a 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:
screenshot-localhost_9000-2024 03 12-17_10_51

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>"
                        }}
                      />

screenshot-localhost_9000-2024 03 12-17_22_45

@ibolton336 ibolton336 marked this pull request as draft March 13, 2024 01:37
@sjd78 sjd78 added this to the v0.3.1 milestone Mar 14, 2024
@ibolton336 ibolton336 marked this pull request as ready for review March 20, 2024 00:36
Signed-off-by: Ian Bolton <ibolton@redhat.com>
Copy link
Member

@sjd78 sjd78 left a 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>
Copy link
Member

@sjd78 sjd78 left a 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!

@ibolton336 ibolton336 added the cherry-pick/release-0.3 This PR should be cherry-picked to release-0.3 branch. label Mar 20, 2024
@ibolton336 ibolton336 merged commit 4f54b05 into konveyor:main Mar 22, 2024
6 checks passed
github-actions bot pushed a commit that referenced this pull request Mar 22, 2024
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>
ibolton336 added a commit that referenced this pull request Mar 22, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick/release-0.3 This PR should be cherry-picked to release-0.3 branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants