-
Notifications
You must be signed in to change notification settings - Fork 235
fix: search by collection name #2891
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
lol |
it('can create a collection and drop it', async function () { | ||
const dbName = 'test'; // existing db | ||
const collectionName = 'my-sidebar-collection'; | ||
const collectionName = 'a-sidebar-collection'; |
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.
why not just search in the sidebar so it is the only one being displayed?
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.
see helpers/commands/navigate-to-collection-tab.js for how to do that.
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.
ah damn. i didn't know that we can also search by collection name. that sounds much better. I always tried db.collection
but of course it didn't work.
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.
I'm happy with this either way, btw. A third way to fix this would be to extend helpers/compass/scroll-to-virtual-item.ts to work with the sidebar which I think also uses virtual scrolling.
There might be a race condition with searching: if you search before the collection exists it will never find it. In that case your original solution of putting it at the front is fine for now.
I don't mind trying to fix this as well - I probably broke it when I added lots of collections. I think the way to go is to make |
this PR fixes the broken test that was introduced in #2867
Due to less scroll area of sidebar databases, the
database.collection
is not visible in the viewport and test fails.Now changed search param to collection name.
Description
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes