Skip to content

Conversation

@mrubens
Copy link
Collaborator

@mrubens mrubens commented Feb 14, 2025

Got a bug report that it was possible to create a mode from the UI without a role definition, causing the json to fail validation. This validates it on save.

Screenshot 2025-02-14 at 8 44 00 AM


Important

Adds validation for custom mode creation in the UI to ensure role definitions are included, with error handling and schema updates.

  • Behavior:
    • Validates custom mode schema on save in PromptsView.tsx to ensure role definitions are present.
    • Displays field-specific error messages for name, slug, roleDefinition, and groups.
  • Schema:
    • Removes minimum group requirement from GroupsArraySchema in CustomModesSchema.ts.
  • Tests:
    • Removes tests for empty group array validation in CustomModesSchema.test.ts and GroupConfigSchema.test.ts.
    • Updates ClineProvider.test.ts to reflect changes in custom modes handling.
  • Misc:
    • Adds --color-vscode-errorForeground to index.css for error message styling.

This description was created by Ellipsis for 5c9fea9. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Feb 14, 2025

⚠️ No Changeset found

Latest commit: 5c9fea9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This isn't necessary

@mrubens mrubens force-pushed the new_mode_role_validation branch from d1c5ba2 to 7bbf097 Compare February 14, 2025 13:54
@mrubens mrubens force-pushed the new_mode_role_validation branch from 1e68e2f to 7bbf097 Compare February 14, 2025 14:01
@mrubens mrubens force-pushed the new_mode_role_validation branch from 0e5a47b to 5c9fea9 Compare February 14, 2025 14:10
@mrubens mrubens merged commit c815ea7 into main Feb 14, 2025
6 checks passed
@mrubens mrubens deleted the new_mode_role_validation branch February 14, 2025 14:14
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.

3 participants