Conversation
📝 WalkthroughWalkthroughUpdated ChangesEntity selector guidance
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@AGENTS.md`:
- Line 842: Rephrase the instruction in AGENTS.md to say “Memoize the options
array with useMemo,” preserving the existing guidance and meaning.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c867b52c-1e06-4449-8340-d362c327c6ef
📒 Files selected for processing (1)
AGENTS.md
| **Adding a selector for a new entity** — write a thin wrapper, never a new picker. Copy `customerSelector.tsx` (the simplest one) and change only what genuinely differs: the list query, the by-id label resolver, and the label/description fields. The wrapper must: | ||
|
|
||
| 1. Call `useEntitySelectorSearch()` for open/search/debounce state, and pass `skip` to the RTK Query hook — nothing is fetched until the picker opens. | ||
| 2. `useMemo` the `options` array. Multi mode feeds it to react-select as `defaultOptions`, which re-syncs on identity change and will loop if the identity churns. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Rephrase the useMemo instruction.
“useMemo the options array” is grammatically awkward. Use “Memoize the options array with useMemo” for clarity.
🧰 Tools
🪛 LanguageTool
[grammar] ~842-~842: Use a hyphen to join words.
Context: ... 2. useMemo the options array. Multi mode feeds it to react-select as `defaul...
(QB_NEW_EN_HYPHEN)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@AGENTS.md` at line 842, Rephrase the instruction in AGENTS.md to say “Memoize
the options array with useMemo,” preserving the existing guidance and meaning.
Source: Linters/SAST tools
Merge activity
|
## Summary Adds developer guidance to `AGENTS.md` documenting the entity selector pattern, preventing future duplication of ad-hoc entity picker implementations across the UI. ## Changes - Documents the `ui/components/entitySelectors/` directory as the canonical location for all entity pickers, covering available selectors (`virtualKeySelector`, `teamSelector`, `customerSelector`, `userSelector`, `businessUnitSelector`) and their three usage modes (single, multi, add) - Explains the `fallbackOption`/`fallbackOptions` requirement for pre-selected rows to avoid raw UUID rendering before the popover fetches data - Provides a step-by-step checklist for adding a new entity selector wrapper, including correct use of `useEntitySelectorSearch()`, `useMemo` for options stability, `LabelResolver` components, prop typing conventions, pagination defaults, and server-side search requirements - Clarifies the boundary between `entitySelector.tsx` (shared behaviour only) and per-entity wrappers (entity-specific differences) and per-surface props - Documents the OSS vs. enterprise placement rule: enterprise-only selectors live in `bifrost-enterprise/` and are reached from OSS exclusively via runtime registries with empty fallbacks, never via direct imports ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [x] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [x] UI (React) - [x] Docs ## How to test Review `AGENTS.md` to confirm the new section appears under the correct heading and that all code examples and rules are accurate against the existing `ui/components/entitySelectors/` implementations. ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations None. This is documentation only. ## Checklist - [x] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [x] I updated documentation where needed - [x] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable
## Summary Adds developer guidance to `AGENTS.md` documenting the entity selector pattern, preventing future duplication of ad-hoc entity picker implementations across the UI. ## Changes - Documents the `ui/components/entitySelectors/` directory as the canonical location for all entity pickers, covering available selectors (`virtualKeySelector`, `teamSelector`, `customerSelector`, `userSelector`, `businessUnitSelector`) and their three usage modes (single, multi, add) - Explains the `fallbackOption`/`fallbackOptions` requirement for pre-selected rows to avoid raw UUID rendering before the popover fetches data - Provides a step-by-step checklist for adding a new entity selector wrapper, including correct use of `useEntitySelectorSearch()`, `useMemo` for options stability, `LabelResolver` components, prop typing conventions, pagination defaults, and server-side search requirements - Clarifies the boundary between `entitySelector.tsx` (shared behaviour only) and per-entity wrappers (entity-specific differences) and per-surface props - Documents the OSS vs. enterprise placement rule: enterprise-only selectors live in `bifrost-enterprise/` and are reached from OSS exclusively via runtime registries with empty fallbacks, never via direct imports ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [x] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [x] UI (React) - [x] Docs ## How to test Review `AGENTS.md` to confirm the new section appears under the correct heading and that all code examples and rules are accurate against the existing `ui/components/entitySelectors/` implementations. ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations None. This is documentation only. ## Checklist - [x] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [x] I updated documentation where needed - [x] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable

Summary
Adds developer guidance to
AGENTS.mddocumenting the entity selector pattern, preventing future duplication of ad-hoc entity picker implementations across the UI.Changes
ui/components/entitySelectors/directory as the canonical location for all entity pickers, covering available selectors (virtualKeySelector,teamSelector,customerSelector,userSelector,businessUnitSelector) and their three usage modes (single, multi, add)fallbackOption/fallbackOptionsrequirement for pre-selected rows to avoid raw UUID rendering before the popover fetches datauseEntitySelectorSearch(),useMemofor options stability,LabelResolvercomponents, prop typing conventions, pagination defaults, and server-side search requirementsentitySelector.tsx(shared behaviour only) and per-entity wrappers (entity-specific differences) and per-surface propsbifrost-enterprise/and are reached from OSS exclusively via runtime registries with empty fallbacks, never via direct importsType of change
Affected areas
How to test
Review
AGENTS.mdto confirm the new section appears under the correct heading and that all code examples and rules are accurate against the existingui/components/entitySelectors/implementations.Breaking changes
Related issues
Security considerations
None. This is documentation only.
Checklist
docs/contributing/README.mdand followed the guidelines