fix(ui): add Create Teammate button and fix cross-board assign dropdown#2000
Open
kasiazjc wants to merge 6 commits into
Open
fix(ui): add Create Teammate button and fix cross-board assign dropdown#2000kasiazjc wants to merge 6 commits into
kasiazjc wants to merge 6 commits into
Conversation
The empty-state teammate panel now shows a primary "Create teammate" button above "Assign an existing teammate", opening the CreateDialog on the teammate tab. createTeammateBranch receives the current boardId so the new teammate is assigned to the board the user is viewing rather than spinning up a separate dedicated board. The "assign existing" dropdown now fetches all teammate branches via the API instead of relying on the board-scoped store slice, so teammates from other boards are visible and assignable. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The cross-board teammate list used `branches.findAll`, which auto-paginates over every non-archived branch in the instance (the daemon does not push $limit into SQL). Switch to a single bounded `find` page and normalize the Paginated | array result. Also stop mutating the React state array in the options useMemo, and log fetch failures instead of swallowing them. Tests: mock `find` (paginated shape), and cover fetch-suppression when a primary teammate exists plus the cross-board assign resolution path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The BoardTeammatePanel added a cross-board branches.find({ $limit: 200 })
fetch on the premise that the store's branchById is board-scoped. It is
not: useAgorData hydrates branchById with no board_id filter and keeps it
live over sockets, so it already holds every non-archived branch
instance-wide. Delete the redundant fetch and derive teammateOptions from
branchById — the $limit:200 fetch was a silent invisibility ceiling and
non-reactive to socket updates.
Also stop createTeammateBranch from force-calling boards.setPrimaryTeammate.
That call is a forcible overwrite, so ungated create entry points
(NewSessionButton, settings modal) silently demoted a board's existing
primary. The branches create hook already auto-promotes a new teammate to
primary only when the board has none (setPrimaryTeammateIfUnset), which
still satisfies the empty-state flow.
Copy: assigning a teammate re-parents its single board_id, so it MOVES —
"Assign an existing teammate" → "Move an existing teammate here".
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ch dep The teammate branch is created with `boardId`, which the daemon persists as `board_id`, so the post-create `board_id` fallback patch was unreachable. Remove it, drop the now-unused `onUpdateBranch` from TeammateCreationDeps and its callers, and trim redundant comments. No behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Creating a teammate no longer forces it onto the board you're viewing. A "Create a new board for this teammate" checkbox (checked by default) lets you opt into attaching it to the current board instead. The option is only offered when a current board is in context — on Home and the global Settings modal the teammate always gets a fresh board. Also rename the empty-state "Assign" button to "Move here" so it matches the "Move an existing teammate here" heading and the move semantics. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Home 'New' dropdown → 'New AI teammate' opened a HomePage-local board-picker modal forcing the user to select an existing board, then the unified CreateDialog created a brand-new board anyway (its 'Create a new board' checkbox defaults to checked). Two modals that contradicted each other. Teammates now open the unified CreateDialog directly on the teammate tab with no board pre-pick — the teammate gets its own new board and the user lands there, consistent with the canvas/panel flow. The intermediate board-picker modal is now branch-only (branches legitimately target an existing board); its teammate/branch Segmented and the dead createType state are removed, closing the back-door into the broken teammate path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
handleCreateTeammatein App.tsx now passescurrentBoardIdtocreateTeammateBranch(). When a user creates a teammate while viewing a board, the teammate is assigned to that board instead of creating a separate dedicated board.createTeammateBranch()already supported an optionalboardIdparam (used by onboarding) — this change threads it from the standard create flow too.client.service('branches').findAll()) instead of relying on the board-scoped Zustand store slice. Previously, teammates from other boards were invisible becausebranchByIdis populated board-scoped inuseAgorData.Board-creation behavior change
createTeammateBranchalready accepted an optionalboardIdto skip creating a dedicated board — this was used by the onboarding wizard. Now,handleCreateTeammateinApp.tsxpassescurrentBoardIdwhen it's set, so teammates created from any board-context dialog attach to the current board. WhencurrentBoardIdis empty (e.g. creating from the Home surface), the old behavior (fresh board) is preserved.Onboarding wizard
The onboarding wizard's board-creation behavior is unchanged — it already passes its own
boardIdtocreateTeammateBranch()and intentionally creates a dedicated home board for first-time users. No change needed there.Test plan
createTeammateBranchwithboardIdparam (verifies no board creation, correct primary assignment)🤖 Generated with Claude Code