innovationOUtside / jupyterlab_empinken_extension

Coloured JupyterLab / RetroLab notebook cells based on cell tags
https://innovationoutside.github.io/jupyterlab_empinken_extension/
MIT License
5 stars 0 forks source link

Improve toolbar buttons #10

Open psychemedia opened 1 week ago

psychemedia commented 1 week ago

The current toolbar buttons (A (activity; blue), S (solution; green), L (learner, yellow), T (tutor, pink) are a bit cryptic:

via Mark Hall / @mmh352

mmh352 commented 1 week ago

I personally like https://pictogrammers.com/library/mdi/ for my icons. https://github.com/scmmmh/jupyterlab-local-browser/blob/default/src/icon.ts for how to include the SVG in an icon for a jupyter widget.

Here a set of suggestions:

Activity: https://pictogrammers.com/library/mdi/icon/text-box-edit-outline/ Solution: https://pictogrammers.com/library/mdi/icon/text-box-check-outline/ Learner: https://pictogrammers.com/library/mdi/icon/account-school/ Tutor: https://pictogrammers.com/library/mdi/icon/human-male-board/

psychemedia commented 1 week ago

@mmh352 do you know how to toggle the backgrounds for when a button is "pressed"?

mmh352 commented 1 week ago

Sorry, no idea. I would check the button class to see if there is an attribute or if there is a togglebutton.

psychemedia commented 1 week ago

Toggle icons:

How about:

I wonder if it might be a bit irritating if the toolbar buttons change as you move between selected cells?

psychemedia commented 1 week ago

Some discussion of handling toolbar button icons / labels here.

mmh352 commented 1 week ago

I don't think changing the icon is ideal. I would suggest just adding a CSS class to add a gray background. Ideally you would find a way to set the aria-pressed attribute on the button to "true" and then use that in the CSS to toggle the background colour. That way it would be visible and accessible.

psychemedia commented 1 week ago

To add captions, in the command definition, add the caption attribute:

commands.addCommand(command, {
      label: 'Appears in text command menus',
      caption: 'popup tooltip text',
psychemedia commented 1 week ago

To change the background, when a cell selected event is fired, the button would need to look up the cell tags and then set its state accordingly; the button object would then need changing to modify its HTML class in the rendered button, if that is directly available.

IIRC, the buttons can change tags on all selected cells, so there's need to be a tristate background for cases where some but not all selected cells have a particular tag set.

Claude.ai seems confident... no time to try it right now tho; in case is doesn't just work...!

psychemedia commented 1 week ago

Buttons?

image

Uses format-quote-close for tutor/feedback and school-outline for student