From fcb280425c3e301625945ae2eec13fe07afeb7e6 Mon Sep 17 00:00:00 2001 From: Kaspar Bumke Date: Thu, 2 Apr 2026 11:50:24 +0100 Subject: [PATCH 1/4] Revert "FIX: Remove keyboard shortcuts for undo/redo" This reverts commit a088808246ad1412c837450046ffec7377acae9c. --- packages/frontend/src/page/document_page.tsx | 22 +++++++++++++++++++ .../frontend/src/page/history_sidebar.tsx | 7 ++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/page/document_page.tsx b/packages/frontend/src/page/document_page.tsx index f7236bd64..0f2b86417 100644 --- a/packages/frontend/src/page/document_page.tsx +++ b/packages/frontend/src/page/document_page.tsx @@ -1,4 +1,5 @@ import Resizable, { type ContextValue } from "@corvu/resizable"; +import { makeEventListener } from "@solid-primitives/event-listener"; import { Title } from "@solidjs/meta"; import { useNavigate, useParams } from "@solidjs/router"; import ChevronsRight from "lucide-solid/icons/chevrons-right"; @@ -401,6 +402,27 @@ export function DocumentPane(props: { const history = useSnapshotHistory(() => props.docRef.refId); + makeEventListener(window, "keydown", (evt) => { + const mod = evt.metaKey || evt.ctrlKey; + if (!mod || evt.altKey) { + return; + } + + if (evt.key === "z" || evt.key === "Z") { + if (evt.shiftKey) { + if (history.canRedo()) { + evt.preventDefault(); + history.onRedo(); + } + } else { + if (history.canUndo()) { + evt.preventDefault(); + history.onUndo(); + } + } + } + }); + // oxlint-disable solid/reactivity -- Context.Provider value getter is reactive return ( props.docRef.refId}> diff --git a/packages/frontend/src/page/history_sidebar.tsx b/packages/frontend/src/page/history_sidebar.tsx index 50b1db463..614c9c551 100644 --- a/packages/frontend/src/page/history_sidebar.tsx +++ b/packages/frontend/src/page/history_sidebar.tsx @@ -1,6 +1,9 @@ import { HistoryNavigator } from "catcolab-ui-components"; import type { SnapshotHistory } from "./use_snapshot_history"; +const isMac = typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.userAgent); +const mod = isMac ? "\u2318" : "Ctrl"; + export function HistorySidebar(props: { history: SnapshotHistory }) { return ( ); } From 4c49eabe7505c9527854e0555c1d8daf8640f585 Mon Sep 17 00:00:00 2001 From: Kaspar Bumke Date: Thu, 2 Apr 2026 11:03:39 +0100 Subject: [PATCH 2/4] FIX: Undo shortcuts affecting both panes when side-by-side --- packages/frontend/src/page/document_page.css | 1 + packages/frontend/src/page/document_page.tsx | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/page/document_page.css b/packages/frontend/src/page/document_page.css index e6481640b..610673719 100644 --- a/packages/frontend/src/page/document_page.css +++ b/packages/frontend/src/page/document_page.css @@ -46,6 +46,7 @@ flex-direction: row; height: 100%; min-height: 0; + outline: none; } .document-pane-content { diff --git a/packages/frontend/src/page/document_page.tsx b/packages/frontend/src/page/document_page.tsx index 0f2b86417..a9d8840a7 100644 --- a/packages/frontend/src/page/document_page.tsx +++ b/packages/frontend/src/page/document_page.tsx @@ -1,5 +1,4 @@ import Resizable, { type ContextValue } from "@corvu/resizable"; -import { makeEventListener } from "@solid-primitives/event-listener"; import { Title } from "@solidjs/meta"; import { useNavigate, useParams } from "@solidjs/router"; import ChevronsRight from "lucide-solid/icons/chevrons-right"; @@ -402,7 +401,7 @@ export function DocumentPane(props: { const history = useSnapshotHistory(() => props.docRef.refId); - makeEventListener(window, "keydown", (evt) => { + const onKeyDown = (evt: KeyboardEvent) => { const mod = evt.metaKey || evt.ctrlKey; if (!mod || evt.altKey) { return; @@ -421,12 +420,12 @@ export function DocumentPane(props: { } } } - }); + }; // oxlint-disable solid/reactivity -- Context.Provider value getter is reactive return ( props.docRef.refId}> -
+
Date: Thu, 2 Apr 2026 11:25:53 +0100 Subject: [PATCH 3/4] ENH: Blue dot indicator for pane focus --- packages/frontend/src/page/document_page.css | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/frontend/src/page/document_page.css b/packages/frontend/src/page/document_page.css index 610673719..9e226b3a5 100644 --- a/packages/frontend/src/page/document_page.css +++ b/packages/frontend/src/page/document_page.css @@ -47,6 +47,24 @@ height: 100%; min-height: 0; outline: none; + position: relative; +} + +.document-pane-layout::after { + content: ""; + position: absolute; + bottom: 8px; + left: 2px; + width: 10px; + height: 10px; + border-radius: 50%; + background: var(--color-alert-question); + opacity: 0; + pointer-events: none; +} + +.document-pane-layout:focus-within::after { + opacity: 1; } .document-pane-content { From 88c5b9d393f3c76bd7ac324779e434646be9b9cd Mon Sep 17 00:00:00 2001 From: Kaspar Bumke Date: Thu, 2 Apr 2026 11:43:03 +0100 Subject: [PATCH 4/4] WIP: You focus me!? I focus you! --- packages/frontend/src/page/document_page.tsx | 31 +++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/page/document_page.tsx b/packages/frontend/src/page/document_page.tsx index a9d8840a7..1a216f62f 100644 --- a/packages/frontend/src/page/document_page.tsx +++ b/packages/frontend/src/page/document_page.tsx @@ -221,7 +221,11 @@ function SplitPaneToolbar(props: { - + e.preventDefault()} + tooltip="Toggle history" + > @@ -233,6 +237,7 @@ function SplitPaneToolbar(props: { > e.preventDefault()} tooltip="Toggle history" > @@ -288,7 +293,11 @@ function SecondaryToolbar(props: { > {(secondary) => (
- + e.preventDefault()} + tooltip="Toggle history" + > props.docRef.refId); + let paneRef: HTMLDivElement | undefined; + + createEffect(() => { + if (props.historySidebarOpen) { + paneRef?.focus(); + } + }); + const onKeyDown = (evt: KeyboardEvent) => { const mod = evt.metaKey || evt.ctrlKey; if (!mod || evt.altKey) { @@ -425,7 +442,7 @@ export function DocumentPane(props: { // oxlint-disable solid/reactivity -- Context.Provider value getter is reactive return ( props.docRef.refId}> -
+
-
+
{ + e.preventDefault(); + paneRef?.focus(); + }} + >