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

Bug 320327

Summary: [Compatibility] 'Team > Show History' does not work if you have the 'History' view open in another perspective
Product: [Eclipse Project] e4 Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Remy Suen <remy.suen>
Status: VERIFIED FIXED QA Contact: Remy Suen <remy.suen>
Severity: normal    
Priority: P3 CC: bokowski, pwebster, susan
Version: 1.0Flags: pwebster: review+
susan: review+
Target Milestone: 1.0 RC3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
WorkbenchPage patch v1
none
WorkbenchPage patch v2
none
WorkbenchPage patch v3 none

Description Remy Suen CLA 2010-07-19 17:20:15 EDT
I20100716-1834

1. Wipe your deltas.
2. Point your Eclipse at your 4.0 workspace (which should have code from CVS naturally).
3. Window > Open Perspective > Other... > CVS Repository Browsing
4. Ctrl+F8 > Java
5. Open some file under version control.
6. Right-click > Team > Show History
7. Nothing happens.
8. Ctrl+F8 > CVS Repository Browsing
9. Right-click > Team > Show History
10. It works here. :(

The workaround is to just show the 'History' view in the perspective before you try to use the menu item.

The root cause is bug 315133 but fixing that for RC3 requires a lot of changes in my opinion (haven't done a full assessment but this is my gut feeling).
Comment 1 Susan McCourt CLA 2010-07-19 17:27:53 EDT
this one has been bugging me for some time because I hit it *all the time* in my day to day workflows.

Once you know the workaround, life can continue, but the first time it happened to me it made me think that things were very unstable or broken, and I didn't think to do "show view" until I thought about the implementation.  It's not intuitive to a regular user.
Comment 2 Remy Suen CLA 2010-07-19 17:28:37 EDT
Created attachment 174677 [details]
WorkbenchPage patch v1

Instead of just activating the part, we ask the part service to show the part. This ensures that the part will be brought up.
Comment 3 Remy Suen CLA 2010-07-20 12:39:54 EDT
(In reply to comment #2)
> Created an attachment (id=174677) [details]
> WorkbenchPage patch v1

Paul, please take a look.
Comment 4 Remy Suen CLA 2010-07-20 12:40:29 EDT
Susan, please approve for RC3 candidate.
Comment 5 Susan McCourt CLA 2010-07-20 14:07:17 EDT
+1 for RC3.

I assume Paul is giving the OK on the code itself.
I examined the patch and AFAICT, the show part (specifically the addPart processing) is what the user workaround (explicitly showing the view) was doing, which is good.  Paul can assess the risk...
Comment 6 Paul Webster CLA 2010-07-20 14:12:59 EDT
OK, looks good.

PW
Comment 7 Remy Suen CLA 2010-07-20 14:19:16 EDT
Fix released to HEAD. I took the liberty of inlining a comment to explain the change.
Comment 8 Remy Suen CLA 2010-07-21 07:36:34 EDT
Uh-oh, if you Ctrl+F8 back you'll notice that the 'History' view is now missing from the 'CVS Repository Browsing' perspective. :/
Comment 9 Remy Suen CLA 2010-07-21 07:57:19 EDT
Created attachment 174835 [details]
WorkbenchPage patch v2

Delegate to the 4.0 code instead of the EPS. This will allow the references and placeholders to be sorted out prior to attempting to show the part.

The problem was that when the part was shown in the original perspective, it simply dragged its original placeholder from the other perspective instead of spawning a new one which caused the other perspective to no longer have the view up.
Comment 10 Remy Suen CLA 2010-07-21 07:58:27 EDT
Paul and Susan, will need new +1s I'm afraid.
Comment 11 Paul Webster CLA 2010-07-21 09:00:01 EDT
This looks good and makes sense.

PW
Comment 12 Susan McCourt CLA 2010-07-21 12:37:45 EDT
The code looks a bit Greek to me (I've not had to delve into the inner workings of part management, secondary id, etc....).

But
- Paul says it's OK 
- I'm +1 that we should fix this for RC3
- tested the patch and verified it solves the problem
- Ctrl+F8 is working in this scenario

Paul - if you think another knowledgeable reviewer should have a look at the patch, please say so (as I don't think I'm knowledgeable enough to count).
Comment 13 Remy Suen CLA 2010-07-21 13:04:26 EDT
(In reply to comment #9)
> Created an attachment (id=174835) [details]
> WorkbenchPage patch v2

Delivered to HEAD with an NPE check on the tags in case someone added a 'null' in the collection.
Comment 14 Remy Suen CLA 2010-07-21 13:08:00 EDT
Emergency rollback. None of us tested editors it seems. Can't use showView(*) on editors, whoops.
Comment 15 Remy Suen CLA 2010-07-21 13:45:21 EDT
Created attachment 174887 [details]
WorkbenchPage patch v3

Alright, let's not try to show editors as views...
Comment 16 Remy Suen CLA 2010-07-21 13:45:44 EDT
(In reply to comment #15)
> Created an attachment (id=174887) [details]
> WorkbenchPage patch v3

Paul, please review this v3. :(
Comment 17 Paul Webster CLA 2010-07-21 14:12:05 EDT
OK, this also makes sense. +1

Boris, is this behaviour OK?

PW
Comment 18 Boris Bokowski CLA 2010-07-21 14:41:10 EDT
yes, I'm fine with opening another editor instance.
Comment 19 Remy Suen CLA 2010-07-21 14:44:25 EDT
Well, I hope we don't need to respin another patch.
Comment 20 Remy Suen CLA 2010-07-22 07:27:09 EDT
Verified on Windows XP with I20100721-2056.