Skip to content
Source
Sign inSign up
TanStack/cli

fix(create): associate the React Form demo text field with its label #559

Mergedtannerlinsleymerged 1 commit intomain fromrefs/pull/559/headmerged by tannerlinsley

tannerlinsleycommented

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. 🦋 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
      NameType
      @tanstack/createPatch
      create-start-appPatch
      create-tanstack-appPatch
      create-tanstackPatch
      create-tsrouter-appPatch
      @tanstack/create-startPatch
      @tanstack/cliPatch

      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

    2. Explain Change →

      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 Title text focuses the visible Title textbox. 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.md
      The shadcn-enabled TextField uses a generated ID for the label’s htmlFor and the input’s id. The non-shadcn label no longer sets htmlFor. The smoke test checks that clicking the exact Title text focuses the visible Title textbox. A patch changeset records the update.

      Estimated code review effort: 2 (Simple) | ~8 minutes

      Change: Bug fix

      Merge Risk: Minimal · up to f2a7b

      The generated demo now associates the label with the textbox in both variants, with focused end-to-end coverage.

      Pre-merge checks: Passed 5
      Check nameStatusExplanation
      Description CheckPassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      Title checkPassedThe 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 CoveragePassedNo 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 checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck 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.

      Share
      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.md
      • packages/cli/tests-e2e/addons-smoke.spec.ts
      • packages/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.

    3. tannerlinsley merged this9fe6af8

    4. tannerlinsley closed this

Sign in to join this conversation.