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

Add a button to the "Activity Bar Panel" #110

Closed
5 tasks done
Tracked by #109
josephfusco opened this issue Apr 16, 2024 · 1 comment
Closed
5 tasks done
Tracked by #109

Add a button to the "Activity Bar Panel" #110

josephfusco opened this issue Apr 16, 2024 · 1 comment
Assignees
Labels
type: enhancement Improvements to existing functionality

Comments

@josephfusco
Copy link
Member

josephfusco commented Apr 16, 2024

Acceptance Criteria

  • registerActivityBarPanel() exists and is callable by 3rd party plugins
  • Function handles edge cases & invalid input
  • Tests:
    • Help Panel tests should work
    • Explorer Panel tests should work (rename to Query Composer)

Technical Details

const { registerActivityBarPanel } = window.WPGRAPHQL_IDE;

registerActivityBarPanel( 'my-button', {
  title: 'My Button',
  label: 'My Button does x, y and z',
  icon: () => {}, // name of icon from supported icon library or custom Icon component
  content: () => {} // The content that will render in the activity panel when this activity bar plugin is active
} );

The smart cache collections feature will most certainly make use of this API.

An example of the help screen as a plugin might look like this:

const { registerActivityBarPanel } = window.WPGRAPHQL_IDE;

registerActivityBarPanel( 'help', {
  title: 'Help',
  label: 'Help',
  icon: () => <HelpIcon />,
  content: () => <HelpPluginList /> // In the screenshot below, this component represents the list of articles visible in the activity panel when the help button is active
} );

Image

The list of panels should be maintained in the Redux store, so registering a panel should modify the list of panels in the Redux store. Similar when you call registerBlockType in Gutenberg.

Reference

@josephfusco josephfusco mentioned this issue Apr 16, 2024
14 tasks
@josephfusco josephfusco self-assigned this Apr 23, 2024
@josephfusco josephfusco changed the title Add a button to the "Activity Bar Plugins" Add a button to the "Activity Bar Panel" Jun 3, 2024
@josephfusco josephfusco added the type: enhancement Improvements to existing functionality label Jun 6, 2024
@josephfusco
Copy link
Member Author

Closed by #165

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Improvements to existing functionality
Projects
None yet
Development

No branches or pull requests

1 participant