feat(CoCreationForm): add entity-select question type#3399
Draft
feat(CoCreationForm): add entity-select question type#3399
Conversation
Add new "entity-select" and "entity-select-multi" question types to CoCreationForm using EntitySelect component. In edit mode, shows a placeholder preview. In answer mode, renders a full entity selector with search, avatars, and single/multi selection. Entities are provided by the consuming application via props. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
✅ No New Circular DependenciesNo new circular dependencies detected. Current count: 0 |
Contributor
📦 Alpha Package Version PublishedUse Use |
Contributor
🔍 Visual review for your branch is published 🔍Here are the links to: |
Contributor
Coverage Report for packages/react
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
entity-select(single) andentity-select-multiquestion types to CoCreationFormEntitySelectcomponent with search, avatars, and selectionDesign decisions
The entity selector is fundamentally different from other question types because:
entitiesand optionallyonLoadEntitieswhen renderingThis means in the schema/JSON the AI manipulates, an entity-select question is simply:
{ "type": "entity-select", "label": "Project manager", "id": "q1" }No options array needed. The frontend wires in the employee data at render time.
Changes
New files
EntitySelectQuestion/index.tsx— component with edit placeholder + EntitySelect in answer modeEntitySelectQuestion/types.ts— props includingentities,groups,onLoadEntitiesEntitySelectQuestion/index.stories.tsx— 3 stories with mock employeesModified files
types.ts— addedentity-selectandentity-select-multito typesQuestion/index.tsx— added switch casesconstants.ts— added to "Add question" menu withPersoniconlib.ts— added defaultsi18n-provider-defaults.ts— added translationsTest plan
CoCreationForm/EntitySelectQuestionpnpm tsc)🤖 Generated with Claude Code