Skip to content

[front] Fix NSFW for search and pin direct match to top minds#4820

Ben requested to merge fix/nsfw-search-m4820 into master

Ticket(s) / Related Merge Requests

Summary of Changes

  • Fixes issue where NSFW results are omitted from search results.
  • Pins direct matches for query to top of search results.

Testing Considerations

NSFW results being omitted
  • When mature setting is ON nsfw accounts such as nsfwuser are returned in search result (when exact matched).
  • When mature setting is OFF nsfw accounts such as nsfwuser are returned in search result (when exact matched).
  • When mature setting is ON nsfw accounts such as nsfwuser are returned in search result for chat (when exact matched).
  • When mature setting is OFF nsfw accounts such as nsfwuser are returned in search result for chat (when exact matched).
  • When mature setting is ON nsfw accounts such as nsfwuser are returned in search result for composer autocomplete @minds (when exact matched).
  • When mature setting is OFF nsfw accounts such as nsfwuser are returned in search result for composer autocomplete @minds (when exact matched).
  • Mature settings toggle automatically updates without needing to refresh (I fixed this while I was in there).
Pin direct search matches to top
  • Exact matches are pinned to top of search. For sandbox, this is a bit hard to recreate but one I know has this issue right now is the query test - ensure a user named test is first in the list (it is NOT on other sandboxes). For staging try querying for minds.

Deployment Considerations

Standard deployment.

Regression Scope

Search functionality.

Platform Affected (web, mobile, etc)

Web.

Developer Testing Completed

Manual, unit (jasmine/karma), unit (phpspec).

Screenshots / Screen Recording

Search results

simplescreenrecorder-2024-04-26_13.23.37

Chat search

simplescreenrecorder-2024-04-26_13.25.44

Composer autocomplete

simplescreenrecorder-2024-04-26_13.28.13

Exact matches are pinned to top of search.

simplescreenrecorder-2024-04-26_13.32.04

Does this impact

  • Localization
  • Dark/light mode
  • Guest mode

Definition of Done Checklist

  • The Acceptance Criteria has been met
  • Code is tested: Testing includes unit/spec, E2E/automated and manual testing
  • Merge requests description has been filled out
Edited by Ben

Merge request reports