Skip to content

Implement New Configuration Schema #318

@DarianM

Description

@DarianM

Description

  1. Adapt & abstract the tool store and actions
  • create new Config interface with nested preset structure and all needed types
  • deprecate ElementConfigType imports in favor of the new Config type
  • use PresetId ('a', 'b', 'c') as fixed keys for each preset
  • valtio store to have configuration to use new nested structure (button, widget, banner with presets)
  • save configuration tool action must send one preset on request
  • fetch configuration tool action must work one preset on response
  • separate stores for each tool,
  • Notes:
    - the retrieved tool configuration will be stored using localStorage, each tool in a different key, leaving the valtio store only for UI state updates.
  1. Remix Backend Updates
  • update the save configuration function to handle one preset per tool at a time (based on tool type and preset ID).
  • update Zod schemas for validation to match the new schema.
  • update sanitization for the new properties.
  • update the get configuration method to return a single preset at a time.
    Notes:
    • GET: must return the default configuration if no saved presets exist for a given wallet address.
    • PUT: must receive and save one preset into the bucket based on tool type and preset ID.
  1. Backwards compatibility
  • save all presets in the new format.
  • continue supporting the deprecated configuration type until all frontend components are updated.
  • convert new preset schemas into the deprecated format when fetching, so components relying on the old type continue to work.
  1. Frontend component
  • update all frontend components to consume the new configuration format.
  1. Create font size mapping utilities
  • define semantic font size types BannerFontSize , WidgetFontSize
  • create color and background type definitions TextColor, Background,
  • update the fontSize UI component to replace a and A buttons with min value and max value
  • create semantic-to-pixel mapping functions i.e. for banner and widget font sizes; with default sizes
  • implement reverse mappings for UI components
  • unit testing for all mapping functions

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions