Bug 176661 - [Intro] Show intro if new intro content is available
Summary: [Intro] Show intro if new intro content is available
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.3 M6   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2007-03-07 18:39 EST by Boris Bokowski CLA
Modified: 2007-03-23 10:24 EDT (History)
6 users (show)

See Also:


Attachments
patch (2.34 KB, patch)
2007-03-07 19:24 EST, Boris Bokowski CLA
no flags Details | Diff
new patch (9.51 KB, patch)
2007-03-15 12:38 EDT, Boris Bokowski CLA
no flags Details | Diff
Screenshot (17.44 KB, image/x-png)
2007-03-15 13:50 EDT, Chris Goldthorpe CLA
no flags Details
Screenshot (17.44 KB, image/x-png)
2007-03-15 13:50 EDT, Chris Goldthorpe CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Bokowski CLA 2007-03-07 18:39:08 EST
To discover newly installed functionality, it is important that we show the Welcome/intro view whenever there is new content available.  Otherwise, you download new stuff and have no idea where to find the new functionality.  I talked to Dejan about this and it appears that we need to do work on our side to enable this.  UA would have to react and ideally highlight new content on the intro pages.

I'm proposing making a change in the IDE application's WorkbenchWindowAdvisor that shows the Intro after a restart if there might be new content to show.  This has to be enabled at our level because we determine very early whether to show the Intro or not, currently based on a preference.  Dejan and I did this over lunch, and I'm not sure if there are corner cases that we need to watch out for so I'm asking you (Kim, specifically) to look at the patch and give feedback.

(Patch to follow)
Comment 1 Dejan Glozic CLA 2007-03-07 18:46:54 EST
Adding Chris who would need to catch the use case on the UA side.

What we would need to do is:

1) Know if this is a first use of Welcome or a repeated open (subsequent restart)
2) Identify contributions that didn't exist before
3) Highlight them in Universal Welcome using the existing 'importance' flag for new contributions
Comment 2 Boris Bokowski CLA 2007-03-07 19:24:54 EST
Created attachment 60403 [details]
patch

