Page MenuHomePhabricator

Trigger search only for confirmed characters
Closed, ResolvedPublic

Description

Problem

On a KaiOS device with a numerical keyboard, letters are grouped by 3 (abc, def, etc). Typing a specific letter often means cycling through other letters, numbers and characters, and that causes several unnecessary search queries. For example, to get to the letter C, we have to press the 2 key 3 times and that triggers search queries for "a", "b", and finally "c". These extra queries use up bandwidth, battery life and are slowing down the device.

Solution

Try to find a way to detect that the user is currently cycling through characters and only trigger a search when the last character is considered "confirmed".

In other similar situations (typing accented characters or Chinese characters using pinyin), there are compositionstart, compositionupdate, and compositonend events. I don't know if they exist in this context.

NOTE: it turns out there is a compositionend event fired when the character is confirmed.

Steps

  1. On a device with a numeric keyboard
  2. On Search screen
  3. Press 2 abc
  4. Letter "a" appears
  5. No search is triggered
  6. Quickly press 2 abc again
  7. Letter "a" disappears and letter "b" appears
  8. Wait a second or press CSK to dismiss characters selector and confirm letter "b"
  9. Search triggered for letter "b"

Event Timeline

hueitan renamed this task from Save bandwidth on article Search API to Save bandwidth on article Search API (Performance Recommendation).Mar 25 2020, 1:01 PM

If I understand the description correctly, the proposal here is to hold on while the characters selector is open and only search a character is confirmed (the user is no longer cycling through the different characters of a key (2, a, b, c)).

We would need to test what is happening with the textbox. Is there anyway for the app to tell that a character is confirmed.

SBisson renamed this task from Save bandwidth on article Search API (Performance Recommendation) to Trigger search only for confirmed characters.Mar 24 2021, 1:13 PM
SBisson triaged this task as Medium priority.Mar 24 2021, 1:49 PM
SBisson moved this task from Ready for Dev to Dev on the Inuka-Team (Kanban) board.
SBisson updated the task description. (Show Details)

I assume this only apply to the article search page, and not for the language / article language page.

I assume this only apply to the article search page, and not for the language / article language page.

That's right. The goal is to optimize network requests. It would be nice to make the search language consistent but that would be another task.

The PR is approved but not merged.

I think the question above is resolved. Feel free to merge if you think this is ready.