Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Thomas G. Lopes
commited on
Commit
·
3df9a58
1
Parent(s):
cc5b5a2
fix shortcut
Browse files
src/lib/components/inference-playground/playground.svelte
CHANGED
|
@@ -30,6 +30,7 @@
|
|
| 30 |
import ProviderSelect from "./provider-select.svelte";
|
| 31 |
import ProjectTreeSidebar from "./project-tree-sidebar.svelte";
|
| 32 |
import CheckpointsMenu from "./checkpoints-menu.svelte";
|
|
|
|
| 33 |
|
| 34 |
// LocalStorage keys
|
| 35 |
const SIDEBAR_COLLAPSED_KEY = "playground:sidebar:collapsed";
|
|
@@ -70,21 +71,19 @@
|
|
| 70 |
localStorage.setItem(SIDEBAR_WIDTH_KEY, String(width));
|
| 71 |
}
|
| 72 |
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
e.
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
};
|
| 87 |
-
});
|
| 88 |
|
| 89 |
// Settings popover
|
| 90 |
const settingsPopover = new Popover({
|
|
|
|
| 30 |
import ProviderSelect from "./provider-select.svelte";
|
| 31 |
import ProjectTreeSidebar from "./project-tree-sidebar.svelte";
|
| 32 |
import CheckpointsMenu from "./checkpoints-menu.svelte";
|
| 33 |
+
import { useEventListener } from "runed";
|
| 34 |
|
| 35 |
// LocalStorage keys
|
| 36 |
const SIDEBAR_COLLAPSED_KEY = "playground:sidebar:collapsed";
|
|
|
|
| 71 |
localStorage.setItem(SIDEBAR_WIDTH_KEY, String(width));
|
| 72 |
}
|
| 73 |
|
| 74 |
+
useEventListener(
|
| 75 |
+
() => document.body,
|
| 76 |
+
"keydown",
|
| 77 |
+
e => {
|
| 78 |
+
const mod_key = isMac() ? e.metaKey : e.ctrlKey;
|
| 79 |
+
if (mod_key && e.key === "b") {
|
| 80 |
+
e.preventDefault();
|
| 81 |
+
e.stopImmediatePropagation();
|
| 82 |
+
e.stopPropagation();
|
| 83 |
+
toggle_sidebar_collapsed();
|
| 84 |
+
}
|
| 85 |
+
},
|
| 86 |
+
);
|
|
|
|
|
|
|
| 87 |
|
| 88 |
// Settings popover
|
| 89 |
const settingsPopover = new Popover({
|