Skip to content

feat(@sanity/assist): add hideInstructions option at plugin and field level#671

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/show-translate-only-option
Draft

feat(@sanity/assist): add hideInstructions option at plugin and field level#671
Copilot wants to merge 4 commits intomainfrom
copilot/show-translate-only-option

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 6, 2026

Currently, enabling translate requires exposing the full AI Assist instructions UI ("Manage instructions", instruction items). Users who only want translation have no way to hide instruction management.

Changes

  • AssistPluginConfig.hideInstructions — New plugin-level boolean to globally hide instruction UI
  • options.aiAssist.hideInstructions — New field-level option following the same pattern as exclude and translateAction. Field-level overrides plugin-level.
  • assistFieldActions.tsx — Resolution cascade: fieldOptions?.aiAssist?.hideInstructions ?? config?.hideInstructions ?? false. Hides "Manage instructions" action, instruction items in menus, and the sparkle button on fields with no other actions. Translation, image, and custom actions are unaffected.
  • README — Documents both plugin-level and field-level usage with override examples

Usage

Global — translate only, no instructions anywhere:

assist({
  hideInstructions: true,
  translate: { document: { languageField: 'language' } },
})

Per-field — hide on specific fields, or re-enable when hidden globally:

defineField({
  name: 'subtitle',
  type: 'internationalizedArrayString',
  options: {
    aiAssist: { hideInstructions: true, translateAction: true },
  },
})

// Override: show instructions on this field even when hidden globally
defineField({
  name: 'body',
  type: 'array',
  of: [{ type: 'block' }],
  options: {
    aiAssist: { hideInstructions: false },
  },
})
Original prompt

This section details on the original issue you should resolve

<issue_title>Ability to only show the translate option </issue_title>
<issue_description>Is your feature request related to a problem? Please describe.
Currently, to include the translate option you are required to expose all ai assist prompt fields.

Describe the solution you'd like
I would like to simply be able to show translate only (i.e. not 'Manage Instructions' option)
</issue_description>

<agent_instructions>Do this update in the ai-assist plugin inside this repo. Update the readme on how to do this </agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
plugins-studio Ready Ready Preview, Comment Mar 6, 2026 10:30am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 6, 2026

🦋 Changeset detected

Latest commit: 9e7fc8d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sanity/assist Minor

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

… management UI

Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>
…ning

Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ability to show only translate option feat(@sanity/assist): add hideInstructions option for translate-only mode Mar 6, 2026
…tions.aiAssist.hideInstructions

Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>
Copilot AI changed the title feat(@sanity/assist): add hideInstructions option for translate-only mode feat(@sanity/assist): add hideInstructions option at plugin and field level Mar 6, 2026
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.

Ability to only show the translate option

2 participants