Skip to content

refactor: centralize example registry and switching logic (Issue #8)#131

Open
amritamishra01 wants to merge 2 commits intolfortran:mainfrom
amritamishra01:feat/example-menu
Open

refactor: centralize example registry and switching logic (Issue #8)#131
amritamishra01 wants to merge 2 commits intolfortran:mainfrom
amritamishra01:feat/example-menu

Conversation

@amritamishra01
Copy link
Contributor

@amritamishra01 amritamishra01 commented Feb 27, 2026

Description

This PR refactors how preinstalled examples are managed by introducing a structured example registry and centralizing example switching logic.

Changes:

  • Added CATEGORIZED_PROGRAMS and ALL_PROGRAMS in utils/preinstalled_programs.js.
  • Updated TextBox to render the Examples dropdown from the structured registry instead of iterating directly over preinstalled_programs.
  • Centralized example switching logic in pages/index.js via handleExampleChange.
  • Updated the default example loading to use the new registry structure.

Purpose:

This improves separation of concerns between data and UI, centralizes selection logic, and makes the examples menu easier to maintain and extend in the future.
This change improves separation of concerns and maintainability without modifying compilation, execution, or existing functionality.

Closes #8

@amritamishra01 amritamishra01 changed the title feat: add categorized example menu and switching logic (Issue #8) refactor: centralize example registry and switching logic (Issue #8) Feb 27, 2026
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.

Have multiple "preinstalled" programs

1 participant