app: Drop doc toggle shortkey.

This was an undocumented feature that gets in the way of other shortcuts, and doesn't extend well to the sideview being used for other things in future commits.
This commit is contained in:
Laurens Valk
2026-03-30 14:24:44 +02:00
parent 2884825f4c
commit c3a703f3b3
2 changed files with 1 additions and 32 deletions
-20
View File
@@ -16,7 +16,6 @@ import SponsorDialog from '../sponsor/SponsorDialog';
import StatusBar from '../status-bar/StatusBar';
import Toolbar from '../toolbar/Toolbar';
import Tour from '../tour/Tour';
import { isMacOS } from '../utils/os';
import { docsDefaultPage } from './constants';
import { useI18n } from './i18n';
@@ -47,8 +46,6 @@ const Terminal = React.lazy(async () => {
});
const Docs: React.FunctionComponent = () => {
const { setIsSettingShowDocsEnabled } = useSettingIsShowDocsEnabled();
return (
<iframe
onLoad={(e) => {
@@ -59,23 +56,6 @@ const Docs: React.FunctionComponent = () => {
return;
}
// Override browser default key bindings in iframe.
contentWindow.document.addEventListener('keydown', (e) => {
// use Ctrl-D/Cmd-D to toggle docs
if (
(isMacOS()
? e.metaKey && !e.ctrlKey
: e.ctrlKey && !e.metaKey) &&
!e.altKey &&
e.key === 'd'
) {
e.preventDefault();
// since the iframe is only visible when docs are shown
// the only action is to hide the docs
setIsSettingShowDocsEnabled(false);
}
});
if (document.body.classList.contains(Classes.DARK)) {
contentWindow.document.documentElement.classList.add(Classes.DARK);
}
+1 -12
View File
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2020-2023 The Pybricks Authors
// Copyright (c) 2020-2026 The Pybricks Authors
import './editor.scss';
import {
@@ -409,17 +409,6 @@ const Editor: React.FunctionComponent = () => {
[i18n],
);
useEditorAction(
editor,
() => ({
id: 'pybricks.action.toggleDocs',
label: i18n.translate('toggleDocs'),
run: () => toggleIsSettingShowDocsEnabled(),
keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyD],
}),
[i18n, toggleIsSettingShowDocsEnabled],
);
useEditorAction(
editor,
() => ({