Skip to content

fix(FieldGroup): add defaultVariants in theme - #6938

Merged
benjamincanac merged 2 commits into
nuxt:v4from
dvd233:fix/field-group-default-variants-6936
Sep 21, 2026
Merged

benjamincanac merged 2 commits into
nuxt:v4from
dvd233:fix/field-group-default-variants-6936

Conversation

@dvd233

@dvd233 dvd233 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

🔗 Linked issue

Resolves #6936

❓ Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)

📚 Description

fieldGroup exposes size and orientation variants but omitted defaultVariants. Since the app.config.ui override type is derived from the theme, app.config.ui.fieldGroup.defaultVariants was rejected by TypeScript as an excess property.

This adds the component's existing defaults (size: 'md', orientation: 'horizontal') and a type regression check for the app-config override shape.

Local verification:

  • pnpm lint
  • pnpm typecheck
  • pnpm test -- --run (7,386 passed, 6 skipped)

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly. (Not required; this restores the missing theme shape.)

@github-actions github-actions Bot added the v4 #4488 label Sep 13, 2026
@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: a3c3f24c-2367-4291-badf-145c18cfb30a

📥 Commits

Reviewing files that changed from the base of the PR and between c98f5af and 61c81ca.

📒 Files selected for processing (1)
  • src/theme/field-group.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The field-group theme now declares default variants of size: 'md' and orientation: 'horizontal'. The test suite adds a typed app configuration with size: 'lg' and orientation: 'vertical', then verifies these values.

Priority: ➖ Normal

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

Severity of issue fixed: Medium

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Issue #6936 requires fieldGroup.defaultVariants and preservation of size: 'md' and orientation: 'horizontal'. The PR adds defaultVariants.size = 'md' in src/theme/field-group.ts, but `defaul… Add orientation: 'horizontal' to src/theme/field-group.ts under defaultVariants. Add or update a type regression test that configures fieldGroup.defaultVariants with both defaults.
✅ Passed checks (4 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The reviewed change is limited to the fieldGroup theme default variants. The related test file is unchanged in the whole-PR diff. No unrelated change is shown.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Title check ✅ Passed The title clearly identifies the main change: adding defaultVariants to the FieldGroup theme.
Description check ✅ Passed The description directly explains the FieldGroup defaultVariants fix, the TypeScript issue, the regression check, and verification results.
Full details: Linked Issues check

Explanation

Issue #6936 requires fieldGroup.defaultVariants and preservation of size: 'md' and orientation: 'horizontal'. The PR adds defaultVariants.size = 'md' in src/theme/field-group.ts, but defaultVariants.orientation is absent. The reviewed diff also contains no fieldGroup-specific type regression check. The existing test covers formField, not fieldGroup.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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

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

@codspeed

codspeed Bot commented Sep 13, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing dvd233:fix/field-group-default-variants-6936 (61c81ca) with v4 (187c34f)

Open in CodSpeed

@pkg-pr-new

pkg-pr-new Bot commented Sep 13, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@nuxt/ui@6938

commit: 61c81ca

@benjamincanac benjamincanac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR! I pushed a small change to remove orientation from defaultVariants, we don't do it in any theme since it comes from withDefaults. size alone is enough for TVConfig to accept both in app.config.ts.

The actual cause is TVConfig only accepting defaultVariants when the theme declares one, which affects other themes too (modal, drawer, carousel...). It's already fixed in the types on v5 in #6975 so I'd rather keep the v4 change minimal 😊

@benjamincanac benjamincanac changed the title fix(FieldGroup): add default theme variants fix(FieldGroup): add missing defaultVariants in theme Sep 21, 2026
@benjamincanac benjamincanac changed the title fix(FieldGroup): add missing defaultVariants in theme fix(FieldGroup): add defaultVariants in theme Sep 21, 2026
@benjamincanac
benjamincanac merged commit 0317d50 into nuxt:v4 Sep 21, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fieldGroup theme is missing defaultVariants, causing a TypeScript error when setting it in app.config.ts

2 participants