-
Notifications
You must be signed in to change notification settings - Fork 418
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
Project path source trimming #1216
Comments
Should we show just csproj name and move whole path to details pane (when we do that)? Considering from the time/effort required here to improve trimming. |
Yes, that would be an improvement. Edit: Infact, I think the change could be made before the details pane. Show the file name only, tooltip is the full path, and add to details pane in the future. |
My initial code for what became the middle trimming actually attempted to do all of this. But even when I was reasonably confident in it (with a bunch of tests) there was a lot of ambiguity about what was "right" to do (e.g. preferring later segments over earlier segments when either would fit) and whether it covered all path types we'd see. So I shelved it and just went with something simpler, figuring it could be replaced later. So I definitely support going with the simple route over trying to sort all of those out. A more complex answer can be done later if we get feedback saying it's necessary. |
I noticed that even on medium resolutions, the project path is trimmed in the middle and the end:
Right now, the trim in the middle happens on the server, and the trim at the end happens in the browser.
The most complicated solution is to use JavaScript to detect when trimming is required - I found some solutions here - and then trim the text in JavaScript. That would require listening to events to handle data changing and browser resize.
A simpler solution could be to trim more on the server. It's not perfect, and low resolution monitors will eventually see multiple ellipsises, but I don't think we can avoid that unless we go with a JavaScript solution described above.
I also think trimming content at the start of the path and base it around directory segments is better than arbitrarily cutting out text in the middle. It's less messy.
e.g.
c:\Development\Source\aspire\MyProject\MyProject.csproj
->c:\...\aspire\MyProject\MyProject.csproj
It would be more complicated. We would need to parse the file path. Also, we would need to make sure it works with Linux/MacOS, e.g.
/home/james/Development/Source/aspire/MyProject/MyProject.csproj
->/home/.../aspire/MyProject/MyProject.csproj
.The text was updated successfully, but these errors were encountered: