Skip to content

Feature Request (Polish) : Format the phone numbers like 123-456-7890 #16099

Closed

Description

@kavimuru

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Problem:

Phone numbers are displayed without any format (123456789) which looks ugly

Solution:

We should better format them (e.g. 123-456-7890 instead of 1234567890). T

Context/Examples/Screenshots/Notes:

image (3)

Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @puneetlath
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1679077176883759

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013a52bba4f477d2f9
  • Upwork Job ID: 1638900508027600896
  • Last Price Increase: 2023-03-23

Activity

  1. locked and limited conversation to collaborators on Mar 18, 2023
  2. self-assigned this
    on Mar 19, 2023
  3. puneetlath commented on Mar 19, 2023

    @puneetlath
    Contributor

    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.

  4. unlocked this conversation on Mar 20, 2023
  5. koko57 commented on Mar 20, 2023

    @koko57
    Contributor

    I'll be happy to work on this feature :)

  6. MelvinBot commented on Mar 20, 2023

    @MelvinBot
  7. koko57 commented on Mar 21, 2023

    @koko57
    Contributor

    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.

  8. puneetlath commented on Mar 22, 2023

    @puneetlath
    Contributor

    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
  9. koko57 commented on Mar 23, 2023

    @koko57
    Contributor

    @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.

  10. 17 remaining items

  11. puneetlath commented on Apr 4, 2023

    @puneetlath
    Contributor

    @koko57 how's this going? Close to being ready for review?

  12. koko57 commented on Apr 5, 2023

    @koko57
    Contributor

    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)

  13. koko57 commented on Apr 5, 2023

    @koko57
    Contributor

    ready for review 🙂

  14. puneetlath commented on Apr 6, 2023

    @puneetlath
    Contributor

    Weird. Not sure why @rushatgabhane and I didn't get auto-assigned. Will review shortly!

  15. rushatgabhane commented on Apr 10, 2023

    @rushatgabhane
    Member

    @puneetlath should I create a follow-up issue that allows searching users using formatted phone numbers? Pasting (301 123) 4567 gives no results.

    image

    A nice to have in that would be "as you type formatting" provided by the library. https://github.com/grantila/awesome-phonenumber#example-2

  16. puneetlath commented on Apr 10, 2023

    @puneetlath
    Contributor

    @puneetlath should I create a follow-up issue that allows searching users using formatted phone numbers? Pasting (301 123) 4567 gives no results.

    Yes, definitely. I thought that was actually supposed to work already, so if it isn't, let's fix it.

  17. rushatgabhane commented on Apr 19, 2023

    @rushatgabhane
    Member

    Note to self :

    • Create follow up PR to add Str function for hard spaces
    • Create follow up issue for using Display name even if login is phone number
  18. puneetlath commented on Apr 19, 2023

    @puneetlath
    Contributor

    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.

  19. rushatgabhane commented on Apr 19, 2023

    @rushatgabhane
    Member

    @puneetlath sure, that'd be great

  20. melvin-bot commented on May 12, 2023

    @melvin-bot

    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!

  21. puneetlath commented on May 13, 2023

    @puneetlath
    Contributor

    Whoops. Need to pay out Rushat and then this can be closed.

  22. puneetlath commented on May 13, 2023

    @puneetlath
    Contributor

    All paid. Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

InternalRequires API changes or must be handled by Expensify staffMonthlyKSv2NewFeatureSomething to build that is a new item.ReviewingHas a PR in review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions