Skip to content

docs: add entity selector guidelines to AGENTS.md - #5635

Merged
akshaydeo merged 7 commits into
devfrom
07-29-feat_adds_instruction_to_agents.md_to_use_these_new_entity_selector_components
Jul 28, 2026
Merged

akshaydeo merged 7 commits into
devfrom
07-29-feat_adds_instruction_to_agents.md_to_use_these_new_entity_selector_components

Conversation

@impoiler

@impoiler impoiler commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

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
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • 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
  • No

Related issues

Security considerations

None. This is documentation only.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updated AGENTS.md with UI guidance requiring shared entity selector components, fallback options for existing records, wrapper implementation practices, server-side search, and OSS-enterprise placement rules.

Changes

Entity selector guidance

Layer / File(s) Summary
Document entity selector conventions
AGENTS.md
Adds requirements for shared entity selectors, fallback options, new wrapper implementations, server-side filtering, label resolution, prop typing, and registry-based OSS access to enterprise selectors.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: akshaydeo

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR does not address Files API support; it only adds entity selector documentation, so it misses the linked issue requirements. Implement the Files API work for POST /v1/files and provider file-upload support for fine-tuning, RAG, and larger context storage.
Out of Scope Changes check ⚠️ Warning The change is unrelated to the Files API objective and consists only of AGENTS.md guidance about entity selectors. Align the PR with issue #123 by adding Files API implementation work instead of unrelated documentation changes.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly matches the main change: adding entity selector guidelines to AGENTS.md.
Description check ✅ Passed The description follows the template well and includes summary, changes, type, affected areas, testing, breaking changes, security, and checklist.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 07-29-feat_adds_instruction_to_agents.md_to_use_these_new_entity_selector_components

Comment @coderabbitai help to get the list of available commands.

@impoiler
impoiler marked this pull request as ready for review July 28, 2026 19:39
@impoiler impoiler self-assigned this Jul 28, 2026
@impoiler impoiler changed the title feat: adds Instruction to agents.md to use these new entity selector components docs: add entity selector guidelines to AGENTS.md Jul 28, 2026
@coderabbitai
coderabbitai Bot requested a review from akshaydeo July 28, 2026 19:40

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6afeaa4 and ccc3dcd.

📒 Files selected for processing (1)
  • AGENTS.md

Comment thread 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 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

akshaydeo commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • Jul 28, 8:46 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 28, 8:56 PM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo
akshaydeo changed the base branch from 07-28-fix_dashboard_rankings_limit_support_frontend_and_docs to graphite-base/5635 July 28, 2026 20:55
@akshaydeo
akshaydeo changed the base branch from graphite-base/5635 to dev July 28, 2026 20:56
@akshaydeo
akshaydeo merged commit e6952b6 into dev Jul 28, 2026
9 checks passed
@akshaydeo
akshaydeo deleted the 07-29-feat_adds_instruction_to_agents.md_to_use_these_new_entity_selector_components branch July 28, 2026 20:56
akhsaul pushed a commit to akhsaul/bifrost that referenced this pull request Aug 27, 2026
## 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
occcat pushed a commit to occcat/bifrost that referenced this pull request Sep 2, 2026
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants