Skip to content

fix: remove color palette from unsupported diagrams#61

Open
priyanshu88064 wants to merge 2 commits intoFantastic-Computing-Machine:masterfrom
priyanshu88064:remove_colorpalette_from_unsupported_diagrams
Open

fix: remove color palette from unsupported diagrams#61
priyanshu88064 wants to merge 2 commits intoFantastic-Computing-Machine:masterfrom
priyanshu88064:remove_colorpalette_from_unsupported_diagrams

Conversation

@priyanshu88064
Copy link
Copy Markdown

What changes were made

  • Diagram-Aware Node Detection: Updated [getNodeIdFromLine] to use regular expression based on the diagramType.
  • Support-Based Palette UI: Introduced SUPPORTED_COLOR_DIAGRAMS to restrict the color palette UI to diagram types that support standard style NODE fill:#color syntax.
  • Append-Only Style Management: Updated upsertNodeStyleLine to append new style directives to the end of the file instead of inserting them immediately after node definitions.

Why the changes were needed

  • Fix ER Diagram Bug: Fixed an issue where the relationship separator (:) was misidentified as a node ID in ER diagrams.
  • Prevent Invalid Syntax: Diagram types like Sequence Diagrams do not support standard style blocks hiding the palette for these types.
  • Preserve Block Structures: For diagrams with block-based definitions (like class Auth { ... }), inserting styles mid-file could break the block structure. Appending to the end of the file ensures the Mermaid syntax remains valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant