-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Search pages in page or references filter #130
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.
Lg2m, some minor nits
} | ||
} | ||
|
||
const searchInputId = 'searchInputBox' |
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.
nit: but maybe prefix like roam-toolkit--searchInputBox
Clarifies it's not a native roam thing, and stands out to people who might want to customize the css.
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 curious why two dashes? :)
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.
Hmm, I guess it's a convention for denoting hierarchy from http://getbem.com/introduction/ , although the meaning isn't quite the same here
const eventTarget = event.target as HTMLElement | ||
if (!eventTarget) return | ||
|
||
const filterPageButtonClicked = eventTarget.className === 'bp3-button' |
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 think src/ts/core/roam/selectors.ts
has 'bp3-button'
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.
Hmm, is there a nice way to check if an element or one of it's children is matching a selector?
searchInput.style.cssText = 'width:200px;display:flex' | ||
searchElementsContainer.appendChild(searchInput) | ||
|
||
searchInput.addEventListener('input', onFilterInput) |
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 think naming the consequence of event handlers (showButtonsMatchingQuery
) is usually more helpful than naming the cause, because readers probably already know "this happens when a search is inputted", but they don't know "what happens, and why does this handler exist" yet
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Based on #83 by @GitMurf