Skip to content

Derive button placement paths and name-to-feature mappings from metadata registry #1349

Description

@VampireChicken12

Summary

The buttonNameToSettingName lookup object, buttonNames array, featureToMultiButtonsMap, and hardcoded switch statements in ButtonPlacement.tsx/ButtonPlacementSetting.tsx all duplicate knowledge that now exists declaratively in feature metadata (button field).

Changes Needed

  1. Add button maps (buttonNameToFeature, featureToButtonNames) to FeatureMetadataRegistry
  2. Add getter methods: getButtonFeature(), getAllButtonNames(), getButtonNamesForFeature(), getButtonConfigPath()
  3. Replace @/src/types const imports with registry calls in 5 files (ButtonPlacement.tsx, ButtonPlacementSetting.tsx, utils/settings/index.ts, features/buttonPlacement/index.ts, utils/feature/index.ts)
  4. Eliminate hardcoded switch statements in path-derivation functions

Status

Implementation is complete — 22 files are ready to commit on the dev branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions