cannot change department from code

Bug #1568035 reported by Kyle Nitzsche
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu UX
New
Undecided
Unassigned
canonical-scopes-project
New
Undecided
Unassigned
unity-scopes-api (Ubuntu)
New
Wishlist
Unassigned

Bug Description

There is no ability to change the current department from code. This means that the scope cannot "do the right thing" when a user enters a query string in some cases.

For example, suppose a scope has departments that represent a web api's departments. And suppose the web api does not support searching inside a department but only supports searches over the whole site. What is the scope developer to do when the user is in a department *and* they enter a query string? Because there is no way now to change the department (perhaps to a department named "Search Results"), the dev *must* return results in the current department, which is incorrect.

500px web api and our 500px scope is like this. 500px has "streams" like "Editors", "Fresh today" etc. The scope displays these as departments. However, the 500px web api has no api to provide search results limited to a stream. Therefore when a user is in a department, for example "Fresh Today" and they enter a search string, the results are in fact not limited to Fresh Today but they are displayed in the Fresh Today department, which is not correct.

It is possible (and the proposed the 1.0 version of the 500px scope does this) to avoid the problem by applying the search query string to the department's results. So for example if the search was "strawberry" and the user was in "Fresh Today" department, the scope only displays received "Fresh Today" results that contain "strawberry". But this is sub-optimal because the scope needs to keep querying the api to get more and Fresh Today results trying to find matches, which takes time and may not find a match.

Revision history for this message
Paweł Stołowski (stolowski) wrote :

Do we have any idea how many services could be limited that way (and how many scopes are potentially affected)?

It would be relatively easy to add to the departments API, but this will lead to inconsistencies between scopes. Need design input.

Revision history for this message
Michi Henning (michihenning) wrote :

> 500px web api and our 500px scope is like this. 500px has "streams" like "Editors", "Fresh today" etc. The scope displays these as departments. However, the 500px web api has no api to provide search results limited to a stream. Therefore when a user is in a department, for example "Fresh Today" and they enter a search string, the results are in fact not limited to Fresh Today but they are displayed in the Fresh Today department, which is not correct.

It sounds like the scope should be post-filtering the results then. Either that, or not use departments. I'm not sure the problem is with the scopes API as such here, but with the semantic conflict between the use of departments and query results?

I understand that post-filtering is sub-optimal, but I'm also not sure that adding another feature to the API is the correct answer.

Changed in unity-scopes-api (Ubuntu):
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.