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
Implement Split Diff-View #2296
Conversation
@andreynering could you pull the latest and see if the problem is still there? |
Now working as intended @unknwon thoughts? |
I think the button should be called |
@unknwon yeah, I think that makes most sense on second thought @andreynering I've commited the changes, which web-browser are you testing in? (I'm currently only testing on firefox) |
ba265ad
to
6abc721
Compare
Chrome |
@andreynering yeah, not getting that on firefox or chrome. sure you checked it out cleanly and built it correctly? ( @unknwon Renamed and cleaned up a bit :) |
@bkcsoft I tried in Firefox and it's OK. In Chrome it's still as before. |
@andreynering which version if chrome? Since I canct reproduce it :/ |
47.0.2526.106 |
I'll have a look later today :) |
@andreynering currently testing in "Google Chrome 47.0.2526.80" and it "Works On My Machine" ^.^ |
Thanks @bkcsoft ! Just get back from trip. Will start reviewing today. (I'm on +8 CST right now) |
@andreynering odd, I tried it in "Google Chrome 47.0.2526.80" and there it worked as expected, but in "Google Chrome 47.0.2526.106" I see what you're seeing... Anyhow, the issue is with word-wrapping... I wrap on whitespace, but there's no whitespace to wrap on :/ |
@andreynering well, I can make it either break in the middle of words, OR break on whitespace... apparently not both -.- about highlighting changes, that might be really hard... for simple stuff it easy enough:
but for a bit more complex stuff it is harder:
^ this one should highlight only the numbers (and perhaps |
@andreynering well, I can make it either break in the middle of words, OR break on whitespace... apparently not both -.- unless one uses an undocumented css-value... namely |
I will try to get it right and maybe send a PR, but will wait this one be I am using a third party package that does the diff of the strings. Em dom, 3 de jan de 2016 22:14, Kim Carlbäcker notifications@github.com
|
@andreynering yeah, I looked at diff-packages when I started this but it seemed like they wanted rad .patch-files (which I didn't wanna push to the frontend...) so I gave up on that... |
Verified to work in the following browsers: |
@bkcsoft It's OK now. 👍 |
Oops! There are conflicts on bindata.go |
PS: A rebase is recommended to keep commit history clean. |
@@ -168,6 +168,7 @@ func Diff(ctx *middleware.Context) { | |||
} | |||
} | |||
|
|||
ctx.Data["Style"] = ctx.Query("style") == "split" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be IsSplitStyle
since it's a bool
value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed it should be IsSplitStyle
prev.children().eq(2).html($(this).children().eq(2).html()); | ||
prev.children().eq(3).addClass('add-code'); | ||
prev.children().eq(2).addClass('add-code'); | ||
// prev.children().eq(2).attr('style', 'background-color: #eaffea !important'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's going on with commented out lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old code, I'll fix that
Thanks agin for the PR! I checked out locally and works great AFA I can tell. Some comments are made, also I see a lot duplicated content between |
@unknwon I've missed to remove to old code, I'll remove that and squash some commits to make it cleaner. Also resolve the bindata.go-issue About the duplicate code, I made that decision because it'll only do 1 bool-check (and not 1 per line). My reasoning for that is that it should be faster to render, I can do some benchmarks if you'd like to see how much slower it'd be to do it inline. (just need to find a big commit first 😄) |
af5b1c4
to
d314275
Compare
- Unified/Inline Diff-View Selectable
d314275
to
8fe5d88
Compare
I don't mean to check bool per line, but reduce the check to a smaller range of content. As you can see, things are getting different inside |
doing it on the |
merging them and having it check per-file (on |
Oh, I completely forgot to mention that this PR also includes the fold-icon ( Not sure if I should leave it there or have it in a separate PR? |
Never mind, I'll do that after merge. And you need at least comment out fold icon, it's not working yet. |
Already pushed the template-merging :) The icon is more of a visual thing for me. but I'll remove it and see if I can make it work in a separate PR :) |
Oh, I see. I'll checkout again later today. 😀 |
LGTM. |
Is there a flag to enable split-view by default? |
@mastorm currently, no.. |
* only update needed columns when update user * fix missing update_unix column
Opened up a new PR since the previous one ( #2288) was for the wrong branch.
Changed the name from Unified => Split and rebased on develop
This is still a WIP so don't merge it yet, it's just here to show that I'm still working on it...Stuff that still needs fixing before considering merging: