Skip to content

feat: search app groups by name on the app page#524

Merged
Jeff-Rowell merged 2 commits into
mainfrom
feat/search-groups-on-app-page
Jul 14, 2026
Merged

feat: search app groups by name on the app page#524
Jeff-Rowell merged 2 commits into
mainfrom
feat/search-groups-on-app-page

Conversation

@Jeff-Rowell

@Jeff-Rowell Jeff-Rowell commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Extend the App page search box so it also matches an app group's own name, not just its members.
Urgency: 5 days
Expected review effort: LOW

Motivation

On an app with many groups, confirming whether a specific app group exists, or finding a subset of groups (e.g. all groups containing Prd), currently requires scrolling the full list. The search box only filtered by member, so searching for a group name returned nothing.

Description of Changes

  • Backend (GET /api/apps/{id}/groups): the q filter now matches a group whose own name contains the query (case-insensitive substring) OR that has an active member matching by name/email. The existing member-match behavior is unchanged.
  • Frontend: the single search box is relabeled from "Search Users" to "Search groups or users". No new state, props, or hooks; the existing q plumbing carries the query.
  • No API schema change: q was already an optional query param.
  • The always-visible owner group at the top is fetched separately and remains unfiltered by design.

Validation of Changes

  • Added backend test asserting a q matching a group name returns that group, and that a subset query (e.g. prd) matches by case-insensitive substring. Written test-first: confirmed it failed before the change and passes after.
  • Existing member-search test still passes (regression guard for the OR behavior).
  • ruff, ty, and the full tests/test_app.py suite pass; frontend tsc --noEmit is clean.
  • Manually testable against the local dev DB (267 app groups): e.g. search Sim, 00005, Alpha.

Guidance for Reviewers

Single commit, small changeset. The key logic change is the one-line or_(AppGroup.name.ilike(like), member_match) in api/routers/apps.py; the rest is the label change and stale-comment updates.

The app page search box previously filtered app groups only by member
(a group appeared if it had an active member matching by name or email).
Extend the `q` filter so it also matches a group's own name, letting users
find a specific app group or a subset (e.g. all groups containing "Prd")
by a case-insensitive substring without scrolling the full list.

The single search box now matches group name OR member; relabel it from
"Search Users" to "Search groups or users". No API schema change.
Regenerate the app-groups endpoint description in the OpenAPI client to
match the updated backend docstring, keeping the openapi-client-drift
check green.
@Jeff-Rowell Jeff-Rowell marked this pull request as ready for review July 9, 2026 21:15
@Jeff-Rowell Jeff-Rowell merged commit 45f957a into main Jul 14, 2026
6 checks passed
@Jeff-Rowell Jeff-Rowell deleted the feat/search-groups-on-app-page branch July 14, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants