Closes #29
This PR is a major refactor of the Search component.
Type of changes made
[x] New feature (non-breaking change which adds functionality)
[x] This change requires a documentation update
What changes were made
This was done mostly with 1.0 in mind. With the new UI to be implemented, the current implementation was just not scalable enough and would require an enormous amount of workarounds to get working (if you look at the current content.ts file, you might already be able to see some of these "solutions" have been implemented). The refactor allowed more code to be moved directly to the Search component, where it is closer to the UI.
Here is a list of the fixes and refactoring that took place:
Added more state values to keep track of the currentSearchMode which is currently being derived from the props. With the 1.0 UI, this will be essential in letting the users switch between the different modes with ease
Add a set value to track errors. This allows errors to be detected from within the component and show the error component at will.
All the data (tab data and actions) are loaded inside the component instead of being through props. This allows for some more robust error reporting in case an error occurs and lets the data be a bit more reactive
Most of the document listeners are now in the Search component. This makes it easier to manage as they are automatically mounted and unmounted with the Search component.
I might have missed some changes so please take a look at the code. This is definitely not needed for the beta launch, but it is critical for scaling to 1.0, and the faster we integrate these changes, the easier it will be going forward.
Description
Closes #29 This PR is a major refactor of the Search component.
Type of changes made
What changes were made
This was done mostly with 1.0 in mind. With the new UI to be implemented, the current implementation was just not scalable enough and would require an enormous amount of workarounds to get working (if you look at the current
content.ts
file, you might already be able to see some of these "solutions" have been implemented). The refactor allowed more code to be moved directly to the Search component, where it is closer to the UI.Here is a list of the fixes and refactoring that took place:
currentSearchMode
which is currently being derived from the props. With the 1.0 UI, this will be essential in letting the users switch between the different modes with easeI might have missed some changes so please take a look at the code. This is definitely not needed for the beta launch, but it is critical for scaling to 1.0, and the faster we integrate these changes, the easier it will be going forward.