Skip to content

Add Tab Functionality to the Plugins#25

Open
AaravMalani wants to merge 6 commits into
mainfrom
feat/add-tabs
Open

Add Tab Functionality to the Plugins#25
AaravMalani wants to merge 6 commits into
mainfrom
feat/add-tabs

Conversation

@AaravMalani

Copy link
Copy Markdown
Member

The issue underpinning the migration of host-side plugins to external plugins is a requirement to display tabs on the frontend. In fact, most visualization plugins (the CSE machine, the Stepper, the Data Viz, etc.) require custom tabs. To retain the modularity gains provided by plugins, this PR aims to add a standardized interface to register, display, hide and unregister tabs.

This PR,

  • adds the @sourceacademy/common-tabs package, with the ITabService and Tab types
  • edits the CI/CD workflow to successfully run tests and deploy external plugins
  • transforms .cjs and .js external plugins to accept a custom require provider for the react, react/jsx-runtime, etc. packages.
  • fixes the plugin directory to output an array instead of an object

Wiki Additions:

  • add the caveat that external plugins must output their CommonJS output to the .js format
  • an example of using the tab service

@changeset-bot

changeset-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3e097ba

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new @sourceacademy/common-tabs package to define tab-related interfaces, refactors the web test plugin to register a test tab, and updates the build script to wrap external plugins in a module wrapper. The review feedback highlights three key areas for improvement: initializing module.exports as an empty object with an exports reference in the build wrapper to prevent runtime errors in standard CommonJS modules, explicitly importing React in the new tabs package to avoid TypeScript compilation issues for consumers, and prefixing the unused conduit parameter with an underscore in the runner test plugin to prevent lint warnings.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread lib/build.ts Outdated
Comment thread src/common/tabs/src/index.ts
Comment thread src/runner/test/src/index.ts Outdated
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