| Summary: | Replacement compare preview in search page shows original lines in green, replaced in red | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Adrian Aichner <adrian.aichner> |
| Component: | Client | Assignee: | libing wang <libingw> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | libingw |
| Version: | unspecified | ||
| Target Milestone: | 5.0 M1 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
| Attachments: | |||
|
Description
Adrian Aichner
Created attachment 238110 [details]
Old vs. new is swapped, was changed from extension to Extension
Created attachment 238111 [details]
This is shown correctly in git compare
I found similar behavior in master/HEAD for git status now. The overview of staged or unstaged diffs (Expand All) also has old in green and new in red (which is confusing). Then, when you click the [Compare] link the colors are assigned correctly (adding to the confusion). Please let me know if you think this new observation is worth a separate bug. It looks related to me at first glance. Adrian Meta bug: bugzilla loses a pending comment when one adds an attachment! But my own https://chrome.google.com/webstore/detail/autosave-text/omgpghebcjlafeegihofjnhhmllplnie/details saved me the re-typing :-) I can't reproduce the issues in git status page and stand alone compare. You can try "side by side" in the same widget and see what happens. The side by side mode uses the same logic as compare page does. But I do agree that there is coloring issue in the replace page preview. As people always use compare in the git status page and will likely make small changes in the new file while comparing, we put the new file on the left and mark diffs as green. So in most of the cases, the convention is left(new ,green) vs right(old, red). The color in the side by side compare is not actually that important. But to be consistent to the unified(inline) mode, green/red pattern is always followed. As the compare widget in replace page is a preview/read only, we reverse the order in purpose. As this is no inline compare in the replace page, we did not reverse the color. But you are right, we should reverse the color as well to be consistent across pages.. Thanks for looking into this! I think I know how to reproduce this unified diff issue. It happens readily on changes to project.json files, probably because they are one-liners. The side-by-side view (as you suggested to try) looks as expected. See the new attachments in a minute. Created attachment 238118 [details]
Side by Side looks as expected, even for one-liners.
Created attachment 238119 [details]
Unified diff is backwards for oneliner files like project.json
(In reply to Adrian Aichner from comment #5) > Thanks for looking into this! > > I think I know how to reproduce this unified diff issue. > > It happens readily on changes to project.json files, probably because they > are one-liners. > > The side-by-side view (as you suggested to try) looks as expected. > > See the new attachments in a minute. thanks for the reproducible steps, I was able to reproduce it and created a separate Bug 423442. The solution is still using right side as the replaced file and left side as original file. But the right side is marked as green and left as red now. |