You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request (Polish) : Format the phone numbers like 123-456-7890 #16099
Ideally we can find a global solution to this. Such that phone numbers from any region will be formatted nicely according to that region. Perhaps we could use a JS library like this one to help here.
Please re-state the problem that we are trying to solve in this issue. What is the root cause of that problem?
The phone numbers displayed are not formatted well. They are just extracted from login or display name.
What changes do you think we should make in order to solve the problem?
We can use external library to format the numbers accordingly to the region. I think in our case we can use https://github.com/grantila/awesome-phonenumber - a lightweight library which uses Google's libphonenumber. It has a very simple API, decent docs and TS support. In App we have some utils dealing with phone numbers - we can make them use the lib.
What alternative solutions did you explore? (Optional)
That seems like a good option! I started a little bit of a discussion here about what considerations we should have when choosing a library.
In the meantime, let's assume we were to use that library. Let's talk a little bit about how we should display phone numbers. I would think something like:
Use the national format for any phone numbers from the same country as you
Use the international format for any phone numbers from other countries
Display phone numbers consistently wherever they are displayed
@puneetlath I think I would go with the third option and display the numbers consistently using the international format. :) WhatsApp also follows this international format convention.
Create follow up issue for using Display name even if login is phone number
@rushatgabhane I'll create the follow up issue for this actually if you don't mind. I've discovered a couple of things while implementing back-end changes.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
Activity
puneetlath commentedon Mar 19, 2023
Ideally we can find a global solution to this. Such that phone numbers from any region will be formatted nicely according to that region. Perhaps we could use a JS library like this one to help here.
koko57 commentedon Mar 20, 2023
I'll be happy to work on this feature :)
MelvinBot commentedon Mar 20, 2023
koko57 commentedon Mar 21, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue. What is the root cause of that problem?
The phone numbers displayed are not formatted well. They are just extracted from login or display name.
What changes do you think we should make in order to solve the problem?
We can use external library to format the numbers accordingly to the region. I think in our case we can use https://github.com/grantila/awesome-phonenumber - a lightweight library which uses Google's libphonenumber. It has a very simple API, decent docs and TS support. In App we have some utils dealing with phone numbers - we can make them use the lib.
What alternative solutions did you explore? (Optional)
We can use another library - libphonenumber-js.
puneetlath commentedon Mar 22, 2023
That seems like a good option! I started a little bit of a discussion here about what considerations we should have when choosing a library.
In the meantime, let's assume we were to use that library. Let's talk a little bit about how we should display phone numbers. I would think something like:
nationalformat for any phone numbers from the same country as youinternationalformat for any phone numbers from other countrieskoko57 commentedon Mar 23, 2023
@puneetlath I think I would go with the third option and display the numbers consistently using the international format. :) WhatsApp also follows this international format convention.
17 remaining items
puneetlath commentedon Apr 4, 2023
@koko57 how's this going? Close to being ready for review?
koko57 commentedon Apr 5, 2023
yeah, I needed to do some additional changes, almost done, the only thing that left is the phone number in IOU Action messages #16804 (comment)
koko57 commentedon Apr 5, 2023
ready for review 🙂
puneetlath commentedon Apr 6, 2023
Weird. Not sure why @rushatgabhane and I didn't get auto-assigned. Will review shortly!
rushatgabhane commentedon Apr 10, 2023
@puneetlath should I create a follow-up issue that allows searching users using formatted phone numbers? Pasting
(301 123) 4567gives no results.A nice to have in that would be "as you type formatting" provided by the library. https://github.com/grantila/awesome-phonenumber#example-2
puneetlath commentedon Apr 10, 2023
Yes, definitely. I thought that was actually supposed to work already, so if it isn't, let's fix it.
rushatgabhane commentedon Apr 19, 2023
Note to self :
puneetlath commentedon Apr 19, 2023
@rushatgabhane I'll create the follow up issue for this actually if you don't mind. I've discovered a couple of things while implementing back-end changes.
rushatgabhane commentedon Apr 19, 2023
@puneetlath sure, that'd be great
melvin-bot commentedon May 12, 2023
This issue has not been updated in over 15 days. @puneetlath, @koko57, @rushatgabhane eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
puneetlath commentedon May 13, 2023
Whoops. Need to pay out Rushat and then this can be closed.
puneetlath commentedon May 13, 2023
All paid. Thanks everyone!