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

Drive search from query string #82

Closed
JamesMGreene opened this issue Nov 24, 2014 · 14 comments · Fixed by #83
Closed

Drive search from query string #82

JamesMGreene opened this issue Nov 24, 2014 · 14 comments · Fixed by #83

Comments

@JamesMGreene
Copy link
Contributor

I know that Component is basically abandoned now but it would be really nice if someone who knows the system (and the correct "component way" to do this) could take probably ~30 minutes or less to add this....

It would be nice if the search could be driven from the query string, i.e. navigating to http://component.github.io/?q=dialog would trigger an automatic search for dialog when the page is finished loading.

@stephenmathieson
Copy link
Contributor

you can probably do

var qs = require('querystring') // (component/querystring)

// . . . 

var q = qs.parse(location.search).q || '';
search.show(q);

instead of search.show('') ... but i havent tested this.

@dandv
Copy link
Member

dandv commented Nov 25, 2014

Is Component abandoned?

@stephenmathieson
Copy link
Contributor

I use both component v0.19 and duo pretty regularly...

@JamesMGreene
Copy link
Contributor Author

@dandv: My understanding per componentjs/component#594, componentjs/component#601, and componentjs/component#604 is that Component is now in maintenance-only mode.

Is that the correct interpretation, "maintainers" @timaschew, @netpoetica, @trevorgerhardt, @clintwood, and @jasonkuhrt?

@JamesMGreene
Copy link
Contributor Author

@stephenmathieson: Your earlier code snippet looked valid to me upon further review. I'll try to submit a PR for it later tonight.

@19h
Copy link

19h commented Nov 25, 2014

Component isn't dead nor in maintenance-only. Just because the original authors went bonkers this project isn't abandoned. @timaschew works on component avidly and even then, we're using it for the very fundamental build processes in our company. (disclaimer: @timaschew works there as well)

@timaschew
Copy link
Member

I plan to continue both maintenance and features for component until latest browsers will support module loading and web components natively.

A main feature of component is that it supports local modules/dependencies, which doesn't exist for other tools like browserify or duo. This is a reason for me to use copmonent (not only at our company) and continue development on component.

I have some ideas for the next release to support package.json if a projects without a component.json. This is sometimes an issue, because the maintainers of projects don't want to maintain several manifest files.

@jasonkuhrt
Copy link

For what its worth, maybe a second wind for component would be supporting the Concord spec. I'm putting this same question out there with duo:

@JamesMGreene
Copy link
Contributor Author

Alright, so working on the PR for this per @stephenmathieson's tip did work. However, it brings up a UI quirk that needs a design decision:

  • Using pretty much the exact code supplied by @stephenmathieson does indeed work in that the page is loaded and then the search is executed
  • However, the "Search" textbox does not contain the searched text; it still says "Search"
  • But, if I were to update my local code to instead show the search term there, it could be pretty confusing to someone new to the site what exactly is going on as just having the search term at the bottom doesn't necessary convey to them that that is a search control, especially if they just clicked a link provided by someone else.

So, design-wise... maybe one of those two end results is acceptable (at least for a quick win on getting this search functionality in)? If not, then we should consider [at least] the following:

  • Displaying a "results" message above the results, e.g. "Found n results for dialog:"
  • Adding a prefix label to the Search control, e.g. "Search: [dialog]"
  • Other ideas?

Local screenshots:

image

image

@JamesMGreene
Copy link
Contributor Author

Maybe the latter (showing the search term without a prefix label) is actually OK because the cursor is still there blinking. Thoughts?

@stephenmathieson
Copy link
Contributor

i'd go with the second option

@JamesMGreene
Copy link
Contributor Author

Yeah, it actually looks pretty good the more I look at it. Not sure if I did the "right" thing for it but I'll submit the PR shortly and you all can judge me there. 😉

@JamesMGreene
Copy link
Contributor Author

PR available for review: #83

@JamesMGreene
Copy link
Contributor Author

Thank you everyone for the guidance, correction of misinformation [on the livelihood of Component], and merging my PR. 💝

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 a pull request may close this issue.

6 participants