Tell users project session search covers the last 30 days
What does this MR do and why?
Companion frontend MR to !264017 (merged) (merged), which guards session search for https://gitlab.com/gitlab-org/gitlab/-/work_items/635083.
With duo_workflow_project_search_guard on, search only matches sessions created in the last 30 days, unless the search is only session IDs. The session list itself shows sessions by last update, so older sessions can be in the list but missing from search results. While a search term is active and the search is project-scoped, this MR shows "Search only finds sessions created in the last 30 days." On a project's sessions page it appears on the "Showing sessions in" line. On the user sessions page and in the Duo side panel, where the Project filter must be set, it appears under the search bar. The note only appears while the flag is on. !264017 (merged) pushes the flag on every page, so the side panel gets it too. Searches without a project filter have the same 30-day limit but don't show the note yet. The note also shows for searches of only session IDs, which the 30-day limit skips. Hiding it would mean copying the backend's ID-matching rule into the frontend, so that rule stays in the backend only.
The other search limits (3-character minimum, 10-word cap) are enforced only by the backend.
The note still shows for ID-only searches, to avoid copying the backend's ID-matching rule into the frontend.
References
- Issue: https://gitlab.com/gitlab-org/gitlab/-/work_items/635083
- Backend MR: !264017 (merged)
- Leader epic: https://gitlab.com/groups/gitlab-org/-/epics/24123
Screenshots or screen recordings
How to set up and validate locally
- Enable the flag:
Feature.enable(:duo_workflow_project_search_guard). - Open a project's agent sessions list (Automate > Agent sessions).
- Type a search term. Check that "Search only finds sessions created in the last 30 days." appears on the "Showing sessions in" line, and disappears when you clear the search.
- On your user sessions page or in the Duo side panel, set the Project filter and type a search term. Check that the note appears. Remove the Project filter and check that it disappears.
- Disable the flag and search again. Check that the note doesn't appear.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
