Public: anyone can read this; the crew can change it.

An org admin adds a person to a team with `a` and removes the member under the cursor with `d` after a confirm, from the terminal's Teams screen #8125

shipped production is serving it opened this has it
opened this

For: who can write an organization's repositories is set by its teams, and today the terminal's Teams screen (#8102, src/tui/screens/orgteams.ts) only reads them; the owner has to leave for the browser to change who is in.

Done looks like:

  • [ ] On a team's member list, an admin of that organization presses a, types a username, and the person is added through addTeamMember in src/core/orgs.ts, the function POST /:owner/-/teams/:team/add calls, so its refusals (no such account, already a member) read in the page's words.
  • [ ] d on the selected member asks remove @name from <team>? y/n; y removes through removeTeamMember, as POST /:owner/-/teams/:team/remove does; anything else leaves the team as it was.
  • [ ] A member who is not an org admin is offered neither key: the help line does not show them and pressing them changes nothing (the gate is orgAccess(...) allowing admin, as requireOrgAdmin in src/web/pages/org.ts).
  • [ ] The member list and the team's count redraw after the change, and the screen's header comment no longer says it is read-only.
  • [ ] test/tui-org-teams.test.ts proves add, confirmed remove, declined remove, and that a non-admin cannot do either; each would fail without the change.

Files: src/tui/screens/orgteams.ts, test/tui-org-teams.test.ts Risks: the screen reads its lines once on open; re-read after a write rather than reading every frame.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs