nextcloud / contacts

📇 Contacts app for Nextcloud
https://apps.nextcloud.com/apps/contacts
GNU Affero General Public License v3.0
569 stars 173 forks source link

Unstructured address shows all value at "Post office box" #3404

Closed ChristophWurst closed 1 year ago

ChristophWurst commented 1 year ago

Describe the bug

System address book contacts have no structured address. Yet the value is wrongly shown as one in read-only mode.

Steps to reproduce

  1. Add an address to your Nextcloud profile and set the scope to local
  2. Open your own system address book card

Expected behavior

The address shows unstructured

Actual behavior

The address shows structured and my location shows in the "Post office box" row

image

Contact version

No response

Operating system

No response

PHP engine version

None

Web server

None

Database

None

Additional info

No response

ChristophWurst commented 1 year ago

I think we just show the value in the first structured input. Other is the ADR property type.

Cloning the contact into a writeable address book allows me to see the same contact in edit mode:

image

JohannesGGE commented 1 year ago

I think it is also confusing that there is a Location and a Address prop. In the profile settings, we say Location but we actually mean Address?

ChristophWurst commented 1 year ago

Fair point but I think location and address are synonyms here. Just like we treat organization and company the same.

JohannesGGE commented 1 year ago

@ChristophWurst I checked the card and the address seems to be saved structured. ADR;TYPE=HOME:ADRESSE;;;;;; So this is more a SAB issue, isn't it? Should be saved ADR;TYPE=HOME:;ADRESSE;;;;;

ChristophWurst commented 1 year ago

If that's the issue then yes. We write the ADR at https://github.com/nextcloud/server/blob/0ad56e5752eb8386252ea76d583d009b6d4456bf/apps/dav/lib/CardDAV/Converter.php#L94-L96.

  Experience with vCard 3 has shown that the first two components
  (post office box and extended address) are plagued with many
  interoperability issues.  To ensure maximal interoperability,
  their values SHOULD be empty.

From https://www.rfc-editor.org/rfc/rfc6350.html#section-6.3.1

Maybe we should fill locality.

ChristophWurst commented 1 year ago

I don't think there is any perfect part of the address to map our location. People will use the input to add their country or city most likely, but it might also be used for the continent or something very specific.

I believe mapping to locality/city is the best fit still.

ChristophWurst commented 1 year ago

Tricky and risky but what we could do it allow people to enter the location in a format we can interpret. Some help text can explain the format. E.g. Berlin for city=Berlin and Berlin, Germany for city=Berlin;country=Germany. Like split at every "," and depending on number of parts we assume different semantics of the parts.

@jancborchardt @nimishavijay what do you designers think?

nimishavijay commented 1 year ago

I do agree that this confusion is also caused by the difference in naming, as rectifying this is difficult because there is no field called "Address" in your profile settings. Possible solutions:

  1. Map to the location field in the contact
  2. Show structured address fields in the profile settings
  3. Show it as an unstructured address in the contact
  4. Try to identify the structure as Christoph said, the helper text can be the placeholder in the location field in the profile settings

I would go with 1) or 3) tbh, it's the least ambiguous. Even if we do show a placeholder like Berlin, Germany in the profile settings, people may for example fill it out as just Berlin or Germany. The format for addresses may also be different in different regions, like including the state or province, etc. What do you think? @nextcloud/designers

ChristophWurst commented 1 year ago

There is no unstructured address in vcards AFAIK

jancborchardt commented 1 year ago

One part of why we call it "Location" in the profile is because it's for your Profile, and Social. So it would be that people put in (as Christoph said) either city or Country (most likely) as on Twitter and Mastodon for example.

It would be a bit strange to call the field in Profile "Address", as it sounds like you are supposed to put in a proper address.

Likewise, it would be off to call the field in the Contact "Location".

I'd also say that maybe just putting a placeholder example in the location field like "City" and simply mapping it to city then would be an easy quick win?

@ChristophWurst additionally, cause you mentioned "Company" and "Organization" – these we should just standardize though. "Company" and "Job title" sort of seems the standard (comparing to Apple and Google), so we should use those terms in both Contacts and Profile.

nimishavijay commented 1 year ago

As discussed with @jancborchardt and @szaimen we could also just show the address unstructured in the front end, since the system address book contacts are read-only anyway. In the contacts backend the info could be mapped to city in case the contacts are exported, which is an edge case. All labels except the address type (home/work/other) would be hidden, and on the right the address would be shown. What do you think?