Callback on preview displayed

Asked by Michael Weimann

Hi there,

I'm currently looking for a way to get notified when a preview page is actually displayed. The scope's 'preview' callback is not a good option, because it also gets called when previews are prefetched. Is something built in to detect a 'real' preview view? If not is there any other way to get this information?

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
unity-js-scopes Edit question
Assignee:
No assignee Edit question
Solved by:
Marcus Tomlinson
Solved:
Last query:
Last reply:
Revision history for this message
Marcus Tomlinson (marcustomlinson) said :
#1

Unfortunately there is no such callback available, even in the base C++ scopes framework. Sorry :/

Perhaps if you motivate a strong enough reason for this, we can consider introducing it?

Revision history for this message
Michael Weimann (m982) said :
#2

The use case is detecting what items the user viewed. So you're able to built a "recent" category for e.g.. If the user looks up the same items several times, just store them in "recent" so he find's it faster.

What's the right way now? Filing a blueprint in unity-scopes-api?

Revision history for this message
Best Marcus Tomlinson (marcustomlinson) said :
#3

Hi Michael, sorry been away on paternity leave :)

There is a change for the Scopes shell in the pipeline to remove that pre-fetching you're talking about. So you should be able to simply use your preview run() call as a means of storing a previewed history once that lands.

You can watch the progress of this change here:

https://code.launchpad.net/~stolowski/unity-scopes-shell/single-preview/+merge/286526

Revision history for this message
Marcus Tomlinson (marcustomlinson) said :
#4

Also linked the bug that MP is related to. Once that bug is resolved, your issue here will be resolved too.

Revision history for this message
Michael Weimann (m982) said :
#5

Thanks Marcus Tomlinson, that solved my question.