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

Standard method(s) of trimming file paths #999

Closed
tlmii opened this issue Nov 22, 2023 · 2 comments
Closed

Standard method(s) of trimming file paths #999

tlmii opened this issue Nov 22, 2023 · 2 comments

Comments

@tlmii
Copy link
Member

tlmii commented Nov 22, 2023

This stems most recently from #987 (comment) but we've discussed it in other issues and PRs in the past.

We have several places where we display file paths (Project's source location, executable's command and working directory, etc) and they can often be very long.

For simplicity right now we're just using the same ellipsis overflow for them as we use in other places, along with a tooltip. For example:

image

As the comment above noted, this truncation is exactly backwards of what we want since the mostly likely interesting part is at the end.

We should figure out if there is a standard/common way of doing this (including a library if needed) and then make use of that consistently across the dashboard.

Two possibilities to consider:

  1. Middle trimming: since the drive/root is often useful in a file path, as is the right-most segments, trimming something in the middle can be useful. E.g. c:\src\repos\dev\this\that\project1\project1.csproj becomes something like c:\src\...project1\project1.csproj
  2. Diff trimming: When you've got a set of paths that are all similar, showing just the difference can be helpful. E.g. c:\src\repos\project1\project1.csproj and c:\src\repos\project2\project2.csproj become ...\project1\project1.csproj and ...\project2\project2.csproj.
@DamianEdwards
Copy link
Member

👍 for "middle trimming"

@smitpatel
Copy link
Contributor

How about path relative to AppHost project (or repo root)?

@github-actions github-actions bot locked and limited conversation to collaborators Apr 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants