-
Notifications
You must be signed in to change notification settings - Fork 815
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
Add a unified search component. #5997
Conversation
40e9eb8
to
31b7d6d
Compare
Needs more work on Writing once it's done, but still marking it as Needs Review for general direction review. |
05525f2
to
cd35447
Compare
Rebased after merging #6020 |
1b418dd
to
da24867
Compare
Thanks for the detailed review, Elio! I have fixed the first problem, but I'm not sure what to do about the second. @MichaelArestad can we have your advice on the UX here? Refreshing during search is quite an edge case, what should we do about it? |
@zinigor If they refresh, show the search and list everything until they exit the search or start typing. |
This is now ready for testing. Several caveats:
|
I am not. What other options do we have? We could show an encouraging message to get someone to search. (I don't think we do this anywhere else, but if we do, lets do it.) |
@jeffgolenski @rickybanister ideas/thoughts? ^ |
I don't think we need any placeholder text or anything. If search is focused, we should hide the current settings cards and just leave the rest of the page blank until something is typed. At most we could show a message below the search box— Something like
Like /people And if no results we could do something like this |
Needs a nice rebase. Labeling as |
5f76ab3
to
a0f72ec
Compare
c62db2b
to
6a400c2
Compare
* Passed searchTerm from Main to all settings tabs. * Added search functionality for the Writing tab. * Properly added tabs to searchable settings and added discussion search terms. * Added search terms to traffic tab. * Added search terms for Security tab. * Making sure the page doesn't disappear when a user first clicks Search. * Made sure the empty Composing section isn't shown.
Search will no longer show an empty page on clearing the term, but will rather go back to the previous page.
It will help determine if a module matches the current search. * Made the writing tab use the new search selector. * Made the traffic tab use the new found selector. * Added new search functionality to the security tab. * Added general settings to the new search.
* Also removed unused imports in Main. * Fixed several eslint warnings. * Fixed the writing settings tab.
6a400c2
to
26315e1
Compare
Rebased, now ready to test! |
This has grown too huge, let's merge it into the feature branch and move further with smaller changes. |
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.
-
there's a change that ended up being lost, I guess while rebasing. It's this and all its subsequent usages:
https://github.com/Automattic/jetpack/pull/5997/files#diff-b90f6848452ec5e1c5bcb466b4628d12L168I noticed this when I clicked the Sharing nav tab, it tried to go to
http://example.org/wp-admin/undefinedoptions-general.php?page=sharing
-
when you click the x to close the search, if the field is empty, you exit the search mode, as can be seen here
-
there's a jump when you clear the field. Happens when you do it by keyboard or by mouse
-
finally, the first time I reviewed this I mentioned that it was inconsistent that when you started searching, all setting cards were visible, but if you for some reason reloaded or followed a link straight to
#search
, no setting cards were visible. To make it consistent, we should never display any card while in search mode and when the field is empty. This is how the settings search in iPhone and Android works so some people will be familiar.
@eliorivero thanks for thorough testngi! What do you say I fix number 1 and we merge, while creating issues for everything else? This PR is too heavy to rebase each time stuff gets modified in the feature branch. |
ok cool, yeah, the first one is why I blocked this. The others can be improved later, specially 2 and 3. |
OK, done. @eliorivero can you please take a look again at the last commit and merge if it's OK? |
_inc/client/main.jsx
Outdated
@@ -174,36 +182,22 @@ const Main = React.createClass( { | |||
pageComponent = <Apps siteRawUrl={ this.props.siteRawUrl } />; | |||
break; | |||
case '/plans': | |||
pageComponent = <Plans siteRawUrl={ this.props.siteRawUrl } siteAdminUrl={ this.props.siteAdminUrl } />; | |||
pageComponent = <Plans siteRawUrl={ this.props.siteRawUrl } siteAdminUrl={ this } />; |
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.
This change is not ok, should still have the props.siteAdminUrl
otherwise the URL for example for "View your spam stats" ends up like http://example.tld/wp-admin/[object%20Object]admin.php?page=akismet-key-config
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.
Will merge this for now. The one concern I have is that we're connecting all these middle components when it's not necessary. This introduces a slight overhead in performance and is harder to maintain so they should be removed and get props from their parent component which is already connected.
Remove unused file modules-per-tab-page.jsx. The only file using this component was removed in #5997 #### Changes proposed in this Pull Request: <!--- Explain what functional changes your PR includes --> * Removes _inc/client/components/module-settings/modules-per-tab-page.jsx #### Testing instructions: 1. Standing on the jetpack directory. 2. Run `grep -r AllModuleSettings *`. (The file removed by this PR exports a named export so usages of it can be greppable. 2. Confirm that no result comes up. #### Proposed changelog entry for your changes: * None needed
This adds a new component that will include all tabs and pass search terms into them. That will allow us to get rid of a dedicated search view and use existing ones instead.
Changes proposed in this Pull Request:
Testing instructions:
What else to look at