As promised, here is how I will do this in my app.
With the release of Plotly 5.14.0 labels have been added to annotations.
These labels are always visible but I could imagine creating a ON/OFF switch for these labels by changing the text color of the label using a rgba string with opacity set to 0.