Skip to content

fix: correct .roomodes format and add source field support#5

Merged
upamune merged 1 commit into
mainfrom
fix-roomodes-bug
Mar 29, 2025
Merged

fix: correct .roomodes format and add source field support#5
upamune merged 1 commit into
mainfrom
fix-roomodes-bug

Conversation

@upamune

@upamune upamune commented Mar 29, 2025

Copy link
Copy Markdown
Owner

This commit fixes issues with the .roomodes file format by:

  • Restructuring the JSON format to use a "customModes" wrapper object
  • Adding support for the "source" field in mode configurations
  • Properly preserving source field during import/export operations
  • Ensuring consistent handling of source paths in exported modes

These changes maintain compatibility with external tools that expect the .roomodes file to follow the correct format structure.

Copilot AI review requested due to automatic review settings March 29, 2025 12:49
@upamune upamune self-assigned this Mar 29, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR corrects the .roomodes file format and adds support for a new "source" field in mode configurations to improve compatibility with external tools. Key changes include:

  • Adding the "Source" field in metadata and configuration structures.
  • Updating import and export commands to include conditional handling of the "source" field.
  • Adjusting markdown files to demonstrate proper usage in frontmatter.

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/mode/parser.go Added assignment for the "Source" field in the config.
internal/mode/mode.go Updated Metadata and Config types to include the "Source" field.
internal/cmd/import.go Includes logic to add a "source" entry in the frontmatter if present.
internal/cmd/export.go Modifies JSON export structure to output "customModes", adding the "source".
.roo/modes/translate.md Updates frontmatter example to include a "source" field.
.roo/modes/test.md Defines test mode configuration; no "source" field provided.
Files not reviewed (1)
  • .roomodes: Language not supported

Comment thread internal/cmd/export.go Outdated

exportData = append(exportData, ExportedMode{
// Use the source field from the Frontmatter if it exists, otherwise use the file path
source := m.Source

Copilot AI Mar 29, 2025

Copy link

Choose a reason for hiding this comment

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

The comment indicates using the source field from the frontmatter if it exists, otherwise falling back to the file path, but the current code only assigns m.Source. Consider implementing a fallback to m.FilePath when m.Source is empty.

Copilot uses AI. Check for mistakes.
This commit fixes issues with the .roomodes file format by:
- Restructuring the JSON format to use a "customModes" wrapper object
- Adding support for the "source" field in mode configurations
- Properly preserving source field during import/export operations
- Ensuring consistent handling of source paths in exported modes

These changes maintain compatibility with external tools that expect
the .roomodes file to follow the correct format structure.
@upamune upamune merged commit e3211e3 into main Mar 29, 2025
@upamune upamune deleted the fix-roomodes-bug branch March 29, 2025 12:53
@upamune upamune mentioned this pull request Mar 29, 2025
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.

2 participants