Skip to content

Refactor: improve main manu option#170

Draft
ysknsid25 wants to merge 2 commits intosirmalloc:mainfrom
ysknsid25:refactor/improve-main-manu-option
Draft

Refactor: improve main manu option#170
ysknsid25 wants to merge 2 commits intosirmalloc:mainfrom
ysknsid25:refactor/improve-main-manu-option

Conversation

@ysknsid25
Copy link

  1. Improved type safety: By specifying Record<MainMenuOption, string> as the descriptions object in getDescription, it is now guaranteed at compile time that descriptions are defined for all menu items.
  2. Strict handling: The MainMenuOption type is now also applied to handleMainMenuSelect in App.tsx, eliminating the risk of passing non-existent values ​​in switch statements, etc.
  3. Enhanced Completion: When developing in the editor, valid strings for menu values ​​are now auto-completed.

Signed-off-by: ysknsid25 <kengo071225@gmail.com>
Signed-off-by: ysknsid25 <kengo071225@gmail.com>
@ysknsid25
Copy link
Author

depend on #169. After marged #169, I will open this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments