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

Bug 262266

Summary: [breadcrumb] In the Debug view breadcrumb drop-down add a mode to show only selected element's siblings.
Product: [Eclipse Project] Platform Reporter: Pawel Piech <pawel.1.piech>
Component: DebugAssignee: Darin Wright <darin.eclipse>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: chanskw, ndsilva
Version: 3.5   
Target Milestone: 3.5 M6   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
screenshot of problem
none
Patch with fix.
none
Patch with the auto-expand option. none

Description Pawel Piech CLA 2009-01-23 19:07:34 EST
Currently when the drop down window is opened, it shows the entire element hierarchy that is also visible in the Debug view.  Some users may find this distracting and would prefer to see a limited hierarchy instead.
Comment 1 Natasha D'Silva CLA 2009-02-17 12:12:00 EST
A related issue is that the drop down context is that sometimes the only elements visible in the drop down window are from a completely different debug target from what is selected in the breadcrumb.  This could happen if there are multiple targets in the debug view - the window might only have enough room to display one.
Comment 2 Pawel Piech CLA 2009-02-17 12:22:02 EST
I'm a little confused.  Are you describing a problem with the current implementation or a potential problem with the feature?

Currently the drop down should reveal and select whatever the current item is in the breadcrumb.  This can sometimes be interfered with by the user if the user mouses over the drop down as it opens, because the drop-down changes selection for mouse over events as well.
Comment 3 Natasha D'Silva CLA 2009-02-17 12:58:38 EST
Created attachment 125925 [details]
screenshot of  problem

