feat: added pagination, search, and description to org teams page#36602
feat: added pagination, search, and description to org teams page#36602kmranimesh wants to merge 9 commits intogo-gitea:mainfrom
Conversation
Add pagination and keyword search to the organization teams list page. Display team descriptions in team cards. - Refactor Teams() handler to use SearchTeam() with ListOptions for server-side pagination and keyword filtering - Add search input with the existing 'search.team_kind' locale string - Show team description in an attached segment below the team name - Add standard pagination widget at the bottom of the list Fixes go-gitea#34482
There was a problem hiding this comment.
Pull request overview
Adds server-side pagination and keyword search to the organization teams list, and displays team descriptions on the teams page to improve usability for orgs with many teams.
Changes:
- Refactors
Teams()handler to useorg_model.SearchTeam()withListOptionsfor pagination and keyword filtering. - Adds a search input (
q) to filter teams by name/description. - Displays team descriptions in team cards and adds the standard pagination widget.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| templates/org/team/teams.tmpl | Adds search UI, renders team descriptions, and includes the pagination widget. |
| routers/web/org/teams.go | Implements paginated + keyword-filtered team retrieval via SearchTeam() and wires up pagination state to the template. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Could you drop a screenshot of that? |
|
Review of this PR (this comment was written by Claude Code / claude-opus-4-6): Permission regression for non-owner admin members. The org context middleware in Redundant full team loading. The middleware still runs before the handler and loads all teams into Pagination wiring looks correct. Template changes look fine. The description segment ( Minor: the search bar is always shown, even for non-owners. This is fine UX-wise — it lets any org member search their visible teams. |
Signed-off-by: silverwind <me@silverwind.io>
Signed-off-by: silverwind <me@silverwind.io>
|
Comment authored by @silverwind via Claude Code. Follow-up review after the latest updates: The permission regression I flagged earlier is now properly addressed — Remaining notes:
|
|
Please address point 1 and maybe point 4. |
silverwind
left a comment
There was a problem hiding this comment.
Review (written by Claude Code / claude-opus-4-6):
-
Code duplication: The identical 14-line team-loading block is copy-pasted in both
routers/web/org/home.goandrouters/web/user/home.go. Should be extracted into a shared helper likeOrganization.LoadVisibleTeams(ctx, user). -
CanUserSeeAllTeamscalled multiple times per request: On the teams page it's called in the middleware (forNumTeams), potentially again in the middleware (for:teampath resolution), and again in theTeams()handler. Each call hits the DB. The result should be computed once and stored onctx.Org. -
No tests:
CanUserSeeAllTeams(especially the non-owner admin-team path), paginatedTeams()handler, andCountTeamhave no test coverage.
|
1 and 2 should be addressed, then it's lgtm. Tests would be nice but not a blocker from me. |
|
Although it might work, the implementation seems to be a hacky patch to existing
But this PR introduces more changes and make the things more complicated (e.g.: many TBH I have difficulty to understand why it should be implemented like this, and no idea about how the code can be maintained in the future. |
- Add pagination and keyword search to the teams list page - 5 teams shown at most in the overview page Fixes: #34482 Fixes: #36602 Fixes: #37084 Signed-off-by: silverwind <me@silverwind.io> Co-authored-by: Animesh Kumar <83393501+kmranimesh@users.noreply.github.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>



Added pagination and keyword search to the organization teams list page,
and displayed team descriptions in the team cards.
Teams()handler to useSearchTeam()withListOptionsfor server-side pagination and keyword filtering
search.team_kindlocale keyFixes Paginate, filter and display descriptions of teams in the organization page #34482