← Back to team overview

dx-packages team mailing list archive

[Bug 1213834] Re: Dash query "2+2" should yield "4" by default

 

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"

-- 
You received this bug notification because you are a member of DX
Packages, which is subscribed to unity in Ubuntu.
Matching subscriptions: dx-packages
https://bugs.launchpad.net/bugs/1213834

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

Status in Unity:
  Triaged
Status in unity package in Ubuntu:
  Triaged

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)

To manage notifications about this bug go to:
https://bugs.launchpad.net/unity/+bug/1213834/+subscriptions