marimo icon indicating copy to clipboard operation
marimo copied to clipboard

Shortcut to hide cell in macOS broken in Safari

Open asbisen opened this issue 1 year ago • 5 comments

Describe the bug

The keyboard shortcut to hide a code cell in macOS is Cmd + H which also happens to be the global shortcut to hide the current active window. And since global shortcut's take precedence using it ends up hiding the window instead of hiding the cell.

Screenshot 2024-02-09 at 10 17 44 AM

Environment

{
  "marimo": "0.2.3",
  "OS": "Darwin",
  "OS Version": "23.2.0",
  "Processor": "arm",
  "Python Version": "3.11.5",
  "Binaries": {
    "Chrome": "--",
    "Node": "v21.6.1"
  },
  "Requirements": {
    "black": "24.1.0",
    "click": "8.1.7",
    "jedi": "0.19.0",
    "pymdown-extensions": "10.7",
    "starlette": "0.35.1",
    "tomlkit": "0.12.3",
    "typing_extensions": "4.8.0",
    "uvicorn": "0.23.2"
  }
}

Code to reproduce

No response

asbisen avatar Feb 09 '24 18:02 asbisen

What browser are you using?

It seems that Chrome respects the shortcuts, while Safari does not

mscolnick avatar Feb 09 '24 18:02 mscolnick

You are right, I checked again with FireFox and Safari. Safari does not respect the shortcut while FireFox does.

asbisen avatar Feb 09 '24 18:02 asbisen

Is it an ok workaround to use FireFox? I don't see a way around it for Safari without changing the key.

We can do this but is breaking (so need to think through that). If you turn the URL into an application - new Safari lets you put sites in the dock - then the hotkey does work.

mscolnick avatar Feb 09 '24 19:02 mscolnick

Personally for me it's an ok workaround, and I can live with that. For a wider audience down the road this might end up being an irritant underutilized capability for people using macOS + Safari.

asbisen avatar Feb 09 '24 19:02 asbisen

^Agreed. We will look into a long-term fix

mscolnick avatar Feb 09 '24 19:02 mscolnick