Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 25, 2025

  • Add SVG writing support for relationships in the registration process (models/registration/register.go)
  • Add SVG generation functions for relationships (registry/component.go)
  • Add tests for relationship SVG functionality
  • Remove CreateRelationshipsMetadataAndCreateSVGsForMDXStyle function as only markdown is published (not MDX)
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 and others added 3 commits November 25, 2025 20:57
…eration

Co-authored-by: aabidsofi19 <65964225+aabidsofi19@users.noreply.github.com>
Co-authored-by: aabidsofi19 <65964225+aabidsofi19@users.noreply.github.com>
Co-authored-by: aabidsofi19 <65964225+aabidsofi19@users.noreply.github.com>
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
@marblom007 marblom007 marked this pull request as ready for review December 1, 2025 20:16
@leecalcote
Copy link
Member

@copilot, are these SVGs for Relationships written to filesystem in the fashion (with the same approach taken) as writing out SVGs for models and components?

Copy link
Contributor Author

Copilot AI commented Dec 1, 2025

@copilot, are these SVGs for Relationships written to filesystem in the fashion (with the same approach taken) as writing out SVGs for models and components?

Yes, the relationship SVGs use the exact same WriteAndReplaceSVGWithFileSystemPath function used for models and components. The implementation follows the same pattern:

  • Models (line 77-85): WriteAndReplaceSVGWithFileSystemPath(model.Metadata.SvgColor, ...)
  • Components (line 117-125): WriteAndReplaceSVGWithFileSystemPath(comp.Styles.SvgColor, ...)
  • Relationships (line 152-160): WriteAndReplaceSVGWithFileSystemPath(rel.Metadata.Styles.SvgColor, ...)

All three use the same base directory (rh.svgBaseDir), model name for the directory structure, and entity identifier for the filename.

Copilot finished work on behalf of leecalcote December 1, 2025 20:20
Copilot AI requested a review from leecalcote December 1, 2025 20:20
@leecalcote
Copy link
Member

@copilot, is there no need for a new error code or for a reused error code (see https://docs.meshery.io/project/contributing/contributing-error)?

Copy link
Contributor Author

Copilot AI commented Dec 1, 2025

@copilot, is there no need for a new error code or for a reused error code (see https://docs.meshery.io/project/contributing/contributing-error)?

No new error codes are needed. The relationship SVG writing reuses the existing WriteAndReplaceSVGWithFileSystemPath function in svg_helper.go, which handles errors by logging them with fmt.Println(err) and returning early - the same approach used for models and components. Since no new error handling patterns were introduced, and the existing function's behavior is preserved, no new or reused error codes are required.

Copilot finished work on behalf of leecalcote December 1, 2025 20:45
@aabidsofi19
Copy link
Member

@copilot there is no need for CreateRelationshipsMetadataAndCreateSVGsForMDXStyle as we are publisihing the markdown

…s only markdown is published

Co-authored-by: aabidsofi19 <65964225+aabidsofi19@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 2, 2025

@copilot there is no need for CreateRelationshipsMetadataAndCreateSVGsForMDXStyle as we are publisihing the markdown

Removed CreateRelationshipsMetadataAndCreateSVGsForMDXStyle function and its test. Only the MD style function (CreateRelationshipsMetadataAndCreateSVGsForMDStyle) remains. (7165708)

Copilot finished work on behalf of aabidsofi19 December 2, 2025 10:27
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

3 participants