Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 25, 2025

Description

This PR fixes #837

Adds support for writing SVGs to disk when registering/generating relationships, mirroring existing component behavior.

Changes:

  • Registration (models/registration/register.go): Write relationship SVGs (SvgColor, SvgWhite, SvgComplete) to disk and replace inline data with file paths, consistent with model/component handling
  • Generation (registry/component.go):
    • CreateRelationshipsMetadataAndCreateSVGsForMDXStyle() - MDX docs
    • CreateRelationshipsMetadataAndCreateSVGsForMDStyle() - MD docs
    • getSVGForRelationship() - Extract SVGs from styles JSON with model fallback
  • Tests: Coverage for SVG extraction, file creation, and model fallback scenarios

Example usage:

// Relationship SVGs now written during registration
if rel.Metadata != nil && rel.Metadata.Styles != nil {
    rel.Metadata.Styles.SvgColor, rel.Metadata.Styles.SvgWhite, svgCompletePath = 
        WriteAndReplaceSVGWithFileSystemPath(...)
}

Notes for Reviewers

Pre-existing build issue in github.com/meshery/schemas dependency (design_conversion.go:176 type mismatch) prevents full test execution. Unrelated to this PR.

Signed commits

  • Yes, I signed my commits.
Original prompt

This section details on the original issue you should resolve

<issue_title>Add support for writing svgs to disk when registering / generating relationships similar to components</issue_title>
<issue_description>### Current Behavior

Desired Behavior

Implementation

Acceptance Tests

Mockups


Contributor Guides and Handbook

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


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add support for writing SVGs to disk for relationships [registry] Add SVG writing support for relationships during registration and generation Nov 25, 2025
Copilot AI requested a review from aabidsofi19 November 25, 2025 21:08
Copilot finished work on behalf of aabidsofi19 November 25, 2025 21:08
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.

Add support for writing svgs to disk when registering / generating relationships similar to components

2 participants