Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
evanm510 opened this issue Nov 12, 2024 · 0 comments
Open

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

evanm510 opened this issue Nov 12, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@evanm510
Copy link

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.

@evanm510 evanm510 added the enhancement New feature or request label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant