-
Notifications
You must be signed in to change notification settings - Fork 89
VSCODE-56: Display document count in tree view #152
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally and everything works as expected. Nice! Also well tested 👏
}; | ||
|
||
export const formatDocCount = (count: number): string => { | ||
return `${numeral(count).format('0a')}`.toUpperCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you pls add a comment with an example here to make it move visible what the expected format should be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call
`Expected a tree item child with the label "show more..." found ${documents[10].label}` | ||
); | ||
}) | ||
.then(done, done); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always happy to see that done done
disappears 😀
); | ||
// Here we stub the showInformationMessage process because it is too much | ||
// for the render process and leads to crashes while testing. | ||
sinon.replace(vscode.window, 'showInformationMessage', sinon.stub()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 👏
https://jira.mongodb.org/browse/VSCODE-56
This PR adds a document count in the tree view. The count is shown in the document lists' description. When the document count is a large number it's abbreviated using numeral js (Compass also uses this). Chatted with Claudia and Max and we were preferring uppercase abbreviations over lowercase (
k
vsK
,m
vsM
), so they're shown in uppercase, any thoughts?When the document list is hovered, the tooltip shows the full document count.
Also added a
Refresh
right-click action to the document list to reset it in the tree view.