feat(frontend): rebuild team management as a save-once workspace - #214
Merged
Conversation
The manage-teams page could not cope with a hundred participants: people were chips in a wrap, preferences were truncated titles, and every drag was a server round trip. It is now two columns — projects with their teams on the left, unassigned on the right, both scrollable — and people are full-width rows wherever they sit. Each project carries a number, and a participant's preferences show as those numbers rather than titles, with the matching one highlighted inside a team so it is obvious whether someone got what they asked for. "Suggest teams" builds a whole distribution from everyone's preferences. The rule is deliberately singular: everyone goes to a project they picked, spread evenly across their options, and no team exceeds six. There is no minimum team size. A minimum sounds reasonable and generates every hard case — projects dissolved, people redistributed, totals that satisfy no split, teams emptied when the number is raised — for a judgement that belongs to the organizer anyway. A project two people want is a team of two, and dragging is the tool for deciding otherwise. The algorithm lives in $lib/utils/teamDistribution so it can be tested without a page around it. The page is now a workspace rather than a series of instructions: dragging, adding, renaming, deleting and clearing all happen in the browser, the header shows what is pending, and one Save writes it. That collapses move, createTeam, renameTeam, deleteTeam and clearAssignments into a single `save` action which takes the complete desired state and reconciles — deletes first, then creates and renames, then the membership difference. Applying is slow by construction: there is no bulk RPC, so a hundred people is a few hundred sequential calls.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The manage-teams page could not cope with a hundred participants: people were chips in a wrap, preferences were truncated titles, and every drag was a server round trip.
It is now two columns — projects with their teams on the left, unassigned on the right, both scrollable — and people are full-width rows wherever they sit. Each project carries a number, and a participant's preferences show as those numbers rather than titles, with the matching one highlighted inside a team so it is obvious whether someone got what they asked for.
"Suggest teams" builds a whole distribution from everyone's preferences. The rule is deliberately singular: everyone goes to a project they picked, spread evenly across their options, and no team exceeds six. There is no minimum team size. A minimum sounds reasonable and generates every hard case — projects dissolved, people redistributed, totals that satisfy no split, teams emptied when the number is raised — for a judgement that belongs to the organizer anyway. A project two people want is a team of two, and dragging is the tool for deciding otherwise. The algorithm lives in $lib/utils/teamDistribution so it can be tested without a page around it.
The page is now a workspace rather than a series of instructions: dragging, adding, renaming, deleting and clearing all happen in the browser, the header shows what is pending, and one Save writes it. That collapses move, createTeam, renameTeam, deleteTeam and clearAssignments into a single
saveaction which takes the complete desired state and reconciles — deletes first, then creates and renames, then the membership difference.Applying is slow by construction: there is no bulk RPC, so a hundred people is a few hundred sequential calls.