Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 379232

Summary: Problem with inline compare views when displayed inside a hidden div
Product: [ECD] Orion Reporter: Szymon Brandys <Szymon.Brandys>
Component: GitAssignee: libing wang <libingw>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: susan
Version: 0.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 379567    
Attachments:
Description Flags
Initially compare views are empty
none
When I resize the window (ctrl + and ctrl - on FF) none

Description Szymon Brandys CLA 2012-05-11 07:04:24 EDT
Steps:
1) Have staged/unstaged changes in your workspace
2) Go to the new status page (git-status2)
3) Initially all diff sections are hidden (collapsed)
4) Try to expand them

I'm attaching a screenshot showing what I see.
Comment 1 Szymon Brandys CLA 2012-05-11 07:06:40 EDT
Created attachment 215463 [details]
Initially compare views are empty
Comment 2 Szymon Brandys CLA 2012-05-11 07:09:09 EDT
Created attachment 215464 [details]
When I resize the window (ctrl + and ctrl - on FF)

When I resize the window (ctrl + and ctrl - on FF) the content is shown, but line numbers are messed up
Comment 3 Szymon Brandys CLA 2012-05-11 07:11:16 EDT
If compare view is not hidden at the beginning and I use Hide/View action to collapse and expand, everything is ok. So it seems, the problem is related to adding inline compare to a hidden div. Libing, let me know what you think.
Comment 4 libing wang CLA 2012-05-11 10:49:34 EDT
(In reply to comment #3)
> If compare view is not hidden at the beginning and I use Hide/View action to
> collapse and expand, everything is ok. So it seems, the problem is related to
> adding inline compare to a hidden div. Libing, let me know what you think.

You can't init compare widget in a hidden div.
Also, I think it is not efficient. Because unless you expand it once, you do not want any server traffics requesting diffs.
I think a better approach should just init the widget when you first time expand it. Later on you just resize your parent div.
I think the good part in the widget is that when you switch mode it does not ask server as well.
Comment 5 Szymon Brandys CLA 2012-05-11 12:39:26 EDT
Well. I CAN init widget in hidden div as you see on screenshots. But it behaves weird.
Comment 6 Szymon Brandys CLA 2012-05-16 08:13:09 EDT
This is no more a blocker for Bug 349328. Compare widgets are explorer nodes now and they behave well there. As Libing suggested I init compare wdgets when they are first shown (expanded) and it works.
Comment 7 libing wang CLA 2012-05-18 09:01:44 EDT
I am targeting this as post 0.5.
We should consider bug 379567 as the guideline for all widget life cycle, including the creation, min and max size , etc.
Comment 8 John Arthorne CLA 2015-05-05 14:51:29 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:

https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html