Skip to content

fix(ui): add Create Teammate button and fix cross-board assign dropdown#2000

Open
kasiazjc wants to merge 6 commits into
mainfrom
fix-board-primary-teammate-create-assign
Open

fix(ui): add Create Teammate button and fix cross-board assign dropdown#2000
kasiazjc wants to merge 6 commits into
mainfrom
fix-board-primary-teammate-create-assign

Conversation

@kasiazjc

Copy link
Copy Markdown
Contributor

Summary

  • Create Teammate button in empty state: When a board has no primary teammate, the teammate panel now shows a primary "Create teammate" button above the existing "Assign an existing teammate" section. Clicking it opens the standard CreateDialog on the teammate tab.
  • Teammate assigned to current board: handleCreateTeammate in App.tsx now passes currentBoardId to createTeammateBranch(). 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 optional boardId param (used by onboarding) — this change threads it from the standard create flow too.
  • Cross-board assign dropdown: The "assign existing teammate" dropdown now fetches all (non-archived) teammate branches via the API (client.service('branches').findAll()) instead of relying on the board-scoped Zustand store slice. Previously, teammates from other boards were invisible because branchById is populated board-scoped in useAgorData.

Board-creation behavior change

createTeammateBranch already accepted an optional boardId to skip creating a dedicated board — this was used by the onboarding wizard. Now, handleCreateTeammate in App.tsx passes currentBoardId when it's set, so teammates created from any board-context dialog attach to the current board. When currentBoardId is 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 boardId to createTeammateBranch() and intentionally creates a dedicated home board for first-time users. No change needed there.

Test plan

  • Existing BoardTeammatePanel tests pass (4 test files, 12 tests)
  • New tests for Create Teammate button rendering and click behavior (3 tests)
  • New test for createTeammateBranch with boardId param (verifies no board creation, correct primary assignment)
  • TypeScript typecheck passes
  • Biome lint/format passes
  • Manual: navigate to a board with no primary teammate, confirm "Create teammate" button appears above "Assign existing"
  • Manual: click "Create teammate", create one, confirm it's assigned to the current board (not a new board)
  • Manual: confirm the "assign existing" dropdown shows teammates from other boards

🤖 Generated with Claude Code

kasiazjc and others added 2 commits July 23, 2026 11:22
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>
@kgabryje kgabryje added the ai-reviewed-gpt-5-6-sol Reviewed by Codex GPT-5.6-sol label Jul 23, 2026
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>
@kgabryje kgabryje added the ai-reviewed-claude-fable-5 Reviewed by Claude Fable 5 label Jul 23, 2026
kgabryje and others added 3 commits July 23, 2026 16:02
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-reviewed-claude-fable-5 Reviewed by Claude Fable 5 ai-reviewed-gpt-5-6-sol Reviewed by Codex GPT-5.6-sol

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants