lorawan-stack icon indicating copy to clipboard operation
lorawan-stack copied to clipboard

Console search

Open kschiffer opened this issue 3 months ago • 0 comments

Summary

This PR adds the search functionality to the console redesign branch.

Changes

  • Add search functionality
  • Add functionality to track "top entities"
  • Add <ScrollFader /> component to streamline fading away content in scrollable overflow containers
  • Various related changes to libraries, components and styles

Testing

Steps
  1. Go to the console
  2. Press / or Cmd+K to open the search panel
  3. Type in a search term
  4. See results
  5. Select a result item and hit Enter
Results
image image

Notes for Reviewers

The search works in a way that it shows the top entities by default if no search term is given. Once a search term is entered, the search logic will run individual search APIs of gateways, applications, end devices and organizations and aggregate the results. It also fetches the most recent 100 applications, gateways and organizations (cached per 5 minutes) in a best effort to have not only the entity ID but also the entity name available. It also fetches the most recently added 1000 end devices of the top 3 applications for the same reason.

As described, this also contains logic that tracks "top entities" based on frequency and recency of use. I will open up a separate PR to integrate this into the existing work for the sidebar top entities, as well as the top entities panel in the Console overview.

There's also a fix included that makes sure the view is updated properly when switching between entities of the same type. Before this fix the ID and name in the entity title section would remain the same after navigating. Using the selectSelected{ENTITY} selectors fixed that.

Checklist

  • [x] Scope: The referenced issue is addressed, there are no unrelated changes.
  • [x] Compatibility: The changes are backwards compatible with existing API, storage, configuration and CLI, according to the compatibility commitments in README.md for the chosen target branch.
  • [x] Documentation: Relevant documentation is added or updated.
  • [x] Testing: The steps/process to test this feature are clearly explained including testing for regressions.
  • [x] Infrastructure: If infrastructural changes (e.g., new RPC, configuration) are needed, a separate issue is created in the infrastructural repositories.
  • [x] Changelog: Significant features, behavior changes, deprecations and fixes are added to CHANGELOG.md.
  • [x] Commits: Commit messages follow guidelines in CONTRIBUTING.md, there are no fixup commits left.

kschiffer avatar May 15 '24 17:05 kschiffer