Merge lp:~michihenning/unity-scopes-api/category-doc into lp:unity-scopes-api/devel

Proposed by Michi Henning
Status: Merged
Approved by: Marcus Tomlinson
Approved revision: 637
Merged at revision: 637
Proposed branch: lp:~michihenning/unity-scopes-api/category-doc
Merge into: lp:unity-scopes-api/devel
Diff against target: 30 lines (+9/-0)
2 files modified
doc/tutorial.dox (+5/-0)
include/unity/scopes/SearchReply.h (+4/-0)
To merge this branch: bzr merge lp:~michihenning/unity-scopes-api/category-doc
Reviewer Review Type Date Requested Status
Marcus Tomlinson (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+276079@code.launchpad.net

Commit message

Updated doc to make it clear that generating unique category IDs for each query is a bad idea.

Description of the change

Updated doc to make it clear that generating unique category IDs for each query is a bad idea.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'doc/tutorial.dox'
2--- doc/tutorial.dox 2015-09-02 05:35:01 +0000
3+++ doc/tutorial.dox 2015-10-29 02:41:52 +0000
4@@ -323,6 +323,11 @@
5 until your scope has processed _all_ results. To create a positive user experience,
6 your scope should push results as soon as possible.
7
8+The UI uses categories to incrementally render the display after a refresh of search results. This relies
9+on categories staying the same from query to query. If your scope has, say, a "News" category, you need
10+to make sure that the category ID and name stay the same from query to query. In particular, do _not_
11+create category IDs that are artificially unique per query (such as by appending a sequence number).
12+
13 When you create a category, you can provide a \link unity::scopes::CategoryRenderer \endlink instance.
14 The category renderer determines the visual appearance of the results in that category (such as
15 display in a grid or in a carousel layout).
16
17=== modified file 'include/unity/scopes/SearchReply.h'
18--- include/unity/scopes/SearchReply.h 2015-02-12 07:22:26 +0000
19+++ include/unity/scopes/SearchReply.h 2015-10-29 02:41:52 +0000
20@@ -90,6 +90,10 @@
21
22 \return The category instance
23 \throws unity::scopes::InvalidArgumentException if category with that id has already been registered.
24+
25+ \note The UI uses category IDs for incremental rendering when refreshing search results. For this to work
26+ correctly, you need to make sure that you use the same category ID for different queries if the search
27+ results apply to the same category as for a previous search.
28 */
29 virtual Category::SCPtr register_category(std::string const& id,
30 std::string const& title,

Subscribers

People subscribed via source and target branches

to all changes: