Skip to content

render-mermaid: schema-agnostic styles and safe field access #69

@mindsocket

Description

@mindsocket

The built-in mermaid renderer has two issues that limit its usefulness across different schemas:

Hardcoded type and status styles
classDef entries are emitted for a fixed set of type names (vision, mission, goal, opportunity, solution) and status values (identified, wondering, etc.). These are specific to one schema and produce no visible effect for spaces using different type hierarchies.

Instead, derive styles from the hierarchy levels available via PluginContext. .

Unsafe status field access

const status = node.schemaData.status as string;

Schemas without a status field will produce class names like goal_undefined. Remove this styling.

A future improvement may allow exposing a style map in the plugin config schema to better support customisation of both of these

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions