Feature definition: Search functionality in new MFE

We intend to modify the search functionality in the new MFE such that:

  1. All searches are initiated from the search bar located next to the Add Post button.

  2. Search button searches:

    1. In post title and content when All Posts and My Posts tab is selected.

    2. In topics when Topcis tab is selected.

    3. In usernames when Learners tab is selected.

Figma mockups: https://www.figma.com/file/LVFnO9oRHYiamoicZuXDAC/Discussion-page?node-id=1604%3A1338

  • [Question]: Should the search be dynamic (results appear as the user type)?

    • No! Search functionality will be triggered when user clicks the magnifying glass icon in search box or presses Return key when in the search box and at least 1 character has been typed in the box.

    • Reason: No need for unnecessary API calls. Topics are filtered on frontend so it's easier there. But content and users are filtered on the backend.

  • [Question]: Do we want to put a character limit on search for content, topics or posts?

    • Probably yes.

  • [Question]: Do we want to paginate search results for users?

    • Yes. Just to be on safe side incase a user searches single letter and lots of users get returned. Limit of 10 should be sufficient.

 

Tab selected

Show Search info bar

Show Filter/ sort bar

Placeholder text

Search box logic

Tab selected

Show Search info bar

Show Filter/ sort bar

Placeholder text

Search box logic

My posts

Yes

Yes (with same options as without search, reset to default sort upon search)

Search all posts

Same as in legacy. Searches for provided string in post title, content, response and comments.

All posts

Yes

Yes (with same options as without search, reset to default sort upon search)

Search all posts

Same as in legacy. Searches for provided string in post title, content, response and comments.

Topics

Yes

No

Search topics

Same as legacy. Filters topics based on provided string on the frontend.

Learners

Yes

Yes (with same options as without search, reset to default sort upon search)

Search all learners

Same as legacy. Filters users based on provided string. It will still search users when a particular user is selected.

Searching content

The following behaviour is illustrated for when All Posts and My Posts tab is selected.

Action

Mockup

Action

Mockup

Default view of All Posts or My Posts tab.

 

  1. User enters a string in search bar.

 

  1. User clicks the search icon in search bar.

 

  1. Search info bar appears on top of list pane. Posts filter bar and post summaries are pushed below the search info bar.

  2. Search info bar shows the number of search results and the search string.

  3. “Clear results” option can be used to clear search results and return to default state of view in All posts or My posts tab.

  4. Filter bar shall remain available.

 

In light of currently available APIs, is this sorting and filtering being done on frontend or in cs_comment service?

Legacy view:

 

Wrapping long search strings.

 

Searching topics

The following behavior is illustrated for when Topics tab is selected.

Actions

Mockup

Actions

Mockup

 

 

  1. User enters the search string in search bar.

 

  1. Search info bar appears on top of list pane. Topic lists or post summaries are pushed below the search info bar.

  2. Search info bar shows the number of search results and the search string.

  3. “Clear results” option can be used to clear search results and return to default state of view in Topics tab.

 

After rollout of 1.7, will we search 3rd level of hierarchy? How will those results be rendered?

This is an open question that Jonathan and I are working on. As of now, we haven’t rolled out 1.7 yet. So the objective is to replicate exactly what is being done in legacy experience.

In legacy experience, as per Kshitij, all topics are being loaded on the frontend and searched there.