feat(crud): add expand all documents button for List and JSON view
Description
We as users want a feature, that enables us to "expand all" documents in the view (preferably List view).
https://feedback.mongodb.com/forums/924283-compass/suggestions/40113172-want-expand-all-button-for-documents-in-view
As user Bruce said: "I appreciate the JSON view, but having to click all fields to expand is a total pain. For my usage, I often times want to see some nested field. This can be 5-6 clicks per document and multiple documents. Ouch!"
Checklist
- [x] New tests and/or benchmarks are included
- [ ] Documentation is changed or added
- [x] I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)
Motivation and Context
- [ ] Bugfix
- [x] New feature
- [ ] Dependency update
- [ ] Misc
Open Questions
- This is my first contribution for MongoDB Compass, so I do not know this codebase and I have just implemented this feature in some way.
- I have tested the feature only in the browser (via
npm run start-web). I could not ran the project locally. - I have not found any ticket for this feature in Compasses Jira, even though I am leaving this PR here.
- I am not sure, what icon should we use for the
ExpandAllDocumentsButton.
I will be very happy for any feedback.
Dependents
Types of changes
- [ ] Backport Needed
- [ ] Patch (non-breaking change which fixes an issue)
- [x] Minor (non-breaking change which adds functionality)
- [ ] Major (fix or feature that would cause existing functionality to change)
Thank you for proposing a contribution to Compass! We're discussing as a team the best place for this type of a button to live. We'll do a more formal review soon.
Hi @lukyncze , thank you for opening this PR! I'm the product manager for Compass, and we've spoken as a team about where we want this button to live. Because the primary button bar is a bit crowded already, we'd like to put this action in a dropdown menu under the current expand all button. We also want to make sure to account for collapsing documents. Here is our design for the actions we'd like to add:
I'm not sure when our team will have the time to work on these changes ourselves. If you would like to update your PR to match these designs, our team will make sure to review your code. Thank you again!
Hey @betsybutton. Thanks for your and your team's input. I think your proposal looks very good. There's just one thing I'm not sure about - now it's very easy to expand just one record (meaning only 1 click is necessary). With this design it will take 2 clicks to do this action. Have you considered this? As a Compass user I do not like this very much.
Could I also ask you to create a task on the Jira board for this initiative?
I look forward to your response. Have a nice day!
cc @lerouxb
@lukyncze Apologies for the delay in responding here. We already have a ticket on Jira representing this work, feel free to subscribe to it if you'd like to be notified of updates: COMPASS-8233
Also, thank you for your feedback on the proposed design. I see that two clicks for expanding a single document isn't ideal, and I'll discuss alternative options with the design team. However, I'm not sure if there's a better place to surface these additional options. I'm curious if you have another idea, also considering the need to collapse all fields?
Our team would also greatly appreciate this functionality! Please prioritize it 🙏
Hi @kasperd-aleta and @lukyncze , we're excited to share this feature has now been released to Compass in version 1.45.2! I'm going to close this PR. Thank you for your feedback and for helping us improve Compass.
I love the feature. Thank you so much! ❤️ @betsybutton