Conversation
…tuff, add screenshots
…#125) Agent-Logs-Url: https://github.com/hackaburg/tilt/sessions/c4d1d685-f445-450c-8d14-ea628b425710 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sezanzeb <28510156+sezanzeb@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR appears to implement a revamped “Teams” model (single team per user, explicit team owner, join requests, remove members, set owner) across backend + frontend, and reorganizes the README into separate docs with updated UI messaging.
Changes:
- Refactors backend team membership from string arrays to ORM relations (
Team.owner,User.team,User.teamRequest) and adds endpoints for removing members / setting owner. - Updates frontend team pages (new
EditTeampage, request-to-join UX, notifications) and adjusts project/rating gating based on team membership/admission. - Moves large README content into
docs/docs.mdand adds new screenshots/docs updates.
Reviewed changes
Copilot reviewed 36 out of 38 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Simplifies landing README and links to new docs and quickstart. |
| frontend/test/mocks/api.ts | Extends mocked API to include new team methods. |
| frontend/src/components/routers/sidebar/sidebar.tsx | Updates sidebar copy. |
| frontend/src/components/pages/view-team.tsx | Wires new EditTeam component with reload callback. |
| frontend/src/components/pages/view-project.tsx | Updates membership check and adds save notifications. |
| frontend/src/components/pages/teams.tsx | Updates team page explanatory copy. |
| frontend/src/components/pages/status.tsx | Updates status page copy for teams. |
| frontend/src/components/pages/read-only-team.tsx | Updates read-only team view, join request flow, and member display. |
| frontend/src/components/pages/read-only-project.tsx | Uses fallback project image and gates rating UI to admitted users. |
| frontend/src/components/pages/rating-form.tsx | Refactors rating form layout to use StackWithBorder. |
| frontend/src/components/pages/edit-team.tsx | Adds new team edit UI (accept requests, remove members, set owner, delete team). |
| frontend/src/components/pages/createTeam.tsx | Simplifies team creation and blocks creating when already in a team. |
| frontend/src/components/pages/admission.tsx | Contains partial updates related to teams in admissions table. |
| frontend/src/components/base/stack-with-border.tsx | Adds a reusable bordered stack UI component. |
| frontend/src/components/base/button.tsx | Adds nowrap styling and allows passing inline styles into Button. |
| frontend/src/api/index.ts | Updates team API shapes and adds removeUserFromTeam / setOwner. |
| docs/screenshot-1.jpg | Adds/updates documentation screenshot asset. |
| docs/docs.md | Adds new extracted documentation content from README. |
| docs/docker-development.md | Adds a yarn audit command to the lint section. |
| backend/test/services/team-service.spec.ts | Updates team creation test for new team/user relationship. |
| backend/test/services/rating-service.spec.ts | Updates setup for new teams and adds rating value validation tests. |
| backend/test/services/project-service.spec.ts | Updates setup for new team/user relationship. |
| backend/test/services/project-service-get-all-projects.spec.ts | Updates project visibility tests for “single team per user” model. |
| backend/test/services/mock/mock-teams-service.ts | Extends team service mock with new methods. |
| backend/test/controllers/rating-controller.spec.ts | Removes old rating controller test suite. |
| backend/test/controllers/auth.spec.ts | Adds auth/role and “no sensitive fields” HTTP-level tests. |
| backend/src/utils/has-same-elements.ts | Adds a new array utility function. |
| backend/src/services/user-service.ts | Changes user retrieval contract and updates user list DTO shape. |
| backend/src/services/team-service.ts | Implements new team model operations (create, update, request, accept, remove, set owner). |
| backend/src/services/rating-service.ts | Adds team membership requirement and updates team membership check logic. |
| backend/src/services/project-service.ts | Updates project visibility/permission logic to use user.team?.id. |
| backend/src/services/application-service.ts | Removes “teams” from application response building. |
| backend/src/entities/user.ts | Adds team and teamRequest relations on User. |
| backend/src/entities/team.ts | Refactors team entity to relations and adds helper ID extraction methods. |
| backend/src/controllers/users-controller.ts | Adjusts login/refresh behavior (and message) and relies on DTO conversion. |
| backend/src/controllers/dto.ts | Extends DTOs for team/teamRequest and refactors team DTO shapes. |
| backend/src/controllers/application-controller.ts | Updates createTeam signature and adds removeMember / setOwner endpoints. |
Comments suppressed due to low confidence (3)
frontend/src/components/pages/read-only-team.tsx:45
- Team ownership is still derived from
team.users?.[0]even though ownership is now modeled asteam.owner. This will misidentify the owner (and breaks if users aren’t ordered). Useteam.owner?.idfor the owner check.
backend/src/services/team-service.ts:260 - Deleting the team without clearing users’
team/teamRequestreferences is likely to violate the DB foreign key constraints (or leave orphaned references, depending on configuration). Beforedelete, update affected users toteam: null/teamRequest: null(or configureonDelete: "SET NULL"on the relations).
if (team?.owner.id !== currentUserId.id) {
throw new Error("You are not the owner of this team");
}
await this._teams.delete(id);
return Promise.resolve();
backend/src/controllers/dto.ts:535
ApplicationDTOstill exposes ateams: string[]field, butApplicationService.getAll()no longer sets it (and theIApplicationinterface removedteams). This makes the API response inconsistent and leads toteamsbeingundefinedon the frontend. Either removeteamsfrom the DTO/clients or reintroduce/populate it consistently.
export class ApplicationDTO {
@Expose()
@Type(() => UserDTO)
public user!: UserDTO;
@Expose()
public teams!: string[];
@Expose()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 37 out of 39 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* test: add tests for all TODO test comments Agent-Logs-Url: https://github.com/hackaburg/tilt/sessions/7c7127d4-6d01-41ef-a09c-77b78c39886d Co-authored-by: sezanzeb <28510156+sezanzeb@users.noreply.github.com> * chore: remove // TODO test comments now covered by tests Agent-Logs-Url: https://github.com/hackaburg/tilt/sessions/0ea22aa8-e99a-4fdb-9faf-330de9442742 Co-authored-by: sezanzeb <28510156+sezanzeb@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sezanzeb <28510156+sezanzeb@users.noreply.github.com>
No description provided.