Skip to content

chore: extract shared factory for notification diagram configs #363

@elfensky

Description

@elfensky

Source: desloppify review (abstraction_fitness)

Problem

Three diagram config files (inAppFlowConfig.js, notificationFlowConfig.js, pushFlowConfig.js in src/app/docs/notifications/) repeat the same {views, flows, legend, title, description, details} shape with no shared schema or factory. Adding a new field requires editing all three files.

Similarly, three definition files (*Definition.js) repeat identical DEFINITION_LR = 'graph LR\n' + BODY / DEFINITION_TD export patterns.

Fix

  1. Extract a createFlowConfig(options) factory or a @typedef for the config shape
  2. Extract a buildMermaidDefinition(body) helper for the LR/TD assembly

Files

  • src/app/docs/notifications/inAppFlowConfig.js
  • src/app/docs/notifications/notificationFlowConfig.js
  • src/app/docs/notifications/pushFlowConfig.js
  • src/app/docs/notifications/inAppFlowDefinition.js
  • src/app/docs/notifications/notificationFlowDefinition.js
  • src/app/docs/notifications/pushFlowDefinition.js

Impact

Low — docs-only code, no runtime effect. Reduces maintenance surface for diagram additions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    choreMaintenance, cleanup, refactoring

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions