Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(stats): make rowcount more human readable #8232

Conversation

joshuaeilers
Copy link
Contributor

@joshuaeilers joshuaeilers commented Jun 13, 2023

Formats the numeric display for the row count (10K, 10M, etc) like other numbers around Datahub. At some point we will want to consolidate src/utils/formatter/index.ts and src/app/shared/formatNumber.ts. They're similar but not quite, one uses the Intl.NumberFormat which may be a more flexible approach.

To still provide a way for users to get to the true number values in the UI, you can still hover the row/cols and they'll expand. A tooltip was another approach that felt a little too busy on the UI and covers up the dataset name. This feels a little more out of the way and inline with the rest of the content. I didn't refactor all the fields to use this new approach right away because that would take quite a bit more time and we'll want to see how people feel about this new approach before building upon it further (or rolling it back).

Screen.Recording.2023-06-14.at.9.27.51.AM.mov

Autocomplete

image

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@joshuaeilers joshuaeilers marked this pull request as ready for review June 13, 2023 21:17
@github-actions github-actions bot added the product PR or Issue related to the DataHub UI/UX label Jun 13, 2023

return intlFormat(num);
};
export const needsFormatting = (num: number) => isThousands(num);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Started down a path of trying to check equality of 3500 vs 3.5K and with internationalization in play (Intl.NumberFormat) I don't feel like parsing here is going to be super reliable on machines with other languages. Future improvement to make for sure.

Copy link
Contributor

@shirshanka shirshanka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-binding +1 from me!

Copy link
Collaborator

@chriscollins3456 chriscollins3456 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

@joshuaeilers joshuaeilers merged commit 071ef4d into datahub-project:master Jun 14, 2023
32 of 33 checks passed
@joshuaeilers joshuaeilers deleted the feature/prd-340-show-20k-records-instead-of-actual-number branch June 14, 2023 17:54
tusharm pushed a commit to tusharm/datahub that referenced this pull request Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants