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
Allow to shorten the diff editor title #110694
Comments
Related: #44916 |
The title reflects the editors, the first name is for the left and the second for the right editor? |
Yes, you are right. But the title is taking too much space thus wasting time realizing which code is on which side. |
With #109224 at least for files in the same folder, the label will be much shorter now: |
The UI challenge here is really that we have many settings that enable a If someone has better ideas how to resolve this, I am all up for making a change. |
@shasiru yeah I somewhat like that idea, if you want to give it a try through a PR, the change would need to go somewhere here: vscode/src/vs/workbench/common/editor/diffEditorInput.ts Lines 43 to 58 in 8c2a384
Interestingly we have a similar challenge already when you open 2 editors with the same name we try to put a description next to the file name that can be used to distinguish the one file from the other: That code lives here and maybe can be reused for this task?
|
Although I've already started working on it, I realized this won't be implemented by me anytime soon, because I'm very busy with other several projects at this time. @goldst, Thanks, be my guest.. the sooner someone comes up with a reliable implementation is better... 😊 |
@goldst are you working on this? if not I can take a look |
@jeanp413 yes I am, was occupied with other things during the holidays but will likely finish this weekend. |
Okay, I have now both versions working, I'd just need to fix a few bugs on version B. Version A: just shorten diff path Version B: implements multiple labels for tabs, the path is in description labels Reasons for version A:
Reasons for version B:
|
@goldst I am happy to look at the changes for both to understand the consequence. as for "less potential for bugs", I would say that some unit tests would help to improve on that. |
Thanks, @bpasero for the comment! I have redone solution B more cleanly now. I can PR as soon as you tell me which one. I prefer B. |
@bpasero short reminder 😄 If something is unclear, feel free to ask. |
I can currently not allocate time for this but suggest to still do a PR with your proposals (maybe link to the alternate solution from the PR). |
Apologies for the delay in working on this but as we get closer to our issue grooming iteration in October, I decided to look into this again with a fresh mind. @goldst I looked at the PR in #116178 but had a hard time following along given the amount of changes. Instead I tried to implement this with concepts we already had, let me try to explain: My solution aims to leverage existing concepts we already had for normal editors:
Taking this concept over to diff editors:
Examples: I didn't find the repeated usage of the Thoughts? |
@bpasero thanks for having a look at my code! I agree that it contains a lot of changes and that this might be a reason to choose a simpler solution. It would have been nice to know that in advance though, but no worries. Your solution looks good! There is one edge case in which I think it should behave differently (not sure if this should be part of this issue or a separate one): Here, there are two different |
@goldst yeah you are right, the computation of labels for tabs is strictly identifying duplicates and not cases where a label is made up of 2 sides where one is a duplicate of others. I suggest to treat that as a separate issue and allow this one to close for verification. |
Issue Type: Feature Request
When comparing two codes side by side, the order is confusing.
It takes a considerable amount of time just to realize which file is on the left and which is on the right.
And the tab title showing comparing files is not helpful at all since it is too long
For example, in tab title;
different file names in same location
.....very/very/very/very/long/path/file1.js <-> .....very/very/very/very/long/path/file2.js
or
same file name in different locations
.....very/very/very/very/long/path1/file1.js <-> .....very/very/very/very/long/path2/file1.js
either situations, I find it really frustrating to identify which file is on which side by reading the long URL (title).
What i propose is to implement the vscode interface to allow the user to add labels with custom titles to each side (when in code comparison).
So instead of a single long URL like this:
implement a UI feature like this:
to show clearly which file is open on which side and also allow the user to add custom title names to each of comparing file (temporarily - for reference)
VS Code version: Code 1.51.1 (e5a624b, 2020-11-10T23:34:32.027Z)
OS version: Windows_NT x64 10.0.19042
The text was updated successfully, but these errors were encountered: