Closed Bug 1527547 Opened 6 years ago Closed 6 years ago

Fix and improve UX of navigating, selecting, and deleting recipients in composition (incl. auto-select and cursor down/up, Bug 1530254)

Categories

(Thunderbird :: Message Compose Window, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 67.0

People

(Reporter: thomas8, Assigned: thomas8)

References

Details

(4 keywords)

User Story

1. Using DEL to delete recipients "forwards" (to the right of the cursor) unexpectedly gets stuck at the end of the previous row (backwards).
2. Using Backspace to delete recipients characterwise is odd and error-prone because it suddenly eats into other recipients. What if I just want to delete a single recipient via keyboard?
3. Using mouse and clicking on the [x] button next to the recipient type selector also suffers from TB shifting focus in the wrong direction (backwards), so that even in a fully expanded recipient widget, TB never selects what is next to be deleted under the mouse cursor (normally the next row, going forwards).
4. Keyboard navigation between recipients is clumsy, flimsy and counter-intuitive: Why would I use double-TAB when the logical direction is just going up and down in the recipients list, for which simple cursor up/down could suffice?

Attachments

(4 files, 4 obsolete files)

(deleted), patch
aceman
: review+
Paenglab
: ui-review+
Details | Diff | Splinter Review
(deleted), patch
jorgk-bmo
: review+
Details | Diff | Splinter Review
(deleted), patch
Details | Diff | Splinter Review
(deleted), patch
jorgk-bmo
: review+
Details | Diff | Splinter Review

There are focus issues which impede/confuse the workflow when deleting multiple recipients, depending on direction. Essentially, it only works somewhat "correctly" when using backspace to delete "backwards" (going leftwards/upwards to the first recipient).

Note: We have folded bug 1530254 (navigate recipients with cursor down/up) into this bug 1527547 because they complement each other well and are in the same corner of the code. We've also added auto-select of recipients on focus to create a hassle-free, efficient UX both mouse and keyboard. This bug provides a precursory "pill-style" experience in the current release version as of TB 68, even before the advent of real recipient pills in bug 440377.

STR

  1. Compose message with three recipients: R1, R2, R3. Ensure this scenario before going into any of the alternative steps below.
    1. Click recipient delete button on R2 and don't move your pointer after that.
    2. Place cursor in front of R2 and use DEL button on (windows) keyboard to delete "forward" (to the right of cursor).
    3. For comparison: Place cursor after R2 and use BACKSPACE button on (windows) keyboard to delete "backward" (to the left of cursor).

Actual result

    1. Mouse pointer is over the delete button of recipient R3, but keyboard focus has been moved to the end of R1, which causes R1 to be highlighted, which is unexpected, irritating and useless because clicking again will delete R3, not R1. Iow, using the recipient delete button will delete "forwards" up to the last recipient, but focus jumps "backwards" each time. This will certainly also cause havoc to screen readers.

    2. Using DEL, having deleted R2 rightwards, focus suddenly jumps leftwards to the end of R1 and gets stuck there. This is unexpected, useless, and inconsistent because when using Backspace (leftwards deletion), we allow holding the key to delete multiple recipients, so why is it different here?

    3. Using BACKSPACE, having deleted R2 leftwards, focus correctly shifts leftwards to the end of R1 and user can continue deleting leftwards, which is predictable and expected as far as direction of deleting is concerned (although it's also somewhat error-prone if you hold a little too long).

Expected result

    1. Using recipient delete button is a "forward"/rightwards action, so the next recipient (R3) which is going to be deleted with the next click in same position should also be focused and highlighted. Not sure about the exact cursor position, at the end of R3 would feel right to me (alternatively, at the start of R3, or R3 highlighted).

    2. Using DEL button is a a "forward"/rightwards action, so focus should seamlessly shift forwards/rightwards to the start of the next recipient (R3) and allow deleting that (reverse case of 2.iii.)).

Summary: After deleting recipients with dedicated UI button or DEL on keyboard, focus wrongly moves to the previous recipient → After deleting recipients with dedicated UI button or DEL on keyboard (forwards/rightwards), focus wrongly moves to the previous recipient

This fixes comment 0 nicely, and another bug where placing the cursor e.g. in the middle of an input, then deleting a neighbor forwards/backwards will pointlessly remember the last cursor position/selection when that other field gets focus again.

I reduced the sibling.sibling thing by using parent.parent, which is safer, and I moved that query-selector into the .js code, hence radically simplifying the onclick attribute in XUL, which gets duplicated for every recipient so it should be as simple as possible for better performance.

One known glitch: When deleting with mouse causes scrollbar to disappear, recipients shift under the mouse so that the previous recipient will be hovered, but the next recipient is focused. It does work perfectly when header is big enough to avoid scrollbar, then the next item to be deleted by click will be under the mouse and focused.

I provided for deleteFlavor "deleteClick" (currently unused) so that it'll be easier to fix the remaining glitch as we won't have to break up the logic again.

Assignee: nobody → bugzilla2007
Status: NEW → ASSIGNED
Attachment #9044532 - Flags: ui-review?(richard.marti)
Attachment #9044532 - Flags: feedback?(jorgk)
Attachment #9044532 - Flags: feedback?(jorgk) → feedback?(acelists)
Comment on attachment 9044532 [details] [diff] [review] Patch V.1: Fix most focus/selection issues when deleting recipient (In reply to Thomas D. (currently busy elsewhere) from comment #1) > Created attachment 9044532 [details] [diff] [review] > Patch V.1: Fix most focus/selection issues when deleting recipient > > This fixes comment 0 nicely, and another bug where placing the cursor e.g. in the middle of an input, then deleting a neighbor forwards/backwards will pointlessly remember the last cursor position/selection when that other field gets focus again. I don't see see this with remembering the cursor position.
Attachment #9044532 - Flags: ui-review?(richard.marti) → ui-review+
Depends on: 1528840
Attachment #9044532 - Flags: feedback?(acelists) → review?(acelists)

Jörg, how can we ensure that this gets the missing review timely to avoid bitrot? I think the code is pretty straightforward, nothing obscure here

Flags: needinfo?(jorgk)

Ping him personally?

Flags: needinfo?(jorgk)
Blocks: 1530254

Let's get this right, right here. This fixes and improves the overall UX of navigating, selecting, and deleting recipients.
Now with auto-select, cursor down/up navigation (Bug 1530254), convenient and concise deletion of recipients via keyboard, and error-prevention for inline deletion.

Aceman, could you please review this soonish?
Richard, requesting ui-r because of some new tweaks here.

Try this after applying the patch:

  1. Add at least 3 recipients:
    John <john@asdf.com>
    Recipient 2 <second@foo.com>
    Jane <jane@bar.com>
    (Cursor is now in the empty To: field after Jane.)
  2. Cursor up (or left-click) to select "Recipient 2". Wow, that was easy!
  3. Press DEL (or BACKSPACE) twice to delete "Recipient 2" and the empty row, and continue hitting the same key intermittently (tap-tap, tap-tap) to delete more recipients (or hold to delete them all).
  4. If for whatever reason you prefer to delete "Jane <...>" character by character, place cursor at start or end position and hold a deletion key until she's gone: we'll automatically stop you there for a second. Press a deletion key again to delete the empty row.
  5. Never try this in the current release version...

Fixes and improvements in detail:

  • ux-efficiency, ux-control, ux-consistency: Cursor down/up are now enabled to navigate the list of recipients vertically, with convenient auto-selection (see below). Forget about clumsy and flimsy double-TAB, and enjoy the new feeling of control with ease (Bug 1530254). Of course we don't interfere with your autocomplete navigation.
  • ux-efficiency: Recipients are now auto-selected no matter how you touch them (keyboard/mouse). It's much more likely that user wants to act on the complete address |John Doe <john@asdf.com>| than to change something inside the address.
  • ux-consistency: When using DEL key to delete recipient rows, we're now observing direction (forwards/downwards first).
  • ux-error-prevention: When holding DEL or BACKSPACE to delete letterwise within a single recipient text (inline deletion), we no longer eat into the next or previous recipient, because it's nonsense and error-prone to delete more than 1 recipient letter by letter. But when you start deleting on an empty row (i.e. let go of the keys after inline deletion), we'll still do row deletion as expected, in the correct direction.
  • replaced deprecated event.keyCode notation with simpler and more transparent event.key
  • removed awKeydown() function and which could never occur because we catch the only two keys of that function here in awRecipientKeyDown(...) and explicitly prevent awKeydown via event.stopPropagation (see comment in old code). Maybe we'd want to check if this was used by Addons, but it's unlikely and they definitely shouldn't.
Attachment #9044532 - Attachment is obsolete: true
Attachment #9044532 - Flags: review?(acelists)
Attachment #9046337 - Flags: ui-review?(richard.marti)
Attachment #9046337 - Flags: review?(acelists)
Summary: After deleting recipients with dedicated UI button or DEL on keyboard (forwards/rightwards), focus wrongly moves to the previous recipient → Fix and improve UX of navigating, selecting, and deleting recipients in composition (incl. auto-select and cursor down/up, Bug 1530254)

(In reply to Thomas D. (currently busy elsewhere) from comment #5)

  1. Press DEL (or BACKSPACE) twice to delete "Recipient 2" and the empty row, and continue pressing the same key intermittently (tap-tap, tap-tap) to delete more recipients (or hold to delete them all).

Sorry, if I have not understood how it is functioning correctly.

Is there an Undo function for the deletion? Otherwise, holding the DEL key to delete multiple recipients seem prone to unwanted deletion. Maybe stick to tab-tab?

User Story: (updated)

(In reply to xracoonx from comment #6)

(In reply to Thomas D. (currently busy elsewhere) from comment #5)

  1. Press DEL (or BACKSPACE) twice to delete "Recipient 2" and the empty row, and continue pressing the same key intermittently (tap-tap, tap-tap) to delete more recipients (or hold to delete them all).

Sorry, if I have not understood how it is functioning correctly.

Have you tried it??

Is there an Undo function for the deletion?

No Undo (before or after this patch); out of scope for this bug.

Otherwise, holding the DEL key to delete multiple recipients seem prone to unwanted deletion.

Using DEL on a recipient key WAS prone to unwanted deletion of other recipients before my patch, I actually made it safer: When you delete a recipient character by character (inline deletion), even holding down your favorite deletion key, TB will now stop when you have deleted that recipient. But starting from an already selected recipient, or from an empty row, you can now also do controlled deletion of several recipients going forward, press DEL key twice for each recipient: First keypress deletes the entire recipient, second keypress deletes the blank row and selects the next recipient. If you deliberately keep holding the DEL key, it'll be "fast-track deletion of multiple recipients", which is no different from holding BACKSPACE in the current version. Apart from direction, there's no difference between DEL and BACKSPACE, so they should behave the same way.

Maybe stick to tab-tab?

Definitely not, but you can still use tab-tab for navigation if you so wish.

(In reply to Thomas D. (currently busy elsewhere) from comment #7)

(In reply to xracoonx from comment #6)

Sorry, if I have not understood how it is functioning correctly.

Have you tried it??

No. But I would. Is a binary available?

(In reply to xracoonx from comment #9)

Have you tried it??
No. But I would. Is a binary available?

Not yet. We can ask for a try build maybe after getting some more feedback/reviews.
Otherwise let's try to stay focused here.

Some nits fixed, better comments, and a new focus function.
Richard, behaviour hasn't changed over the last patch.

I suggest to rip out the existing focus function because it adds a lot of unnecessary complexity for nothing. Two parameters for focusing one row. Bloated inside. For maximum confusion, the caller in the delete function even (sometimes!) required to use two different row inputs to ultimately focus/ensureVisible the same row. And the ensureIndexIsVisible in the old focus function doesn't change anything, probably inbuilt now. I added some console.logs and TODOs to illustrate these problems.

Attachment #9046337 - Attachment is obsolete: true
Attachment #9046337 - Flags: ui-review?(richard.marti)
Attachment #9046337 - Flags: review?(acelists)
Attachment #9046500 - Flags: ui-review?(richard.marti)
Attachment #9046500 - Flags: review?(acelists)
User Story: (updated)

(In reply to Thomas D. (currently busy elsewhere) from comment #11)

I suggest to rip out the existing focus function because it adds a lot of unnecessary complexity for nothing. Two parameters for focusing one row. Bloated inside. For maximum confusion, the caller in the delete function even (sometimes!) required to use two different row inputs to ultimately focus/ensureVisible the same row. And the ensureIndexIsVisible in the old focus function doesn't change anything, probably inbuilt now. I added some console.logs and TODOs to illustrate these problems.

Here's my proposal for a new focus function which can accept either a row number OR the input textbox element as an argument. So callers can pass in whatever is more easy for them. Row number is handy for many cases, and less heavy than passing in the entire element. However sometimes, if rows get added or removed (as in awDeleteHit()), it might be difficult and/or less performant to determine the row number to be focused in advance. So in that case they can just pass the input element itself without bothering to figure out the row number which it will have after the shuffle.

function awSetFocus(rowOrInput) {
  setTimeout(_awSetFocus, 0, rowOrInput);
}

function _awSetFocus(rowOrInput) {
  if (typeof rowOrInput === "number")
    awGetInputElement(row).focus();
  else
    rowOrInput.focus();
}
Comment on attachment 9046500 [details] [diff] [review] Patch V.3: (Nitfixes, better comments, new focus function) Fix and improve UX of navigating, selecting, and deleting recipients (incl. auto-select and cursor down/up, Bug 1530254) This additions make sense.
Attachment #9046500 - Flags: ui-review?(richard.marti) → ui-review+

(In reply to Thomas D. (currently busy elsewhere) from comment #12)

Here's my proposal for a new focus function which can accept either a row
number OR the input textbox element as an argument.

Let's not. I think allowing mixed parameter types is bad practise in general. There are cases where it's useful, but this isn't one of them.

(In reply to Magnus Melin [:mkmelin] from comment #14)

(In reply to Thomas D. (currently busy elsewhere) from comment #12)

Here's my proposal for a new focus function which can accept either a row
number OR the input textbox element as an argument.

Let's not. I think allowing mixed parameter types is bad practise in general. There are cases where it's useful, but this isn't one of them.

Thanks, that's right. I'll do the focus stuff cleanup in bug 1528840 (see current patch attachment 9047092 [details] [diff] [review]).

Comment on attachment 9046500 [details] [diff] [review] Patch V.3: (Nitfixes, better comments, new focus function) Fix and improve UX of navigating, selecting, and deleting recipients (incl. auto-select and cursor down/up, Bug 1530254) Review of attachment 9046500 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for the patch, I have played with it and I like the new possibilities to move between recipients with arrow keys and also that they are automatically selected as whole addresses (similar to Outlook) and can be deleted (with single DEL) or dragged faster. Having to delete each character of the address was tedious and unneeded when you wanted to delete the whole recipient. Of course editing the recipient is still possible (unlike in Outlook). When you are done with this, there seems to be similar old focus code at https://searchfox.org/comm-central/source/mailnews/addrbook/content/abMailListDialog.js#402 ::: mail/components/compose/content/addressingWidgetOverlay.js @@ +522,1 @@ > if (top.MAX_RECIPIENTS <= 1) { This silently assumes we are consistent and row == 1 == top.MAX_RECIPIENTS :) @@ +532,5 @@ > + // or forwards on the last row: Focus previous row. > + awSetFocusToRow(row - 1); > + } else { > + // We're deleting forwards, but not the last row, > + // or backwards on the the first row: Focus next row. Double 'the'. @@ +533,5 @@ > + awSetFocusToRow(row - 1); > + } else { > + // We're deleting forwards, but not the last row, > + // or backwards on the the first row: Focus next row. > + // We have to cheat a little bit because the focus will be set asynchronusly asynchronously (yes, you just copied it:)). @@ +542,2 @@ > > + // Delete the row Missing dot. @@ +707,5 @@ > top.MAX_RECIPIENTS--; > } > > +/** > + * Focus a recipient input textbox (asynchronusly). asynchronously @@ +710,5 @@ > +/** > + * Focus a recipient input textbox (asynchronusly). > + * > + * @param {Number} row the row on which we'll do ensureIndexIsVisible() > + * @param {<xul: textbox>} inputElement the XUL textbox element to focus Do you actually want to add all these comments, when you are intending to remove these functions and use your new awSetFocusToRow() everywhere? @@ +716,5 @@ > + * so that the row we're focusing is also visible. But it seems that's already > + * inbuilt into the element now! So we should just use the index only, > + * or the element only if we think we ever wouldn't know the index, or > + * allow either index or element, but one of them is definitely enough. > + * What's the need for passing around both index and element? It is probably a caching feature as most callers have both row and element already at hand so they just pass it here so that awSetFocus does not need to fetch the element from row again. But I think as SetFocus is only called on a single element and usually depends on user interaction, it is not a performance critical code. If you find passing only one of row OR element cleaner then you can do that, but please in a separate patch (can be in this bug) as it does not contribute any way to the focus/hotkey changes you implement. @@ +741,5 @@ > + setTimeout(_awSetFocusToRow, 0, row); > +} > + > +function _awSetFocusToRow(row) { > + awGetInputElement(row).focus(); As this is happening async (on a timeout), the 'row' may have already be removed by some other code, so maybe we better check it exists. Like let inputElem = awGetInputElement(row); if (inputElem) inputElem.focus() The previous _awSetFocus() may not have this issue, becuase it was operating on a global top.awRow, where if rapid awSetFocus() would be called (and the first _awSetFocus() got to run after that) then top.awRow would only hold the last value, which should exist. @@ +829,5 @@ > var selectElem = awGetPopupElement(rowNumber); > _awSetAutoComplete(selectElem, inputElem); > } > > +function awRecipientOnFocus(textboxElement) { Call it inputElem as elsewhere, so we know what specific type of element it is (yes, it is textbox of type input). @@ -812,5 @@ > - if (!element.value) > - awDeleteHit(element); > - > - // We need to stop the event else the listbox will receive it and the > - // function awKeyDown will be executed! This is really strange that we had awKeyDown() too with basically the same code/function and we just prevent to run it here. @@ -821,2 @@ > > -function awKeyDown(event, listboxElement) { Can you see if maybe this function runs when there are keypresses on the address type picker (To:, Bcc:, ...) ? This may be a safety fallback in case we somehow manage to press Del/Backspace in a way that the richlistboxitem gets the event, not the inputbox. @@ +862,3 @@ > > + switch (event.key) { > + case "Delete": Add comment about explicit fall through as you did for "ArrowDown". @@ +872,5 @@ > + if (!element.value) { > + if (top.awRecipientInlineDelete && !event.repeat) { > + // User has released Delete or Backspace key after holding them down > + // to delete recipient text inline: unblock row deletion > + top.awRecipientInlineDelete = false; This is harder to understand, but in reality this causes that only the current inputbox is cleared when holding Del/Backspace and not a following block of recipient until some random character where you release the key. To delete multiple recipients, this now needs to press DEL twice for each one, but not delete each character separately. @@ +875,5 @@ > + // to delete recipient text inline: unblock row deletion > + top.awRecipientInlineDelete = false; > + } > + if (!top.awRecipientInlineDelete) { > + let deleteForward = (event.key == "Delete") ? true : false; You do not need the "? true : false" expression, the (event.key == "Delete") will already return boolean true/false. @@ +889,5 @@ > + case "ArrowUp": > + // Only browse recipients if the autocomplete popup is not open. > + if (!element.popupOpen) { > + let row = awGetRowByInputElement(element); > + let rowCheck = down ? row < top.MAX_RECIPIENTS : row > 1 Missing semicolon. Also maybe a better variable name, like 'boundaryRow' (row at boundary or edge of recipient list, from where you can't move outside). @@ +892,5 @@ > + let row = awGetRowByInputElement(element); > + let rowCheck = down ? row < top.MAX_RECIPIENTS : row > 1 > + if (rowCheck) { > + let targetRow = down ? row + 1 : row - 1; > + awSetFocus(targetRow, awGetInputElement(targetRow)); Will this also become awSetFocusToRow(targetRow) ? ::: mail/components/compose/content/messengercompose.xul @@ -1944,5 @@ > <richlistitem class="addressingWidgetItem" allowevents="true"> > <hbox class="aw-firstColBox" align="center"> > <image class="deleteAddress close-icon" > - onclick="awDeleteHit(this.parentNode.nextSibling.nextSibling > - .querySelector('textbox.textbox-addressingWidget'));"/> Having this code here made anyone trying to move elements around here notice that this code needs updating too. But we already have some more code that would need to be updated if elements shifted around, so this probably doesn't need to stay here as an anomaly.
Attachment #9046500 - Flags: review?(acelists) → review+

Update as we've landed the new, simplified focus function in bug 1528840 (attachment 9047329 [details] [diff] [review] / https://hg.mozilla.org/comm-central/rev/b4b9a40aa811).

Aceman, pls double-check. If we're good, pls do try-run. I want to land this first before venturing into more cleanup exercises in bug 1528840. Tia.

  • This patch addresses all of Aceman's review in Comment 16. I'll add some comments wrt minor deviations.
  • I fixed another nit where pressing Alt+Backspace to undo inline-deleting a recipient text would wrongly delete the row.
  • Comments added and improved
  • Various nitfixes
  • FTR: This patch removes awKeyDown() after thorough testing: Normally it does nothing as it gets explicitly bypassed in awRecipientKeyDown(); what it did otherwise (delete "random" recipients when pressing DEL/BACKSPACE with focus ring on recipient type picker) was undiscoverable, unpredictable, and bugged.
Attachment #9046500 - Attachment is obsolete: true
Attachment #9048111 - Flags: ui-review+
Attachment #9048111 - Flags: review?(acelists)
Comment on attachment 9046500 [details] [diff] [review] Patch V.3: (Nitfixes, better comments, new focus function) Fix and improve UX of navigating, selecting, and deleting recipients (incl. auto-select and cursor down/up, Bug 1530254) Review of attachment 9046500 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for the review of the previous patch! Nothing escapes the eye of an Aceman... ;-) Here's my comments to address Aceman's review of comment 16 in detail. Note: I am replying to his review comments, which will only be displayed correctly in splinter review: https://bugzilla.mozilla.org/page.cgi?id=splinter.html&ignore=&bug=1527547&attachment=9046500 (In reply to Thomas D. from comment #17) > Created attachment 9048111 [details] [diff] [review] > - This patch addresses all of Aceman's review in Comment 16. I'll add some comments wrt minor deviations. ::: mail/components/compose/content/addressingWidgetOverlay.js @@ +522,1 @@ > if (top.MAX_RECIPIENTS <= 1) { Yes, indeed. Should work though, and this check is faster. Wasn't me :) @@ +532,5 @@ > + // or forwards on the last row: Focus previous row. > + awSetFocusToRow(row - 1); > + } else { > + // We're deleting forwards, but not the last row, > + // or backwards on the the first row: Focus next row. fixed @@ +533,5 @@ > + awSetFocusToRow(row - 1); > + } else { > + // We're deleting forwards, but not the last row, > + // or backwards on the the first row: Focus next row. > + // We have to cheat a little bit because the focus will be set asynchronusly We're no longer cheating, but asynchronously is now correct. @@ +542,2 @@ > > + // Delete the row fixed @@ +707,5 @@ > top.MAX_RECIPIENTS--; > } > > +/** > + * Focus a recipient input textbox (asynchronusly). comment rewritten in the new function @@ +710,5 @@ > +/** > + * Focus a recipient input textbox (asynchronusly). > + * > + * @param {Number} row the row on which we'll do ensureIndexIsVisible() > + * @param {<xul: textbox>} inputElement the XUL textbox element to focus removed @@ +716,5 @@ > + * so that the row we're focusing is also visible. But it seems that's already > + * inbuilt into the element now! So we should just use the index only, > + * or the element only if we think we ever wouldn't know the index, or > + * allow either index or element, but one of them is definitely enough. > + * What's the need for passing around both index and element? Fixed using only the input element in the new focus function of 1528840. @@ +741,5 @@ > + setTimeout(_awSetFocusToRow, 0, row); > +} > + > +function _awSetFocusToRow(row) { > + awGetInputElement(row).focus(); I restored top.awRowToFocus, which should work without further checks. @@ +829,5 @@ > var selectElem = awGetPopupElement(rowNumber); > _awSetAutoComplete(selectElem, inputElem); > } > > +function awRecipientOnFocus(textboxElement) { Fixed. We also have inputElement (without abbreviation) in several spots, which is better and less error-prone imo. @@ -821,2 @@ > > -function awKeyDown(event, listboxElement) { See my comment 17, last bullet. In a weird edge case where the recipient type selector has focus ring AND you press DEL/BACKSPACE, this would delete a "random" recipient row (not the one focused). That's undiscoverable and not helpful. So I ripped this function out. @@ +862,3 @@ > > + switch (event.key) { > + case "Delete": I only added that comment because there was some other code in the fallthrough case. For a simple (code-less) fallthrough, we don't usually add such comment, because it's obvious from the notation. @@ +872,5 @@ > + if (!element.value) { > + if (top.awRecipientInlineDelete && !event.repeat) { > + // User has released Delete or Backspace key after holding them down > + // to delete recipient text inline: unblock row deletion > + top.awRecipientInlineDelete = false; Exactly, couldn't have said it better :-) @@ +875,5 @@ > + // to delete recipient text inline: unblock row deletion > + top.awRecipientInlineDelete = false; > + } > + if (!top.awRecipientInlineDelete) { > + let deleteForward = (event.key == "Delete") ? true : false; thanks, indeed. fixed. @@ +889,5 @@ > + case "ArrowUp": > + // Only browse recipients if the autocomplete popup is not open. > + if (!element.popupOpen) { > + let row = awGetRowByInputElement(element); > + let rowCheck = down ? row < top.MAX_RECIPIENTS : row > 1 fixed. using noEdgeRow. @@ +892,5 @@ > + let row = awGetRowByInputElement(element); > + let rowCheck = down ? row < top.MAX_RECIPIENTS : row > 1 > + if (rowCheck) { > + let targetRow = down ? row + 1 : row - 1; > + awSetFocus(targetRow, awGetInputElement(targetRow)); Yes, fixed. ::: mail/components/compose/content/messengercompose.xul @@ -1944,5 @@ > <richlistitem class="addressingWidgetItem" allowevents="true"> > <hbox class="aw-firstColBox" align="center"> > <image class="deleteAddress close-icon" > - onclick="awDeleteHit(this.parentNode.nextSibling.nextSibling > - .querySelector('textbox.textbox-addressingWidget'));"/> Yes. Violating the separation of layout and code is not a sustainable way of keeping preventive code hints. Worse, this complex onclick attribute would be replicated for each and every recipient in the code, which can cause significant document bloat for many recipients. And actually, I've changed it to parent.parent which is much safer even if siblings get moved around.
Comment on attachment 9048111 [details] [diff] [review] Patch V.4: (Nitfixes, comments, update onto bug 1528840, attachment 9047329 [details] [diff] [review]) Fix and improve UX of navigating, selecting, and deleting recipients (incl. auto-select and cursor down/up, Bug 1530254) Review of attachment 9048111 [details] [diff] [review]: ----------------------------------------------------------------- I like this, it got nicely simplified thanks to bug 1528840, and is now small and clean. ::: mail/components/compose/content/addressingWidgetOverlay.js @@ +501,5 @@ > } > > +function awDeleteAddressOnClick(deleteAddressElement) { > + awDeleteHit(deleteAddressElement.parentNode.parentNode > + .querySelector('textbox.textbox-addressingWidget'), Double quotes please. Only in the xul file we had to use single ones.
Attachment #9048111 - Flags: review?(acelists) → review+

Looks like one test failure: test-send-button.js::test_send_enabled_manual_address

New patch with test update courtesy of Aceman (thanks a lot!), and double quotes nitfix.

Aceman, Richard, no changes, but please add your review flags again.

Attachment #9048111 - Attachment is obsolete: true
Attachment #9048869 - Flags: ui-review?(richard.marti)
Attachment #9048869 - Flags: review?(acelists)

Ready for landing :-)

Has r=Aceman from comment 19, and ui-r=Paenglab from comment 13 (please allow them to set their flags again on the patch).

Try run is green wrt our patch (fails only in unrelated test testTaskView.js).

(In reply to :aceman from comment #22)

https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=df2c20a97d22fda5e1428ef33e6f91cb4c38fdb7

Keywords: checkin-needed
Comment on attachment 9048869 [details] [diff] [review] Patch V.5: (add Ace's test update) Fix and improve UX of navigating, selecting, and deleting recipients (incl. auto-select and cursor down/up, Bug 1530254) When no change, then you don't need to ask and you can set flags yourself. Not tested as you wrote there was no change.
Attachment #9048869 - Flags: ui-review?(richard.marti) → ui-review+

(In reply to Richard Marti (:Paenglab) from comment #25)

Comment on attachment 9048869 [details] [diff] [review]
When no change, then you don't need to ask and you can set flags yourself.
Not tested as you wrote there was no change.

I know, but I don't like setting other people's flags, and especially on the final patch, imo it's more informative and looks better to see the actual reviewers at a glance. Thanks hey!

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/392d6ce8f05d
Fix and improve UX of navigating, selecting and deleting recipients via keyboard. ui-r=Paenglab, r=aceman

Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Keywords: checkin-needed
Resolution: --- → FIXED

There is a length restriction of the commit message of about 40cm on my screen. You can capture your memoires below the first line ;-)

Target Milestone: --- → Thunderbird 67.0

(In reply to Pulsebot from comment #27)

Pushed by mozilla@jorgk.com:

Thanks, that was fast!

Comment on attachment 9048869 [details] [diff] [review] Patch V.5: (add Ace's test update) Fix and improve UX of navigating, selecting, and deleting recipients (incl. auto-select and cursor down/up, Bug 1530254) Review of attachment 9048869 [details] [diff] [review]: ----------------------------------------------------------------- Even too fast, I wanted to do a line more in the test part. But at least great cooperation, everyone did a bit of the work :)
Attachment #9048869 - Flags: review?(acelists) → review+
Attached patch 1527547-test.patch (deleted) — Splinter Review

At least a small test of the added feature, at the spot in the test that detected it :)

Attachment #9049003 - Flags: review?(jorgk)
Comment on attachment 9049003 [details] [diff] [review] 1527547-test.patch Looks OK and doesn't break anything ;-)
Attachment #9049003 - Flags: review?(jorgk) → review+
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/af8e5451b93e add test of selection when focusing recipient input box. r=jorgk DONTBUILD

Hmm, failed on Mac here:
https://treeherder.mozilla.org/#/jobs?repo=comm-central&revision=af8e5451b93e732765f7a1346944992a61feccae&selectedJob=232880745

I ran it locally on Windows before landing and I'm sure you ran it on Linux.

Flags: needinfo?(acelists)
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/ea971d6d8ddd disable part of test-send-button::test_send_enabled_manual_address on Mac. rs=bustage-fix
Attached patch 1527547-testFix.patch (deleted) — Splinter Review

Yes, OS X must behave differently again :)
The click into recipient in the test is ignored, because cursor is already there. So let's re-focus it manually.

Try run:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=27e4d4eb3fee5bc0811ebb04fa9a405a8930e74a

Flags: needinfo?(acelists)
Attachment #9050148 - Flags: review?(jorgk)
Comment on attachment 9050148 [details] [diff] [review] 1527547-testFix.patch Done here now? :-)
Attachment #9050148 - Flags: review?(jorgk) → review+
Blocks: 1540386

Note that this bug has provided a precursory "pill-style" experience for the current release version as of TB 68, even before the advent of "real" recipient pills in bug 440377.

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

Attachment

General

Created:
Updated:
Size: