MuckRock / documentcloud-frontend

DocumentCloud's front end source code - Please report bugs, issues and feature requests to info@documentcloud.org
https://www.documentcloud.org
GNU Affero General Public License v3.0
18 stars 5 forks source link

Add ability to expand/collapse all search highlights #865

Open eyeseast opened 4 days ago

eyeseast commented 4 days ago

After #848, we're defaulting to showing search highlights by default, which can lead to highlights taking over the page. The old site shows the first three and allows you to show all (which adds state and complexity).

I propose we add a top-level toggle that expands or collapses all highlights in one action, similar to selecting all documents.

allanlasser commented 4 days ago

Top level toggle in ResultsList would work well, since we can pass in an open prop to the PageHighlight and NoteHighlight. Source

allanlasser commented 4 days ago

Two approaches to providing the controls:

Screenshot 2024-11-21 at 12 06 06 PM
  1. Show a dropdown menu when there's an active search with actions, using a similar visual language to #866
  2. In each group, show the "All" actions