Git Product home page Git Product logo

react-search's People

Contributors

cjcenizal avatar mrderyk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-search's Issues

Add x-source to query header

For insights purposes, we can add a header param to queries coming from search. This helps us measure the usage of this component to query our API/

Add “close” button to the search modal

This will be useful for any device that lacks an “Escape” button, e.g. a touchscreen. This also will fix a critical bug on smaller touchscreens, because on those devices the modal occupies the entire screen and there’s no way to dismiss it.

Refine useSearch interface

This hook currently returns { fetchSearchResults, isLoading }. I noticed two things:

  • We're using two different verbs to describe the same action: "fetch" and "load"
  • The action is verbose but the state is terse

I think we can reconcile these differences and create more symmetry between the action and the state. I suggest erring on the side of verbosity to avoid potential conflicts with the consumer's variables, e.g. a local isLoading variable. I'd suggest { fetchSearchResults, isFetchingSearchResults }.

Add option for configuring deep-link query parameter name

Currently, setting isDeeplinkable will persist the search query to the search query parameter. This could collide with a query parameter already in use by the consumer. We can resolve this by providing an option for persisting the search query to a different query parameter.

Swap out react-icons for another icon library

react-icons currently takes up over 83% of our bundle size. Let's look for an alternative, since we only need one icon, and deep-importing from react-icons doesn't look to be working.

Theming

We can support basic themes that change the color scheme, e.g. green, orange, red, dark.

Handle errors

The component needs to handle errors and surface them to the user.

Support customization of how a search result is rendered

Search results can be configured with arbitrary metadata, and the consumer should be able to use this metadata to drive how a search result is rendered. One solution could be to provide a search result deserializer prop and a render prop.

Add support for summarized answer

We can use tabs to provide access to both the current search results, as well as a summary of the results. We can use localStorage to remember the user's preference so that they don't have to keep selecting the tab they want.

image

Add support for OAuth

We should consider the user journey from using this component in prototypes (API keys) to using it in production (OAuth).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.