xstate-viz icon indicating copy to clipboard operation
xstate-viz copied to clipboard

Feature: Custom State Title/Names (AKA keyText) overriding the unique identified in visualizer

Open Glavin001 opened this issue 2 years ago • 0 comments

See https://github.com/statelyai/xstate/discussions/1641#discussioncomment-4623313 for more context.

Use Case

I want to replace the state's title/name. Also helpful when the original state unique identified is too long (see https://github.com/statelyai/xstate-viz/issues/397 ).

image

Example:

const fetchMachine = createMachine<Context>({
  // ...
  states: {
    theRawId: {
      meta: {
        title: "The Nice Title", // Override theRawId
        description: "# Description\nAllows screenshots:\n![](https://upload.wikimedia.org/wikipedia/commons/thumb/b/bd/Web_Page.png/800px-Web_Page.png)"
      }
    },
  }
});

Glavin001 avatar Jan 08 '23 05:01 Glavin001