Replace with command


#1

It’d be nice to be able to replace a cell or widget with a different widget. Like if I have a small button and want to change it a large button, or change a “text style” to a different one. It would also be helpful to be able to do this on a page and global level.

Any text that is at the same position in the hierarchy of the cell and its children would carry over.

I see the “Replace selection with widget” plugin but its operation is mysterious to me.


#2

I have to admit “Replace Selection with widget” does not have the most intuitive UI, but it basically does what you want. It was written mostly for the following scenario:

Suppose you have copied some cells (and changed some properties, like the text):

Convert one of the cells into a widget and copy it to the clipboard:

Select the other cells and choose “Replace selection with widget”:

The cells are converted into widgets, but the individual text remains:

(currently only individual properties are copied over from the existing cells though).

Do you have an idea for a Replace-Widget-UI?


#3

Ah, thanks for the explanation! A bit more limited than the full request, but very helpful nonetheless. I think a simple picker to choose a widget would be a sufficient UI.