Closed Bug 928624 Opened 11 years ago Closed 6 years ago

Use touch events instead of mouse events to switch panels

Categories

(Firefox OS Graveyard :: Gaia::Settings, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: vingtetun, Unassigned)

References

Details

(Keywords: perf, Whiteboard: [c=effect p= s= u=])

Attachments

(1 file)

This bug is primarily targeting the settings app, but is concerns other as apps.

Now that I have landed bug 863702 there is a guarantee that there is an :active state for a small duration. This small duration delayed mouse events by 100ms (customizable with a pref).

In the meantime I have also landed bug 921824 will use :hover to keep the highlighted state during the transition.

Mouse events are always generated by the platform depending on the touchstart/touchend target and so they are always slower than touch events. With the additional delay this is even more noticeable. It does not matter that much in some cases but when it comes about panel transitions then it is painful. so that should be the first target.

Switching from 'click' to 'touchend' in the settings app makes it feels much more responsive. The attached patch is a POC that breaks some parts of the settings app obviously :)

Also it is much more obvious after the second opening of some panels with a lot of dependencies since there is still this bug where all sub-panels are loaded at the same time (any volunteer to fix that? Kevin?).

So basically my steps to see the improvement is:
 - open a panel
 - hit the back button
 - re-open this panel
 - hit the back button
 - etc... (since the patch brokes going deeper in the settings apps).

Then you should see the improvement.

Kaze can you help turning this patch into a real patch. In the best case scenario it could be turned into an helper in shared/ that will let other apps use it and feels more responsive too (I'm thinking about sms,contacts,clock,music here).

Or maybe David you want to help making a lib since I know that's your cup of tea ;)
Attachment #819326 - Flags: feedback?(kgrandon)
Attachment #819326 - Flags: feedback?(kaze)
Attachment #819326 - Flags: feedback?(dflanagan)
Comment on attachment 819326 [details] [diff] [review]
settings.use.touch.events.instead.of.mouse.patch

Review of attachment 819326 [details] [diff] [review]:
-----------------------------------------------------------------

I like the idea of the patch. I also like the idea of a shared library, but my preference would be to wait until haida implementation comes around. If we implement a shared library, I also think we should re-think our routing/URL hashes and implement some standard across gaia. I'm just not sure making this a shared script without first standardizing our URLs and routing would be too helpful.

It looks like bug 922658 has been opened for lazy loading of sub-panels. If I can find time soon I'll take it.
Attachment #819326 - Flags: feedback?(kgrandon) → feedback+
(In reply to Kevin Grandon :kgrandon from comment #1)
> Comment on attachment 819326 [details] [diff] [review]
> settings.use.touch.events.instead.of.mouse.patch
> 
> Review of attachment 819326 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> I like the idea of the patch. I also like the idea of a shared library, but
> my preference would be to wait until haida implementation comes around. If
> we implement a shared library, I also think we should re-think our
> routing/URL hashes and implement some standard across gaia. I'm just not
> sure making this a shared script without first standardizing our URLs and
> routing would be too helpful.
> 
> It looks like bug 922658 has been opened for lazy loading of sub-panels. If
> I can find time soon I'll take it.

What about thinking about a plan here and start to implement things? I'm worried that finalizing Haida will postpone this stuff to a few releases in the future while the we can have a nice responsiveness win today.

One possible shared/ lib could be to not care with url/hashes at all and instead do something similar to gesture detector but in a much more scoped way. What I meant is we can analyze touch events and if they looks like a click we can dispatch a 'tap' event (really like what gesture detector does but just for this specific need / or maybe we can reuse gesture detector, David what do you think?).
(In reply to Vivien Nicolas (:vingtetun) (:21) from comment #2)
> (In reply to Kevin Grandon :kgrandon from comment #1)
> What about thinking about a plan here and start to implement things?

For sure, I think that is a great idea, and settings is probably a good first app to get things in motion. I'm currently working on subpanel loading in bug 922658, and once that's done I'd be more than happy to help out :)
(In reply to Vivien Nicolas (:vingtetun) (:21) from comment #0)
> Switching from 'click' to 'touchend' in the settings app makes it feels much
> more responsive. The attached patch is a POC that breaks some parts of the
> settings app obviously :)

Vivien is this relevant to other applications as well? We've got panel transitions in messages and contacts too so we might want to check them out.
Whiteboard: [u=profiliing s= p= c=]
Vivien,

Any comment on Gabriel's question in comment 4?

(In reply to Gabriele Svelto [:gsvelto] from comment #4)
> ...
> Vivien is this relevant to other applications as well? We've got panel
> transitions in messages and contacts too so we might want to check them out.
Flags: needinfo?(21)
Priority: -- → P3
Whiteboard: [u=profiliing s= p= c=] → [c=effect p= s= u=]
Comment on attachment 819326 [details] [diff] [review]
settings.use.touch.events.instead.of.mouse.patch

It has changed a bit with APZ. So now the delay is only of 10ms (http://mxr.mozilla.org/mozilla-central/source/modules/libpref/src/init/all.js#4046)

Not sure the necessary efforts to fix that worth it at the moment.
Attachment #819326 - Flags: feedback?(fabien)
Attachment #819326 - Flags: feedback?(dflanagan)
Flags: needinfo?(21)
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: