codepod icon indicating copy to clipboard operation
codepod copied to clipboard

Freeze a notebook

Open forrestbao opened this issue 2 years ago • 6 comments

Can we allow a notebook to be frozen to prevent accidental changes to it?

forrestbao avatar May 26 '23 08:05 forrestbao

Hi @forrestbao ,is the "lock button" in the bottom left corner of the canvas what you're looking for? freezeCanvas

senwang86 avatar Jun 28 '23 17:06 senwang86

Wow, I never realized the meaning of the lock icon. Then it's better to add a tool tip over it.

forrestbao avatar Jun 29 '23 03:06 forrestbao

Wow, I never realized the meaning of the lock icon. Then it's better to add a tool tip over it.

The "lock" button in the bottom left corner of the canvas is a native implementation of React control, and the permission control may be achieved at the same time.

Removing the "lock" button in the canvas's bottom left corner, and replacing it with "read-only" toggle switch in the sidebar.

  • Pros
    • For general user, all "public" repo are always "read-only" unless the author of repo adds the viewing user as a collaborator.
    • The author and collaborator can turn the "read-only" toggle switch on/off.
  • Cons
    • React App users may look for the "lock" button, and we may need to explain how the "read-only" toggle switch works properly.

Any thoughts, @forrestbao, @lihebi ?

senwang86 avatar Jun 29 '23 19:06 senwang86

I prefer the native lock icon. Is it possible to add a tooltip over it?

forrestbao avatar Jun 30 '23 02:06 forrestbao

I prefer the native lock icon. Is it possible to add a tooltip over it?

Is the tooltip referring to the hover text over the button? I didn't discover the API to modify the default text though. One workaround is to replace the "icon" lock with a customized one that has the desired effect, as shown here.

senwang86 avatar Jun 30 '23 17:06 senwang86

Yes, text that only appears when the widget is hovered over. If we cannot add a tooltip, then let's leave it as is but we need to mention this lock feature in Codepod's menu.

forrestbao avatar Jul 20 '23 06:07 forrestbao