New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spec exactly how to order non-window Client objects #887

Closed
wanderview opened this Issue Apr 22, 2016 · 11 comments

Comments

Projects
None yet
5 participants
@wanderview
Copy link
Member

wanderview commented Apr 22, 2016

The Clients.matchAll() spec requires windows to be ordered so that most recently focused windows come first. This should also specify how to order non-window Clients.

This could probably as simple as:

  • Non-window Client objects are considered to never have been focused so always come at the end.
  • If there is a tie in focus ordering, order by creation time
@jakearchibald

This comment has been minimized.

Copy link
Collaborator

jakearchibald commented Jul 25, 2016

Your words are good and I agree with them all.

@jakearchibald jakearchibald added this to the Version 1 milestone Jul 25, 2016

@aliams

This comment has been minimized.

Copy link
Contributor

aliams commented Jul 26, 2016

Perhaps even more generally: if there is a tie in focus ordering, order by creation time?

@jakearchibald

This comment has been minimized.

Copy link
Collaborator

jakearchibald commented Jul 27, 2016

Pre F2F notes: Agree on ordering

@jakearchibald

This comment has been minimized.

Copy link
Collaborator

jakearchibald commented Jul 28, 2016

F2F: Wot Ben said.

@beidson

This comment has been minimized.

Copy link

beidson commented Jul 28, 2016

Webkit would prefer ordering only on creation time.

Focus time would be much trickier for us, and we're not sure what benefit it would add.

@aliams

This comment has been minimized.

Copy link
Contributor

aliams commented Jul 28, 2016

I believe it has to do with the fact that the most likely to be picked for focusing or navigating after a notification is clicked would be the window client that was most recently in focus.

@beidson

This comment has been minimized.

Copy link

beidson commented Jul 28, 2016

We could easily do:

  • Most recently focused window.
  • All other windows, ordered by creation time.
  • Non-windows, ordered by creation time.
@jakearchibald

This comment has been minimized.

Copy link
Collaborator

jakearchibald commented Aug 3, 2016

I missed these comments during the F2F sorry!

I think the common case is:

// in reaction to a notification click:
clients.matchAll().then(allClients => {
  const client = allClients.find(c => new URL(c.url).pathname == '/chat/');
  if (client) return client.focus();
  return clients.openWindow('/chat/');
});

If the user had two /chat/ tabs open, one of them focused, it'd be weird to take focus from one /chat/ tab to another. And it seems desirable to focus the most recently used /chat/ tab, but that's not essential.

I'd be happy if the order was:

  • Currently focused window, if any
  • Windows
  • Non-windows

And add a note to encourage browsers to order the windows & non-windows on relevancy descending.

This would allow browsers to give priority to a visible window on an active desktop etc.

WDYT @beverloo?

@jakearchibald

This comment has been minimized.

Copy link
Collaborator

jakearchibald commented Sep 20, 2016

Resolution:

  • You may be looking for the most recently focused "chat" window on your origin, which may not be the most recently focused window, so having all clients ordered by recently focused is useful
  • Window clients will continue to be ordered by focus time

@jungkees jungkees added the decided label Sep 20, 2016

@aliams

This comment has been minimized.

Copy link
Contributor

aliams commented Sep 28, 2016

You may be looking for the most recently focused "chat" window on your origin, which may not be the most recently focused window, so having all clients ordered by recently focused is useful

Just to clarify, "all clients" do not include non-window clients, correct?

@jakearchibald

This comment has been minimized.

Copy link
Collaborator

jakearchibald commented Oct 3, 2016

Since non-window clients cannot be focused they'll always be at the end of the list. @wanderview's original comment sums it up better than I did.

@jungkees jungkees closed this in 2e67d60 Nov 7, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment