Dash query "2+2" should yield "4" by default

Bug #1213834 reported by pablomme
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Unity
Opinion
Low
Unassigned
Unity Home Scope
Opinion
Low
Unassigned
unity (Ubuntu)
Opinion
Low
Unassigned

Bug Description

On up-to-date saucy as of this writing:
- Open the dash
- Type "2+2"
- Look at the search results

Expected outcome:
- The calculator scope should return 4, which should be te first result so that pressing enter copies the result onto the clipboard

Actual outcome:
- The calculator scope does not return anything, it is disabled in "Filter" by default

More elaborate queries like sqrt(2) also return a bunch of results from all over the web but the calculator scope does not return anything unless it's explicitly activated in "Filter" -- which must be done for every query since the filter parameters get reset for each new search.

In my opinion, if the calculator scope manages to produces a result from a query (i.e., it manages to make sense of the input as a mathematical expression), that should be the first result in the dash. This may be applicable to other (local) scopes if their ability to produce results is a strong indication that the input is intended for that scope.

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: unity 7.1.0+13.10.20130816.3-0ubuntu1
ProcVersionSignature: Ubuntu 3.11.0-2.5-generic 3.11.0-rc5
Uname: Linux 3.11.0-2-generic x86_64
ApportVersion: 2.12-0ubuntu3
Architecture: amd64
CompizPlugins: No value set for `/apps/compiz-1/general/screen0/options/active_plugins'
Date: Mon Aug 19 09:13:19 2013
InstallationDate: Installed on 2013-08-03 (16 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Alpha amd64 (20130802)
MarkForUpload: True
ProcEnviron:
 LANGUAGE=en_GB:en
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: unity
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
pablomme (pablomme) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unity (Ubuntu):
status: New → Confirmed
Revision history for this message
ubertoo (ubertoo) wrote :

I'm affected by this bug as well. I'm surprised it got past QA, might as well not have a calculator scope at all in its current incarnation. Calculator scope hasn't worked right since 12.10 when it was added from a PPA.

Revision history for this message
Maximiliano (eots) wrote :

The existence of any mathematical symbol or function name must activate the calculator scope and prioritize it

Changed in unity:
status: New → Confirmed
Revision history for this message
Will Cooke (willcooke) wrote :

Marking this as opinion, but adding it to our master list for consideration in the 16.04 cycle. This seems like a good idea.

Changed in unity:
status: Confirmed → Opinion
Changed in unity (Ubuntu):
status: Confirmed → Opinion
tags: added: rls-w-incoming
Revision history for this message
Will Cooke (willcooke) wrote :

Could be triggered by prefixing the search with "="

Revision history for this message
David Callé (davidc3) wrote :

Note that it's already triggered with "calc:" , "result:" , "calculator:" and "calculate:".

$ grep Keywords /usr/share/unity/scopes/info/calculator.scope
Keywords=calculator;result;calculate;calc;

All queries starting with "<keyword>:" will directly query the scope you want.

In my opinion, this bug is somewhat invalid, since there already is a "calculation detector" in the Dash querying process, but other results tend to hide its effect (you often need to scroll to see the calculator result) and you also need to have online search enabled even if the calculator scope is locally installed.

========

For reference, here is some background on the calculator scope / dash relationship and how it works right now.

Let's assume a fresh Ubuntu > 14.04 install.

A) with an Internet connexion:

- A "2+2" query is typed in the Dash.
- The Dash sends the query to dash.ubuntu.com (with some metadata: version, language, list of local scopes)
- The Scopes Server sees the query starts with a digit, adds the calculator scope to a list of local scopes to activate
- It also runs its own ~relevant scopes with the query, returns results to the Dash
- and selects some other ~relevant scopes from the list of local scopes and returns a list of scopes to activate to the Dash
- The Dash activates scopes from this list (including the calculator scope)
- The calculator scope returns "4", you probably need to scroll to find it

B) If you remove the Internet connexion or decide to disable online queries:

- A "2+2" query is typed in the Dash
- The Dash runs a set of always enabled scopes and waits for the user to enable/disable scopes in the "FIlter results" list.
- You manually activate the calculator scope
- The calculator scope returns "4"

Changed in unity:
status: Opinion → Triaged
Changed in unity (Ubuntu):
status: Opinion → Triaged
Changed in unity-scope-home:
status: New → Triaged
Changed in unity (Ubuntu):
importance: Undecided → Low
Changed in unity-scope-home:
importance: Undecided → Low
Changed in unity:
importance: Undecided → Low
tags: added: rls-x-incoming
removed: rls-w-incoming
Revision history for this message
Will Cooke (willcooke) wrote :

Since this functionality exists and can be triggered by a keyword, marking this as opinion

Changed in unity:
status: Triaged → Opinion
Changed in unity-scope-home:
status: Triaged → Opinion
Changed in unity (Ubuntu):
status: Triaged → Opinion
tags: removed: rls-x-incoming
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.