Skip to content

Conversation

@codegen-sh
Copy link
Contributor

@codegen-sh codegen-sh bot commented Jul 28, 2025

Summary

Updated the FormError placement guidance in llms.txt to recommend placing form-level errors below inputs and above the submit button as the most common pattern, rather than at the top of the form.

Changes Made

  • Updated login form example: Moved FormError from top of form to below inputs and above submit button
  • Updated placement options section: Changed "Top of form (most common)" to "Below inputs, above submit button (most common)"
  • Updated placement strategy: Added clear guidance that below inputs/above submit is the most common placement
  • Updated comprehensive form example: Replaced manual error display with FormError component in correct position
  • Added clarifying comment: Added note in FormError component usage section about typical placement

Rationale

This change aligns with typical UX patterns where:

  • Users complete form fields first
  • Form-level errors are shown after field completion but before submission
  • Users can see errors in context before deciding to submit
  • The error placement feels natural in the form flow

The guidance now shows that FormError can be placed anywhere in the form, but the most common and recommended pattern is below inputs and above the submit button.


Request from Jake Ruesink: Update form error placement guidance to reflect typical UX patterns


💻 View my work🚫 Ban all checksAbout Codegen

Summary by CodeRabbit

  • Documentation
    • Clarified the recommended placement of the FormError component within forms.
    • Updated usage examples to consistently show FormError below inputs and above the submit button.
    • Removed redundant manual error rendering in examples for a simpler, unified approach.
    • Revised guidance and placement strategy to emphasize typical and critical error placements.

…submit button

- Updated login form example to show FormError below inputs and above submit button
- Changed placement options to show 'below inputs, above submit button' as most common
- Updated placement strategy section to reflect new guidance
- Updated comprehensive form example to use FormError component consistently
- Added clarifying comment in FormError component usage section

This aligns with typical UX patterns where users see form-level errors after completing fields but before submitting.
@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai
Copy link

coderabbitai bot commented Jul 28, 2025

Walkthrough

The documentation for the FormError component was revised to clarify and standardize its recommended placement within forms. Example usages were updated to place FormError below inputs and above the submit button, removing redundant manual error handling. The guidance on placement options was reorganized and simplified for consistency.

Changes

Cohort / File(s) Change Summary
FormError Documentation & Examples
llms.txt
Updated documentation and examples to recommend placing FormError below inputs and above the submit button; removed redundant manual error rendering; revised placement strategy section and example ordering.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Possibly related PRs

Poem

Beneath the fields, above the send,
FormError finds its perfect blend.
No more errors shown by hand—
Just one clear spot, as we had planned.
With guidance neat and clutter gone,
Our forms now guide the user on!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ebbc14 and 77c81c2.

📒 Files selected for processing (1)
  • llms.txt (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • llms.txt
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codegen-bot/update-form-error-placement-guidance-1753717445

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 28, 2025

📝 Storybook Preview: View Storybook

This preview will be updated automatically when you push new changes to this PR.

Note: The preview will be available after the workflow completes and the PR is approved for deployment.

@jaruesink
Copy link
Contributor

jaruesink commented Jul 28, 2025

@codegen-sh you're too verbose on saying where the formerror component should be, no need to be that redundant. remove some of those comments and keep just one

I'll simplify the comments and keep just one! ✂️

💻 View my work🛑 Stop

Removed redundant comments about FormError placement and kept just one clear comment in the comprehensive example.
@codegen-sh
Copy link
Contributor Author

codegen-sh bot commented Jul 28, 2025

✂️ Done! I've simplified the FormError placement comments and removed the redundancy. Now there's just one clear comment in the comprehensive example that shows where form-level errors typically appear.

🔄 View Updated PR #109 🔄

The guidance is still clear but much cleaner now! 🎯

💻 View my work🛑 Stop • React 👍 or 👎

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
llms.txt (4)

25-26: Nit: end the inline comment with a period and keep wording consistent

Comment style in the rest of the guide uses full sentences with terminal punctuation. Adding a period and the definite article improves consistency.

-// Typically placed below inputs and above submit button
+// Typically placed below inputs and above the submit button.

156-158: Consider trimming repeated placement guidance in code examples

The same explanatory comment appears multiple times across examples. To avoid visual noise, keep the detailed guidance in one place (e.g., the “Placement Strategy” section) and shorten these in-line comments to something like // Form-level error.
This makes the snippets easier to scan while still demonstrating correct placement.


997-999: Duplicate explanatory comment

Same note as above—this comment duplicates earlier guidance. A shorter annotation (or none at all) keeps the comprehensive example focused on code structure rather than repeating prose.


1212-1216: Clarify when users actually see form-level errors

“Users see errors after completing form fields but before submitting” is misleading—form-level errors are typically surfaced after submit. Consider rephrasing:

-**Below inputs, above submit button**: Most common placement - users see errors after completing form fields but before submitting
+**Below inputs, above the submit button**: Recommended placement – errors appear in natural reading order immediately after fields when the form is re-rendered following submission.

This removes the timing confusion while reinforcing the placement rationale.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7b19561 and 5ebbc14.

📒 Files selected for processing (1)
  • llms.txt (5 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Always display field-level errors using FormMessage
Learnt from: jaruesink
PR: lambda-curry/forms#108
File: llms.txt:578-579
Timestamp: 2025-07-27T21:10:38.958Z
Learning: The @lambdacurry/forms package exports components at the top level, so `import { FormError, TextField } from '@lambdacurry/forms'` is the correct and preferred import pattern, not component-specific entry points.
Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Provide clear, user-friendly error messages in validation
Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Handle both client-side and server-side validation errors in form components
Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Provide clear error announcements for screen readers
Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Clear errors appropriately when fields are corrected
Learnt from: jaruesink
PR: lambda-curry/forms#108
File: llms.txt:94-96
Timestamp: 2025-07-27T21:08:37.677Z
Learning: For the @lambdacurry/forms repository, use top-level imports for ease of implementation rather than specific entry points. Example: `import { TextField, Checkbox, FormError } from '@lambdacurry/forms';` is preferred over individual module imports. This prioritizes developer experience and implementation simplicity.
Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Maintain FormField consistency for all form inputs
Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/*.{tsx,ts} : Form-aware components should be named as ComponentName (e.g., TextField, Checkbox)
Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Ensure proper accessibility and validation integration in form components
llms.txt (19)

Learnt from: jaruesink
PR: #108
File: llms.txt:578-579
Timestamp: 2025-07-27T21:10:38.958Z
Learning: The @lambdacurry/forms package exports components at the top level, so import { FormError, TextField } from '@lambdacurry/forms' is the correct and preferred import pattern, not component-specific entry points.

Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Always display field-level errors using FormMessage

Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/monorepo-organization.mdc:0-0
Timestamp: 2025-07-23T12:47:17.244Z
Learning: Document breaking changes in changelogs

Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Provide clear error announcements for screen readers

Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Provide clear, user-friendly error messages in validation

Learnt from: jaruesink
PR: #108
File: llms.txt:94-96
Timestamp: 2025-07-27T21:08:37.677Z
Learning: For the @lambdacurry/forms repository, use top-level imports for ease of implementation rather than specific entry points. Example: import { TextField, Checkbox, FormError } from '@lambdacurry/forms'; is preferred over individual module imports. This prioritizes developer experience and implementation simplicity.

Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Clear errors appropriately when fields are corrected

Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Handle both client-side and server-side validation errors in form components

Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/*.{tsx,ts} : Form-aware components should be named as ComponentName (e.g., TextField, Checkbox)

Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Ensure proper accessibility and validation integration in form components

Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Always define Zod schemas with proper error messages for form validation

Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Maintain FormField consistency for all form inputs

Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Use remix-hook-form for form state management and validation

Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/storybook-testing.mdc:0-0
Timestamp: 2025-07-23T12:48:03.192Z
Learning: Applies to apps/docs/src/remix-hook-form/*.stories.tsx : Never use regular <form> elements; always use fetcher.Form for form submissions in stories using React Router stub.

Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Provide loading states during form submission

Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Validate on blur and submit, not on every keystroke

Learnt from: jaruesink
PR: #107
File: llms.txt:63-69
Timestamp: 2025-07-27T05:56:41.373Z
Learning: In remix-hook-form, handleSubmit can be passed directly to the onSubmit prop (e.g., onSubmit={handleSubmit}) without requiring callback functions, unlike standard react-hook-form where handleSubmit is a higher-order function that requires onValid/onInvalid callbacks.

Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Follow the wrapper component pattern for all form-aware components

Learnt from: CR
PR: lambda-curry/forms#0
File: .cursor/rules/form-component-patterns.mdc:0-0
Timestamp: 2025-07-23T12:46:51.780Z
Learning: Applies to packages/components/src/remix-hook-form/**/*.tsx : Use the form setup pattern for form initialization in Remix

Comment on lines +1144 to 1152
// Below inputs, above submit button (most common)
<FormError className="mb-4" />

// Between sections
<FormError className="my-4 text-center" />

// Bottom of form
<FormError className="mt-4" />
// Top of form (for critical errors that need immediate attention)
<FormError className="mb-4" />

Copy link

@coderabbitai coderabbitai bot Jul 28, 2025

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Snippet ordering conflicts with the new recommendation

The snippet still lists “Top of form” immediately after the “most common” placement, which may imply equal priority. To reinforce the updated guidance, consider:

  1. Keeping only the recommended placement in the first snippet,
  2. Moving the “Top of form” variant into a separate sub-heading, or
  3. Prefacing it with a cautionary comment (e.g., // Use sparingly for critical errors).

This prevents readers from assuming both options are equally preferred.

🤖 Prompt for AI Agents
In llms.txt around lines 1144 to 1152, the ordering of FormError placement
snippets suggests equal priority for "Top of form" and "most common" placements,
which conflicts with updated guidance. To fix this, keep only the recommended
"most common" placement snippet first, then move the "Top of form" variant under
a separate sub-heading or add a cautionary comment indicating it should be used
sparingly for critical errors, clarifying the intended priority and usage.

Copy link
Contributor

Choose a reason for hiding this comment

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

@codegen-sh let's implement this suggestion

Copy link

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it! I'll implement this suggestion 🚀

💻 View my work🛑 Stop

Copy link
Contributor Author

Choose a reason for hiding this comment

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

✅ That suggestion is already implemented! The FormError Placement Options section in the PR already shows:

  • "Below inputs, above submit button (most common)"
  • "Top of form (for critical errors that need immediate attention)"

The diff you highlighted matches exactly what's currently in PR #109. The guidance now correctly reflects the typical UX pattern you wanted! 🎯

💻 View my work🛑 Stop • React 👍 or 👎

@jaruesink jaruesink merged commit 42a91f8 into main Jul 28, 2025
5 checks passed
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