Correction: This change is not in ide.application but in the workbench itself.
Comment 3 Mike Wilson CLA 2007-03-08 09:35:38 EST
I like the idea of doing this when the resulting welcome page will be visibly different, but I think it will be confusing if we show it (because there might be something different) when there turns out to be no changes. Can we change either the welcome content or our restart dialog to indicate why the welcome page is being shown again?
Comment 4 Kim Horne CLA 2007-03-08 10:31:44 EST
I dont like the idea of looking at the UA intro extension point in the UI but I can't really think of a better way to do it.  With that in mind the patch looks okay from my perspective.
Comment 5 Boris Bokowski CLA 2007-03-08 10:37:43 EST
(In reply to comment #3)

My hope was that if UA implements the items from comment #1, the welcome content would be different enough.  Maybe in addition to highlighting new content, you also explain to the user that there is new content?  Could you show a variant of the first welcome page that is more of a "welcome back" than a "welcome", with pointers to the new welcome content?
Comment 6 Mike Wilson CLA 2007-03-08 10:45:46 EST
Actually, I was worried about the case where there *wasn't* any new content. I suspect this will be the common case until the community becomes more welcome-aware.
Comment 7 Boris Bokowski CLA 2007-03-08 11:23:09 EST
(In reply to comment #4)
I think I found a cleaner solution: We would add an attribute to the intro element so that the extender (UA) can provide a class that does the check for new content.  This class could be in a package that does not cause plug-in activation to keep the cost down.

On our side:
public abstract class IntroContentDetector {
  public boolean hasNewContent();
}

On the UA side:
   <extension
         point="org.eclipse.ui.intro">
      <intro
            class="org.eclipse.ui.intro.config.CustomizableIntroPart"
            contentDetector="org.eclipse.ui.intro.detect.ContentDetector"
            icon="$nl$/icons/welcome16.gif"
            id="org.eclipse.ui.intro.universal"/>
   </extension>

public class ContentDetector implements IntroContentDetector {
  public boolean hasNewContent() {
    //... code accessing the UA extension point goes here
  }
}

org.eclipse.ui.intro.detect would have to be declared in the manifest file as a package that does not cause plug-in activation.
Comment 8 Boris Bokowski CLA 2007-03-08 11:27:05 EST
(In reply to comment #6)
> Actually, I was worried about the case where there *wasn't* any new content. I
> suspect this will be the common case until the community becomes more
> welcome-aware.

The attached patch checks how many intro content extensions are plugged in and compares it with the number of extensions in the previous session.  Welcome is only shown if there are more intro content extensions and therefore new content that the user hasn't seen. (Admittedly, the attached code is a bit of a hack, hence my proposal in the previous comment for a cleaner solution.)
Comment 9 Dejan Glozic CLA 2007-03-08 11:51:38 EST
McQ, as Boris pointed out, the increase in the number of welcome extensions implies that there is new content to look at. Intro should also be aware of this and switch to the first page with the new content, as well as highlight it sufficiently (the visual aspects of the highlight is under control of the current Welcome theme CSSs). I agree that showing the old welcome without nothing new to look at would be very confusing.
Comment 10 Mike Wilson CLA 2007-03-08 12:09:13 EST
+1
Comment 11 Chris Goldthorpe CLA 2007-03-14 17:23:39 EDT
I think the proposal in comment #7 is the right way to go. It doesn't seem to make sense for Platform UI to have to make the decision on whether intro content has changed in a sufficiently interesting way. 

Two other comments:

1. The interface name should be IIntroContentDetector.
2. The attribute contentDetector needs to be optional (you were probably already planning on this).

And a minor question:

should it be hasNewContent() or isNewContent() ?
Comment 12 Dejan Glozic CLA 2007-03-14 18:23:52 EDT
I am not sure about the getter name patters, but I know that 'isFoo' is the preferred pattern for the property 'foo'. If the result sounds funny, the alternative would be 'getFoo'. I know that we have used 'hasFoo' occasionally and also third-person verbs ('exists', 'contains').
Comment 13 Chris Goldthorpe CLA 2007-03-14 18:37:24 EDT
getNewContent() sounds even stranger than isNewContent() since it is not actually getting any content.
Comment 14 Boris Bokowski CLA 2007-03-14 19:37:06 EDT
isNewContentAvailable() ?
Comment 15 Dejan Glozic CLA 2007-03-14 19:43:42 EDT
Yeah, that one sounds good.
Comment 16 Dejan Glozic CLA 2007-03-14 19:46:21 EDT
To summarize:

1. The interface name should be IIntroContentDetector.
2. The attribute contentDetector attribute needs to be optional in the schema.
3. The method should be 'isNewContentAvailable'
4. How will the UI team ensure that the detector is loaded without trip-loading the contributing bundle (I remember this feature is avaiable in OSGi)?
5. If 4. is possible, we need to document it well so that the contentDetector class does not make assumptions that the contributing bundle is running when it is loaded.
Comment 17 Boris Bokowski CLA 2007-03-14 21:09:13 EDT
(In reply to comment #16)
> 4. How will the UI team ensure that the detector is loaded without trip-loading
> the contributing bundle (I remember this feature is avaiable in OSGi)?

This will have to be ensured by the UA team ;) by putting the detector class in a separate package that does not trigger bundle activation.

Eclipse-LazyStart: true; exceptions="org.eclipse.ui.intro.somepackage"

See http://help.eclipse.org/help32/topic/org.eclipse.platform.doc.isv/reference/misc/bundle_manifest.html
Comment 18 Dejan Glozic CLA 2007-03-15 08:08:10 EDT
Sounds perfect. OK, I think we are all set here.
Comment 19 Boris Bokowski CLA 2007-03-15 11:47:27 EDT
(In reply to comment #16)
> To summarize:
> 
> 1. The interface name should be IIntroContentDetector.

Minor tweak: I would like to make it an abstract class as opposed to an interface. 
Comment 20 Boris Bokowski CLA 2007-03-15 12:38:02 EDT
Created attachment 60976 [details]
new patch

Curtis, could you please look at this patch to see if it is sufficient to implement the remaining logic on your end?
Comment 21 Boris Bokowski CLA 2007-03-15 12:47:55 EDT
(In reply to comment #20)
> Curtis,

Sorry for mixing up the names - I meant "Chris, could you..."
Comment 22 Chris Goldthorpe CLA 2007-03-15 13:17:08 EDT
I have your patch installed and am reviewing it right now.
Comment 23 Curtis d'Entremont CLA 2007-03-15 13:42:22 EDT
I assume we want welcome to open to a specific page where there's new content? If this is the case, how will we know whether the user went to help -> welcome (show the main page) versus opening on startup? (show page with new stuff). Or do we want to just always jump to the new stuff if you go to help -> welcome?
Comment 24 Chris Goldthorpe CLA 2007-03-15 13:50:20 EDT
Created attachment 60991 [details]
Screenshot 

The API looks good, exactly what we need.

I did some testing with the patch, I didn't actually count extensions, just tested what would happen if I returned true or false. It worked fine in every case except for a painting glitch when the Welcome was already showing and the function returned true, see attachment. Apart from that it works fine.
Comment 25 Chris Goldthorpe CLA 2007-03-15 13:50:22 EDT
Created attachment 60992 [details]
Screenshot 

The API looks good, exactly what we need.

I did some testing with the patch, I didn't actually count extensions, just tested what would happen if I returned true or false. It worked fine in every case except for a painting glitch when the Welcome was already showing and the function returned true, see attachment. Apart from that it works fine.
Comment 26 Chris Goldthorpe CLA 2007-03-15 13:51:43 EDT
I'm not sure why that got attached twice, I only pressed the button once!
Comment 27 Chris Goldthorpe CLA 2007-03-15 14:12:16 EDT
In reply to Comment #23, here's what I think should happen.

We remember the result of the last call to isNewContentAvailable().
If it returned true then Welcome opens in the mode where it emphasizes the new content. If it returned false Welcome opens in the regular mode.

An interesting question is how long do newly installed features get to be displayed as new? Is it just the first time the user starts Eclipse after installing the features or do we keep the "new" designation for a number of days (14 or 30).
Comment 28 Boris Bokowski CLA 2007-03-15 14:50:24 EDT
(In reply to comment #25)
> The API looks good, exactly what we need.

Thanks for reviewing the patch.  I wrote to eclipse-pmc to request the API addition - we can fix the layout problem later once UA starts to make use of the new API.
Comment 29 Mike Wilson CLA 2007-03-15 15:26:42 EDT
+1
Comment 30 Boris Bokowski CLA 2007-03-15 15:38:16 EDT
Released >20070315.
Comment 31 Boris Bokowski CLA 2007-03-15 15:41:17 EDT
Filed bug 177635 for the UA side of this.
Comment 32 Boris Bokowski CLA 2007-03-23 08:58:17 EDT
Chris, could you please verify that this is working in a recent I build (like e.g. I20070322-1800) ?  Thanks!
Comment 33 Chris Goldthorpe CLA 2007-03-23 10:17:18 EDT
I verified it yesterday using what was then the latest build.
Comment 34 Boris Bokowski CLA 2007-03-23 10:24:51 EDT
Thanks!