Open Bug 1763362 Opened 3 years ago Updated 2 years ago

Rectify/implement behaviour for selecting a range of pills with Shift+End and Shift+Home

Categories

(Thunderbird :: Message Compose Window, defect)

Thunderbird 91
defect

Tracking

(Not tracked)

People

(Reporter: thomas8, Assigned: thomas8)

References

(Blocks 1 open bug)

Details

(Keywords: access, ux-consistency, ux-efficiency)

Attachments

(1 file)

We currently have an incomplete and inconsistent implementation of selecting a range of recipient pills in composition via keyboard using Shift key. For example:

  • Shift+Home from address input works for selecting all pills in the address row, but ...
  • Shift+Home from last pill fails (selects only the first pill).
  • Shift+End from any pill doesn't work at all (focuses the address input).

These are standard OS-wide selection patterns, important for ux-efficiency, ux-consistency, and accessibility. Implementation is non-trivial because the checkKeyboardSelected() function also handles disjunct Ctrl selections, Ctrl+Shift selections, and a variety of edge cases involving the address input.

STR

  1. Start a new message with multiple recipient pills (e.g. a reply where you want to remove some, but not all recipients).
  2. Select any non-corner pill (e.g. pill 3 out of 6), hold Shift and ...
  • ... press End key
  • ... press Home key

Actual

  • Shift+End fails to select all pills from focused pill to last pill
  • Shift+Home fails to select all pills from focused pill to first pill

Expected

  • Shift+End must select all pills from focused pill to last pill
  • Shift+Home must select all pills from focused pill to first pill

I've been working on a patch, which is ready save for some final touches.

(In reply to Thomas D. (:thomas8) from comment #0)

  • Shift+End must select all pills from focused pill to last pill

If we want to be consistent with the XUL:tree selection behaviour, it should select from a "pivot point", which is not necessarily the last focused pill. For example, with 4 elements, "Shift+Left, Shift+Home" should select all the elements, not just 3 of them. It is a bit complicated to explain, but I'm defining the behaviour for all (multi-)selection widgets as part of bug 1752532. This area could probably inherit from it to save all the duplication.

It also seems that the current controls are the wrong way around in right-to-left.

For better ux-efficiency, ux-consistency and accessibility in composition's
addressing area, implement some more standard OS-wide selection patterns:

  • Shift+Home should typically select all pills from focused pill to first pill
  • Shift+End should typically select all pills from focused pill to last pill

Complete rewrite of checkKeyboardSelected() function to avoid nested
conditionals. Adjust, unify and simplify callers.

(In reply to Henry Wilkes [:henry] from comment #3)

(In reply to Thomas D. (:thomas8) from comment #0)

  • Shift+End must select all pills from focused pill to last pill

If we want to be consistent with the XUL:tree selection behaviour, it should select from a "pivot point", which is not necessarily the last focused pill.

Yes, complex selection patterns with Shift and with or without Ctrl may involve extending selection from the last selected rather than last focused item.

For example, with 4 elements, "Shift+Left, Shift+Home" should select all the elements, not just 3 of them.

This works with my patch.

It is a bit complicated to explain, but I'm defining the behaviour for all (multi-)selection widgets as part of bug 1752532. This area could probably inherit from it to save all the duplication.

I would expect this to be non-trivial, so I think we could do an incremental improvement here.

It also seems that the current controls are the wrong way around in right-to-left.

Yes, we don't cater for right-to-left yet.

(In reply to Thomas D. (:thomas8) from comment #5)

For example, with 4 elements, "Shift+Left, Shift+Home" should select all the elements, not just 3 of them.

This works with my patch.

Another example is "End, Shift+Home, Shift+Right" should select everything but the first item. I.e., whilst using Shift, you can go back on yourself and un-select. And there are all sorts of edge cases to consider when combining with Ctrl-navigation, etc.

It is a bit complicated to explain, but I'm defining the behaviour for all (multi-)selection widgets as part of bug 1752532. This area could probably inherit from it to save all the duplication.

I would expect this to be non-trivial, so I think we could do an incremental improvement here.

I've been thinking it through and I might know how to make it work. By the way, thanks for CCing me on this bug because I hadn't considered the recipient pills when designing it.

Can you wait a little bit with patching this bug? I'm going to define the selection and focus behave in bug 1752532 in a comment soonish, so the full behaviour will be clearer then. Once that is done, I'm going to construct the corresponding javascript class that will handle this behaviour. This part could take a while, but it could be used here.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: