From bdb2de1a40683916fd96c5f54639ffc62e943b68 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 29 Aug 2026 10:25:06 +0300 Subject: [PATCH] Planner: Add back undo/redo --- app/features/map-planner/components/Planner.tsx | 12 ++++++++++-- app/features/map-planner/plans-global.css | 7 +++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/features/map-planner/components/Planner.tsx b/app/features/map-planner/components/Planner.tsx index 14d4d7307..8bf879da9 100644 --- a/app/features/map-planner/components/Planner.tsx +++ b/app/features/map-planner/components/Planner.tsx @@ -20,6 +20,7 @@ import { type TLShapeId, type TLUiStylePanelProps, Tldraw, + type TldrawOptions, } from "@tldraw/tldraw"; import clsx from "clsx"; import { @@ -73,6 +74,10 @@ const GAME_UNITS_TO_PX: Record<"MINI" | "OVER", number> = { MINI: 4.4, OVER: 8.4, }; +// the menu panel that normally holds undo & redo is hidden, so they are moved to the toolbar +const TLDRAW_OPTIONS: Partial = { + actionShortcutsLocation: "toolbar", +}; const MAIN_WEAPON_URL_PATTERN = /main-weapons-outlined\/(\d+)/; const SPECIAL_WEAPON_URL_PATTERN = /special-weapons\/(\d+)/; @@ -360,7 +365,6 @@ export default function Planner() { Minimap: null, NavigationPanel: null, PageMenu: null, - QuickActions: null, SharePanel: null, StylePanel: CustomStylePanel, TopPanel: null, @@ -431,7 +435,11 @@ export default function Planner() {
- +
{activeDragItem ? ( diff --git a/app/features/map-planner/plans-global.css b/app/features/map-planner/plans-global.css index 33fcbd14b..3e8c164d3 100644 --- a/app/features/map-planner/plans-global.css +++ b/app/features/map-planner/plans-global.css @@ -79,6 +79,13 @@ body:has(.planner) header { border: var(--border-style); } +/* the undo/redo row tucks under the toolbar, so it shares its look sans bottom border */ +.tlui-toolbar__extras__controls { + border: var(--border-style); + border-bottom: none; + background-color: var(--color-panel); +} + .tlui-style-panel { margin-top: 0 !important; }