I attached a screenshot of what I'm describing. A stack frame is selected, but in the drop down, it is not visible, I have to scroll to find it.  Based on what you've described as the expected behavior, this would be a bug.
Comment 4 Pawel Piech CLA 2009-02-17 13:55:21 EST
That would indeed be a bug.  I cannot easily reproduce this unless i intentionally drag the cursor into the drop down while it's still expanding.  Could you confirm whether this is what happens to you as well.  I.e. if after opening the drop down you don't drag the cursor over it until it finishes expanding, does it still not select?  Thanks
Comment 5 Natasha D'Silva CLA 2009-02-18 16:17:41 EST
I do not move my cursor after clicking the stackframe in the debug view to open the drop down window.  I leave the drop down window open for a while, in case it's working on revealing the item, but that doesn't happen.
Comment 6 Pawel Piech CLA 2009-02-18 16:37:35 EST
(In reply to comment #5)
Bummer, there goes my best theory.  I'm not sure if I'll be able to figure this out without reproducing it.  Do you have any suggestions on to get it to happen with JDT?  E.g. is there a certain number of threads that you need to have, multiple launches, etc?  Thanks
Comment 7 Natasha D'Silva CLA 2009-02-19 17:06:55 EST
I think this is a separate problem on its own. I opened
https://bugs.eclipse.org/bugs/show_bug.cgi?id=265555 to track this issue.
Comment 8 Pawel Piech CLA 2009-02-20 17:50:59 EST
(In reply to comment #7)
> I think this is a separate problem on its own. I opened
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=265555 to track this issue.

I agree, thank you. 

Comment 9 Pawel Piech CLA 2009-02-24 00:41:14 EST
Created attachment 126516 [details]
Patch with fix.

The fix turned out to be easier than I thought.  I created a sub-tree viewer ,which is essentially just a wrapper for the standard tree model viewer, that shows only a sub-section of the full model.
Comment 10 Pawel Piech CLA 2009-02-24 00:47:13 EST
I think this is very much an improvement so I went ahead and committed the change.
Comment 11 Darin Wright CLA 2009-02-24 11:22:47 EST
Pawel, would it be possible to collapse all items by default? For example, if I select the frame, I just see frames, which is great. If I select the thread, I also see its frames - which does not allow me to quickly navigate to other threads (I have to scroll). 
Comment 12 Pawel Piech CLA 2009-02-24 11:51:53 EST
(In reply to comment #11)
> Pawel, would it be possible to collapse all items by default? For example, if I
> select the frame, I just see frames, which is great. If I select the thread, I
> also see its frames - which does not allow me to quickly navigate to other
> threads (I have to scroll). 

Yes, it's doable, though I would like to make it a preference.  I personally really like having the tree automatically expand.
Comment 13 Darin Wright CLA 2009-02-24 12:01:16 EST
(In reply to comment #12)
> Yes, it's doable, though I would like to make it a preference.  I personally
> really like having the tree automatically expand.

Having collapsed items would be consistent with the Java editor's breadcrumb, and makes navigation to siblings simpler (i.e. less info in the pop-up, easier to see, less chance of need to scroll). 

It seems that just by going to the correct node in the crumb, that expansion is not necessary? For example, if I want to navigate to a frame, activate the frame popup. If I want to navigate to a thread, activate the thread popup. If users want to navigate to a frame from a higher level node, they can expand - but is seems like they should only see siblings by default.
Comment 14 Pawel Piech CLA 2009-02-24 12:28:09 EST
(In reply to comment #13)
> Having collapsed items would be consistent with the Java editor's breadcrumb,
> and makes navigation to siblings simpler (i.e. less info in the pop-up, easier
> to see, less chance of need to scroll). 
> 
> It seems that just by going to the correct node in the crumb, that expansion is
> not necessary? For example, if I want to navigate to a frame, activate the
> frame popup. If I want to navigate to a thread, activate the thread popup. If
> users want to navigate to a frame from a higher level node, they can expand -
> but is seems like they should only see siblings by default.

I understand the merit of only showing the siblings and not their children, I will go ahead and implement it.

On the other hand, it's one of the reason why I find the JDT breadcrumb not very useful, i.e. because it imitate the full tree behavior closely enough.  For visual consistency I prefer to have the expanded state of the elements be persisted so that it's the same every time I open the drop down.  It helps me orient myself mentally within the model so that I can navigate to the other elements I'm interested in.

Is it OK, if I add this as a view preference?  I bury it as a checkbox action in the View Modes sub-menu and leave it off by default.
Comment 15 Darin Wright CLA 2009-02-24 12:51:21 EST
(In reply to comment #14)
> Is it OK, if I add this as a view preference?  I bury it as a checkbox action
> in the View Modes sub-menu and leave it off by default.

Fine by me.

Comment 16 Pawel Piech CLA 2009-02-24 14:10:10 EST
Created attachment 126590 [details]
Patch with the auto-expand option.

This patch changes the default behavior to not expand the elements in the drop-down viewers.  Auto-expansion can be enabled with a preference setting in the View Modes menu.  It also addresses bug 262871, which I'll mark as duplicate.
This patch is already applied.
Comment 17 Darin Wright CLA 2009-02-24 14:54:10 EST
Plays nicely, but I'm betting no-one will know what "Auto-Expand Compact Selector" means :-) I would suggest adding a separator in the menu, to show that is is not related to the other 3 options... trying to think of an alternate name.
Comment 18 Pawel Piech CLA 2009-02-24 15:10:42 EST
(In reply to comment #17)
> Plays nicely, but I'm betting no-one will know what "Auto-Expand Compact
> Selector" means :-) I would suggest adding a separator in the menu, to show
> that is is not related to the other 3 options... 

Done.  I also like the way it's turned out.  

> trying to think of an alternate name.
I also had "Auto-Expand in Drop-down viewer", but I thought "drop-down" is too technical.  It's hard to come up with a descriptive name that's not too long.
Comment 19 Pawel Piech CLA 2009-02-24 17:38:13 EST
*** Bug 262871 has been marked as a duplicate of this bug. ***
Comment 20 Samantha Chan CLA 2009-04-29 14:59:19 EDT
I also like the option... now that I understand what it does.  :)

How about naming it "Auto-Expand Children", since your tooltip on the drop down action is "Show Children"?

Perhaps adding a "Debug Dropdown" menu in the same level as "View Mode", and adding this action as a "Debug Dropdown" menu will make it more obvious what it is supposed to do?
Comment 21 Pawel Piech CLA 2009-04-29 15:54:04 EDT
(In reply to comment #20)
> How about naming it "Auto-Expand Children", since your tooltip on the drop down
> action is "Show Children"?
> 
> Perhaps adding a "Debug Dropdown" menu in the same level as "View Mode", and
> adding this action as a "Debug Dropdown" menu will make it more obvious what it
> is supposed to do?
> 

I like "Auto-Expand Children", but I'm afraid that adding another sub-menu would be more confusing.  What if we renamed the "Compact" and "Full" modes to "Breadcrumb" and "Tree" respectively?  I was afraid of using the term "Breadcrumb" in a menu name, but I see that JDT Editor breadcrumb already does this.  Along with this change we could then have "Auto-expand Breadcrumb Drop-down", which hopefully is easier to understand.
Comment 22 Darin Wright CLA 2009-04-29 16:00:18 EDT
I'll add my comment here from the mailing list....

Would reversing the setting help? Something like "Only Show Siblings" 
(which is "on" by default). As well, should this option by hidden when 
"Full" mode is selected?
Comment 23 Pawel Piech CLA 2009-04-29 17:35:53 EDT
(In reply to comment #22)
> Would reversing the setting help? Something like "Only Show Siblings" 
> (which is "on" by default). As well, should this option by hidden when 
> "Full" mode is selected?

IMO, the biggest problem with the action is that it's hard to understand what it refers to.  Hiding it in "Full" mode would help in that regard, but when it's visible I think it still needs to refer to the drop-down somehow.
Comment 24 Darin Wright CLA 2009-07-29 14:04:20 EDT
Verified.