Skip to content

feat(types): add custom properties on EditorOptions#3761

Open
TotomInc wants to merge 1 commit intonuxt:mainfrom
TotomInc:feat/content-editor-properties
Open

feat(types): add custom properties on EditorOptions#3761
TotomInc wants to merge 1 commit intonuxt:mainfrom
TotomInc:feat/content-editor-properties

Conversation

@TotomInc
Copy link
Copy Markdown

@TotomInc TotomInc commented Apr 7, 2026

🔗 Linked issue

Nuxt-Studio upstream: nuxt-content/nuxt-studio#400

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

In order to improve Nuxt Studio UI, we need to expose more properties in the Zod schema, from EditorOptions type.

These added properties will allow Nuxt Studio UI to improve the editing experience of content-editors.

For this PR:

  • fieldName: when defined, override the auto-generated field-name on the Nuxt Studio field
  • fieldDescription: when defined, use Nuxt UI FormField description prop to display an extra text under the field name
  • tooltip: when defined, display an info-bubble next to the field-name with the tooltip as text content

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 7, 2026

@TotomInc is attempting to deploy a commit to the Nuxt Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 7, 2026

npm i https://pkg.pr.new/@nuxt/content@3761

commit: c4ca6a1

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

This pull request extends the EditorOptions interface with three new optional string properties: fieldName to customize the display name of a Studio field, fieldDescription to add supporting text under the field name, and tooltip to display an info-bubble beside the field name. The type definition in src/types/schema.ts is updated with these three optional properties, and corresponding documentation is added to the changelog file.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding custom properties to the EditorOptions type.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about the purpose and individual properties being added to EditorOptions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

Copy link
Copy Markdown

@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.

🧹 Nitpick comments (2)
src/types/schema.ts (1)

54-54: Consider clarifying the fieldDescription comment.

The comment "When defined, set a description for the field" could be more specific about where the description appears. The documentation states it displays "under the field name," which provides clearer context for developers.

💬 Suggested comment improvement
-  fieldDescription?: string // When defined, set a description for the field
+  fieldDescription?: string // When defined, displays description text under the field name
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/types/schema.ts` at line 54, Update the comment for the fieldDescription
property in src/types/schema.ts to clarify where the description appears;
replace "When defined, set a description for the field" with a more specific
note such as "Optional description displayed under the field name in the UI" so
developers know this text appears beneath the field label; locate the
fieldDescription declaration in the schema.ts type definition to apply the
change.
docs/content/changelog/studio-customisation.md (1)

115-117: Clarify the fieldName documentation.

The phrase "editor input name" is somewhat vague. Consider aligning with the code comment which more clearly states this "overrides the auto-generated field name." Suggest rewording to: "Overrides the auto-generated field name in Studio editor with a custom display name."

📝 Suggested documentation improvement
-You can set the editor input name in Studio editor.
+Overrides the auto-generated field name in Studio editor with a custom display name.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/content/changelog/studio-customisation.md` around lines 115 - 117,
Update the docs for the `fieldName: String` property to be explicit: replace the
vague "You can set the editor input name in Studio editor." with a sentence like
"Overrides the auto-generated field name in the Studio editor with a custom
display name." Make sure the wording references the same symbol `fieldName:
String` and mentions the Studio editor so readers can map it back to the code
comment about overriding the auto-generated field name.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/content/changelog/studio-customisation.md`:
- Around line 115-117: Update the docs for the `fieldName: String` property to
be explicit: replace the vague "You can set the editor input name in Studio
editor." with a sentence like "Overrides the auto-generated field name in the
Studio editor with a custom display name." Make sure the wording references the
same symbol `fieldName: String` and mentions the Studio editor so readers can
map it back to the code comment about overriding the auto-generated field name.

In `@src/types/schema.ts`:
- Line 54: Update the comment for the fieldDescription property in
src/types/schema.ts to clarify where the description appears; replace "When
defined, set a description for the field" with a more specific note such as
"Optional description displayed under the field name in the UI" so developers
know this text appears beneath the field label; locate the fieldDescription
declaration in the schema.ts type definition to apply the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 23253ee9-9a48-44ad-a500-0651c033820e

📥 Commits

Reviewing files that changed from the base of the PR and between 06c84f5 and c4ca6a1.

📒 Files selected for processing (2)
  • docs/content/changelog/studio-customisation.md
  • src/types/schema.ts

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.

1 participant