Add knowledge for frontend forms and profiles#8393
Add knowledge for frontend forms and profiles#8393pa-lem wants to merge 2 commits intorelease-1.8from
Conversation
WalkthroughThis pull request updates frontend documentation files. The primary change adds a new "Forms with Profiles" section to the object-forms guidelines, introducing profile-based forms, *WithProfileForm wrapper patterns, ProfileData type extensions, profile selection mechanics, value inheritance, form submission handling, and best practices with code examples. A secondary change updates a reference in AGENTS.md from forms.md to object-forms.md, with revised description text mentioning focus management for react-hook-form patterns. 🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@dev/guidelines/frontend/object-forms.md`:
- Around line 218-223: Update the "Value Inheritance" section to explicitly
state how profile_priority is compared: specify that profiles with a higher
numeric profile_priority take precedence (i.e., larger value wins) when multiple
profiles provide the same field, and define the deterministic tie-breaker (e.g.,
the later profile in the selection list wins) so implementations of the Value
Inheritance behavior and fields using profile_priority are unambiguous.
| 2. **Value Inheritance** - When profiles are selected: | ||
| - Form fields check for values in the selected profiles | ||
| - Profile values populate as defaults with `source: { type: "profile", id, kind, label }` | ||
| - User can override profile values (changes source to `"user"`) | ||
| - Priority order determines which profile wins if multiple provide same field | ||
|
|
There was a problem hiding this comment.
Clarify profile priority ordering to avoid ambiguous inheritance.
The doc states priority determines which profile wins but doesn’t specify whether higher or lower profile_priority takes precedence. Please add a sentence defining the ordering to prevent inconsistent implementations.
✍️ Suggested doc tweak
- - Priority order determines which profile wins if multiple provide same field
+ - Priority order determines which profile wins if multiple provide same field (e.g., higher `profile_priority` wins)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| 2. **Value Inheritance** - When profiles are selected: | |
| - Form fields check for values in the selected profiles | |
| - Profile values populate as defaults with `source: { type: "profile", id, kind, label }` | |
| - User can override profile values (changes source to `"user"`) | |
| - Priority order determines which profile wins if multiple provide same field | |
| 2. **Value Inheritance** - When profiles are selected: | |
| - Form fields check for values in the selected profiles | |
| - Profile values populate as defaults with `source: { type: "profile", id, kind, label }` | |
| - User can override profile values (changes source to `"user"`) | |
| - Priority order determines which profile wins if multiple provide same field (e.g., higher `profile_priority` wins) | |
🤖 Prompt for AI Agents
In `@dev/guidelines/frontend/object-forms.md` around lines 218 - 223, Update the
"Value Inheritance" section to explicitly state how profile_priority is
compared: specify that profiles with a higher numeric profile_priority take
precedence (i.e., larger value wins) when multiple profiles provide the same
field, and define the deterministic tie-breaker (e.g., the later profile in the
selection list wins) so implementations of the Value Inheritance behavior and
fields using profile_priority are unambiguous.
Summary by CodeRabbit
Documentation