Closed Bug 1631201 Opened 5 years ago Closed 4 years ago

Showing comma (,) instead of fall back names in address book for |View > Show Name As > Last, First|

Categories

(Thunderbird :: Address Book, defect)

defect

Tracking

(thunderbird_esr78 fixed, thunderbird84 fixed)

VERIFIED FIXED
85 Branch
Tracking Status
thunderbird_esr78 --- fixed
thunderbird84 --- fixed

People

(Reporter: thomas8, Assigned: darktrojan)

References

(Regression)

Details

(Keywords: regression, ux-efficiency)

Attachments

(2 files)

Something broke the fallback algorithm of address book's 'Name' column for View > Show Name As > Last, First when Last name and First name are not present on the contact's card.

STR

  1. Have these contacts in your local AB:
First Last Display Email Company
    Anne Adams aa@asdf.com  
      comp@asdf.com Computer-Company
      johnxxx@c.com  
Tom Doe Tom Doe td@c.com
  1. In main AB, select View > Show Name As > Last, First (required step).

Actual Result

Your list of AB entries (name column) now looks like this:

,                         (that's Anne, don't you see?) 
,                         (that's Computer-Company)
,                         (that's John)
Doe, Tom
  • Visually odd: Loads of meaningless commas (,) in the name column.
  • Lots of valid contacts harder to distinguish as they are not showing anything in the "Name" column.
  • Regression: Existing fall back algorithm fails (compare release version, which will always display something in the name field; see expected result).
  • Easy to identify contacts without Last and First name; however, it's like forcing users to fill in those fields for a useful names experience, which they may not be ready to do. Instead, we should offer optional colums for First name and Last name fields.

Expected Result

Anne Adams        (RFE: first use display name as fallback)
Computer-Company  (regression-fix: use company field as fallback)
Doe, John         (regular entry: Last, First)
johnxxx           (regression-fix: use local part of email address as fallback)

Imo, we should fix the existing fallback algorithm which regressed:
When Last Name and First Name are not filled, show data from other fields in the name column instead:

  • Company Name
  • Local part of email address

I suggest to enhance the fallback and start with display name first (as it's technically possible to have display name without Last and First name filled):

  • Display Name
  • Company Name
  • Local part of email address

For polishing:

  • Can we have some way of identifying list entries where Last name, First name fields are empty and the fallback is used? In current release, we are just sorting fallback names into the Last, First sequence. Options:
    • some visual hint where fallback names have been used, e.g.:
      • use italics for fallback names (whilst keeping them in alphabetical order)
      • prepend/overlay some other visual indication
    • sort all fallbacks to the top, e.g. by prepending some special character to the fallback
      name:
      ~ Anne Adams
      ~ Computer Company
      ~ johnxxx
      Doe, Tom
    • no indication in Names colum; instead, allow user to display Last name and First name columns

Maybe italics could work.

Keywords: regression

Fallback algorithm lives here:
https://searchfox.org/comm-central/rev/eb1e74fdbf991d849543c36e376b22c5e72228b8/mailnews/addrbook/jsaddrbook/AddrBookCard.jsm#42-63

AddrBookCard.prototype = {
...
  generateName(generateFormat, bundle) {
...
    case Ci.nsIAbCard.GENERATE_LAST_FIRST_ORDER:
        format = bundle
          ? bundle.GetStringFromName("lastFirstFormat")
          : "%S, %S";
        result = format
          .replace("%S", this.lastName)
          .replace("%S", this.firstName);
        break;
...
    if (result == "") {
      result = this.getProperty("Company", "");
    }
    if (result == "") {
      result = this.primaryEmail.split("@", 1)[0];
    }

    return result;
  },
Summary: Showing comma |,| instead of fall back names in address book for |View > Show Name As > Last, First| → Showing comma (,) instead of fall back names in address book for |View > Show Name As > Last, First|

I saw some strangeness, I think it was in corespondent column, for a > or + character. Does that sound related?

Which version did it start?

Flags: needinfo?(bugzilla2007)

(In reply to Wayne Mery (:wsmwk) from comment #2)

I saw some strangeness, I think it was in corespondent column, for a > or + character. Does that sound related?

Not for me.

(In reply to Wayne Mery (:wsmwk) from comment #3)

Which version did it start?

TB68 still works. Not sure when exactly this broke.
Should recheck STR on TB78 release candidate.

On daily 82.0a1 (2020-08-25) (64-bit), win10, now also broken for the other variants, essentially showing the display name always regardless of your settings Show name as: First Last | Last, First | Display name. Iow, first and last name are now ignored. check like this:
First name: JohnFirst
Last name: DoeLast
Display name: John Doe Display

And simple (round brackets) in display name also make things fail :-//

Flags: needinfo?(bugzilla2007) → needinfo?(alice0775)

About STR step1,
I couldn't find "Company" field in AB new contact dialog.
I couldn't find "First" "Last" "Display" and "Company" in column name as well as column picker of AB top-right pane.

So I don't understand STR.

Flags: needinfo?(alice0775)
Regressed by: 1581765
Assignee: nobody → geoff
Status: NEW → ASSIGNED

Oh no. This never would've happened if the regression test for it actually tested the new code. Instead it only tests the old code, which is still hanging around for various reasons. Now I feel really stupid. :-(

This test only ever tested nsAbCardProperty, it's never tested AddrBookCard. Now it tests both.

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/79591a29a58c
Fix the nsIAbCard regression test to run on the new code, and the regressions it would've found. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch

Comment on attachment 9189090 [details]
Bug 1631201 - Fix the nsIAbCard regression test to run on the new code, and the regressions it would've found. r?mkmelin

[Approval Request Comment]
Regression caused by (bug #): bug 1581765
User impact if declined: parts of address book list blank when they should have information, potentially other problems
Testing completed (on c-c, etc.): on c-c for a week
Risk to taking this patch (and alternatives if risky): not risky

Attachment #9189090 - Flags: approval-comm-esr78?
Attachment #9189090 - Flags: approval-comm-beta?

Comment on attachment 9189090 [details]
Bug 1631201 - Fix the nsIAbCard regression test to run on the new code, and the regressions it would've found. r?mkmelin

[Triage Comment]
Approved for beta

Attachment #9189090 - Flags: approval-comm-beta? → approval-comm-beta+
Regressed by: 1572324
No longer regressed by: 1581765

Looks good to me testing the 84.0b3 release candidate on Ubuntu 18.04 LTS.

Created a new address book I called Bug Test, added the test names in the above STR, selected View > Show Name As > Last, First and the result looks like the Good screenshot in comment 6

Comment on attachment 9189090 [details]
Bug 1631201 - Fix the nsIAbCard regression test to run on the new code, and the regressions it would've found. r?mkmelin

[Triage Comment]
Approved for esr78

Attachment #9189090 - Flags: approval-comm-esr78? → approval-comm-esr78+

Verified in testing of the Thunderbird 78.6.0 release candidate on Windows 10.
Same as my comment in comment 13.

Status: RESOLVED → VERIFIED
See Also: → 1232999
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: