fix(create): associate the React Form demo text field with its label #559
main fromrefs/pull/559/head·merged by tannerlinsley Builds on #444 from @Konijnebeer.
Clicking the Title label now focuses the generated React Form demo input. The shadcn variant gives each instance a React-generated ID, so the association still works when labels repeat or contain spaces. The plain variant uses its existing wrapping label without a dangling explicit reference.
The blocking Chrome smoke test now looks up the textbox by its accessible name and checks that clicking the label focuses it.
Checks#
- The normal hook passed all 10 builds, 558 unit tests, and eight blocking Chrome tests.
- Fresh generated apps outside the monorepo confirmed the original shadcn label failure and the corrected plain label behavior. The plain app also passed its build and typecheck.
Summary by CodeRabbit#
- Bug Fixes
- In generated React Form demos with shadcn enabled, the Title label is now associated with its text field. Clicking the label focuses the field, and the association works with a generated identifier rather than relying on the label text.
- The form smoke test now checks that the Title field is visible and receives focus when its label is clicked.
- 1
No actionable comments were generated in the recent review.
Walkthrough
-
The React Form demo template changes how its text field label associates with the input. The end-to-end smoke test checks that clicking the
Titletext focuses the visibleTitletextbox. A patch changeset records the update.Changes: React Form demo label association
Layer / File(s) Summary Update label association and verify interaction
packages/create/src/frameworks/react/add-ons/form/assets/src/components/demo.FormComponents.tsx.ejs,packages/cli/tests-e2e/addons-smoke.spec.ts,.changeset/form-demo-label.mdThe shadcn-enabled TextFielduses a generated ID for the label’shtmlForand the input’sid. The non-shadcn label no longer setshtmlFor. The smoke test checks that clicking the exactTitletext focuses the visibleTitletextbox. A patch changeset records the update.Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Merge Risk:
Minimal · up tof2a7b-
The generated demo now associates the label with the textbox in both variants, with focused end-to-end coverage.
Pre-merge checks:
5-
Check name Status Explanation Description Check Check skipped - CodeRabbit’s high-level summary is enabled. Title check The title names the primary change: the React Form demo text field is now associated with its label. The raw summary confirms the changeset, the e2e smoke test update, and the template change that add… Docstring Coverage No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Full details: Title check
-
Explanation
The title names the primary change: the React Form demo text field is now associated with its label. The raw summary confirms the changeset, the e2e smoke test update, and the template change that adds a generated ID for the shadcn branch and removes the reference in the plain branch all serve that goal. The title uses the conventional fix(create) prefix and does not describe anything absent from the changeset.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (2 skipped: 2 unsupported.)
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
ESLint-
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
packages/cli/tests-e2e/addons-smoke.spec.ts
-
Parsing error: "parserOptions.project" has been provided for
@typescript-eslint/parser. The file was not found in any of the provided project(s): packages/cli/tests-e2e/addons-smoke.spec.ts
-
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.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
878972f8-bbd6-4a3f-8b0d-6a98a56deb2f
Commits-
Reviewing files that changed from the base of the PR and between 2690587e5220c55147f5d13bc4a73ef10d354544 and f2a7bf62c06f4d082695dd0952c7c863eb6d2730.
Files selected for processing: 3-
.changeset/form-demo-label.mdpackages/cli/tests-e2e/addons-smoke.spec.tspackages/create/src/frameworks/react/add-ons/form/assets/src/components/demo.FormComponents.tsx.ejs
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
-
tannerlinsley merged this9fe6af8
tannerlinsley closed this
Sign in to join this conversation.
🦋 Changeset detected#
Latest commit: f2a7bf62c06f4d082695dd0952c7c863eb6d2730
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR