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

Search pages in page or references filter #130

Merged
merged 7 commits into from
Jul 12, 2020
Merged

Search pages in page or references filter #130

merged 7 commits into from
Jul 12, 2020

Conversation

Stvad
Copy link
Member

@Stvad Stvad commented Jul 11, 2020

Based on #83 by @GitMurf
cut

@Stvad Stvad requested a review from tntmarket July 11, 2020 23:58
Copy link
Contributor

@tntmarket tntmarket left a 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'
Copy link
Contributor

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.

Copy link
Member Author

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? :)

Copy link
Contributor

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'
Copy link
Contributor

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'

Copy link
Member Author

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)
Copy link
Contributor

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

@sonarcloud
Copy link

sonarcloud bot commented Jul 12, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Stvad Stvad merged commit a4d080b into master Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants