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

Collapse (hide) same lines #70

Open
fzyzcjy opened this issue May 14, 2024 · 4 comments
Open

Collapse (hide) same lines #70

fzyzcjy opened this issue May 14, 2024 · 4 comments
Assignees

Comments

@fzyzcjy
Copy link

fzyzcjy commented May 14, 2024

Hi thanks for the diff tool! It would be great if, when there are a ton of exactly same lines, they can be folded, such that the diff is much shorter. For example, SmartGit has something like:

image

@zgrossbart zgrossbart self-assigned this May 14, 2024
@zgrossbart
Copy link
Owner

Thank you for using JSONDiff @fzyzcjy and a big thank you for the feature suggestion.

I've looked into code folding before. The sample in your screenshot is hiding lines that don't have any differences. Would you want JSONDiff to do the same thing and collapse sections that don't have any differences or do you have another idea for how you'd want to see this working?

@fzyzcjy
Copy link
Author

fzyzcjy commented May 14, 2024

Thanks for the reply!

Would you want JSONDiff to do the same thing and collapse sections that don't have any differences or do you have another idea for how you'd want to see this working?

I guess the simplest solution is to just collapse anything that does not change. For optional better experience, I would like to see the parent keys be shown. For example, suppose we want to compare:

{a: b: {c: 1, d: 1, e: 1, ... x: 1, y: 2, z: 1}}}
{a: b: {c: 1, d: 1, e: 1, ... x: 1, y: 10000, z: 1}}}

Then, the naive way will only show the y line (together with a few lines above and below it). But then we do not know what is indeed the parent key of y (here it is a.b.y). Thus, it would be great to somehow show such information for readers.

@zgrossbart
Copy link
Owner

Thank you for the extra details @fzyzcjy. Let me take a little time to think about the best user experience here and see what I can come up with.

@fzyzcjy
Copy link
Author

fzyzcjy commented May 14, 2024

Sure, take your time and looking forward!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants