First-class Search

From WebOS-Ports
Jump to: navigation, search

One feature of webOS that increased productivity was search in every screen it made sense. This allows a natural transition from browsing for data, when there’s only a few items, to searching, when there are many.

Mojo’s list widget made this easy to implement. The always-present keyboard on phones could trigger a search when any key was typed, so there was no need for a search field to always take up space on screen. (“Just Type” in the original sense.) Unfortunately, this also made the feature less obvious, and casual users did not know of it. The TouchPad lacks a keyboard, and was developed in a rush, so Enyo 1 did not contain the slide-in search field of Mojo lists. Always-present search fields were added in many places. Unfortunately, between the on-screen keyboard and fixed UI such as the search field, there’s less room for list items. In Contacts, in landscape mode, only three contacts are visible while doing typedown search! (The phones display five, with smaller screens.)

A number of apps will need modification to make search a first-class interaction in LuneOS. A key part of this will be keeping the search UI from taking up too much of the limited screen real estate. Following the lead of browser URL fields, an Enyo 2.7 Control has been implemented which allows this: InputSearchStretch (https://github.com/DougReeder/enyo-animated#inputsearchstretch). It’s a horizontal flexbox container with a built-in search field. Other Controls are placed in this container, and may be obscured when the search field stretches, when it is focused. If there’s enough width, the input field doesn’t need to stretch. This hits the sweet spot between always-taking-up-space and invisible. Obviously, there’s a balancing act - Controls which may be needed during search should not be placed inside!

An example which shows how this can be implemented is https://github.com/webOS-ports/org.webosports.app.contacts/pull/24 (live demo at https://hominidsoftware.com/Contacts/ - use a narrow window to get a feel for phones). The typical user interaction is to select All or Favorites, then search within. When the user dismisses the onscreen keyboard to see the full list, the search field un-shrinks.

Currently, the following Enyo 2 apps have search:

  • Contacts
  • Memos
  • Preware 2

These Enyo 2 apps don’t yet have search:

  • Messaging (Conversations & Buddies)
  • Photos & Videos
  • File Manger
  • Tweaks

These apps are Enyo 1 or missing; action on them will have to wait for an app rewrite using the framework we adopt in 2017:

  • Email
  • Accounts (Add an Account)
  • Tasks

These Qt apps will require a Qt widget be written, or custom code:

  • Browser
  • Phone (calls list)