Add Button to Code Cell toolbar via Extension

Hello JupyterLab Community,

I am currently developing an extension for Jupyter Lab, and would love to add a button to each code cell toolbar.

When I say ‘code cell toolbar’ I am meaning next to the default juptyerlab buttons to add, duplicate, and delete code cells etc.

I have tried implementing things such as

export const saveToPiecesBtn = () =>
    new ToolbarButton({
        className: 'pieces-btn',
        tooltip: 'Save Active Cell To Pieces',
        iconClass: 'typescript-img',
        onClick: saveActiveCellToPieces,
    });

toolbarRegistry.addFactory(
                'Cell',
                'save-to-pieces-button',
                saveToPiecesBtn
            );

I have been racking my brain and github on how to do this but have had quite a lot of trouble in this process. If someone could help me here, I would greatly appreciate it.