Skip to content

Centralize Menu Labels and Accelerators as Constants in menu.js #1085

@evanm510

Description

@evanm510

Describe the current limitation
Currently, menu labels, IDs, and accelerator keys in the menu.js file are hardcoded across multiple functions, which makes the code harder to maintain and increases the chance of inconsistencies. Updating a menu label or shortcut requires finding each occurrence, making changes more time-consuming and prone to error.

Describe the proposed feature or enhancement
Introduce a set of centralized constants for menu labels, IDs, and accelerators. These constants could be defined at the top of the file or in a separate constants.js file. By using constants, menu items can be updated in one place, improving maintainability, readability, and reducing redundancy across the codebase.

Additional context
Centralizing these values reduces the likelihood of typos or inconsistencies, makes future localization easier, and enhances the overall structure of the code by separating data definitions from function logic. This approach also improves clarity for new contributors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions