diff --git a/app/src/assets/gltf-glb/layouts/floorplane_1.glb b/app/src/assets/gltf-glb/layouts/floorplane_1.glb new file mode 100644 index 0000000..88e4c6c Binary files /dev/null and b/app/src/assets/gltf-glb/layouts/floorplane_1.glb differ diff --git a/app/src/assets/gltf-glb/layouts/floorplane_2.glb b/app/src/assets/gltf-glb/layouts/floorplane_2.glb new file mode 100644 index 0000000..97cc2de Binary files /dev/null and b/app/src/assets/gltf-glb/layouts/floorplane_2.glb differ diff --git a/app/src/components/footer/Footer.tsx b/app/src/components/footer/Footer.tsx index ae38c3a..8c1319a 100644 --- a/app/src/components/footer/Footer.tsx +++ b/app/src/components/footer/Footer.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from "react"; +import React from "react"; import { HelpIcon } from "../icons/DashboardIcon"; import { useLogger } from "../ui/log/LoggerContext"; import { GetLogIcon } from "./getLogIcons"; @@ -15,25 +15,9 @@ const Footer: React.FC = () => { const { logs, setIsLogListVisible } = useLogger(); const lastLog = logs.length > 0 ? logs[logs.length - 1] : null; - const { showShortcuts, setShowShortcuts } = useShortcutStore(); + const { showShortcuts } = useShortcutStore(); const { isPlaying } = usePlayButtonStore(); - // Listen for Ctrl + Shift + ? - useEffect(() => { - const handleKeyDown = (e: KeyboardEvent) => { - if ( - e.ctrlKey && - e.shiftKey && - (e.key === "?" || e.key === "/") // for some keyboards ? and / share the same key - ) { - e.preventDefault(); - setShowShortcuts(!showShortcuts); // toggle visibility directly - } - }; - - window.addEventListener("keydown", handleKeyDown); - return () => window.removeEventListener("keydown", handleKeyDown); - }, [showShortcuts, setShowShortcuts]); return (
diff --git a/app/src/components/footer/shortcutHelper.tsx b/app/src/components/footer/shortcutHelper.tsx index 96ff8ad..8a15b2e 100644 --- a/app/src/components/footer/shortcutHelper.tsx +++ b/app/src/components/footer/shortcutHelper.tsx @@ -162,11 +162,23 @@ const ShortcutHelper = () => { icon: , }, { - keys: ["CTRL", "+", "."], + keys: ["CTRL", "+", "\\"], name: "Toggle UI", description: "Toggle UI Visibility", icon: , }, + { + keys: ["CTRL", "+", "["], + name: "Toggle UI", + description: "Left Sidebar Visibility", + icon: , + }, + { + keys: ["CTRL", "+", "]"], + name: "Toggle UI", + description: "Right Sidebar Visibility", + icon: , + }, { keys: ["/"], name: "First Person View", @@ -276,7 +288,6 @@ const ShortcutHelper = () => { {group.category} ))} -
Keyboard
diff --git a/app/src/components/icons/ShortcutIcons.tsx b/app/src/components/icons/ShortcutIcons.tsx index 330650f..b20948a 100644 --- a/app/src/components/icons/ShortcutIcons.tsx +++ b/app/src/components/icons/ShortcutIcons.tsx @@ -197,12 +197,12 @@ export function MeasurementToolIcon() { ); @@ -217,53 +217,53 @@ export function WallToolIcon() { fill="none" xmlns="http://www.w3.org/2000/svg" > - + @@ -271,7 +271,7 @@ export function WallToolIcon() { d="M20.7192 8.96582L11.3705 18.3154H7.89982V14.8447L17.2485 5.49512L20.7192 8.96582Z" fill="var(--text-color)" stroke="#3A383D" - stroke-width="1.08709" + strokeWidth="1.08709" /> @@ -292,53 +292,53 @@ export function ZoneToolIcon() { fill="none" xmlns="http://www.w3.org/2000/svg" > - + @@ -346,7 +346,7 @@ export function ZoneToolIcon() { d="M20.7192 8.96582L11.3705 18.3154H7.89982V14.8447L17.2485 5.49512L20.7192 8.96582Z" fill="var(--text-color)" stroke="#3A383D" - stroke-width="1.08709" + strokeWidth="1.08709" /> @@ -411,7 +411,7 @@ export function FloorToolIcon() { width="12.5" height="12.5" fill="#F3F3FD" - fill-opacity="0.85" + fillOpacity="0.85" /> @@ -541,41 +541,41 @@ export function FirstPersonViewIcon() { @@ -594,7 +594,7 @@ export function BuilderIcon() { ); @@ -612,44 +612,44 @@ export function SimulationIcon() { ); @@ -748,7 +748,7 @@ export function PasteIcon() { diff --git a/app/src/utils/shortcutkeys/handleShortcutKeys.ts b/app/src/utils/shortcutkeys/handleShortcutKeys.ts index c8d735a..2cc9c52 100644 --- a/app/src/utils/shortcutkeys/handleShortcutKeys.ts +++ b/app/src/utils/shortcutkeys/handleShortcutKeys.ts @@ -7,6 +7,7 @@ import { useAddAction, useDeleteTool, useSelectedWallItem, + useShortcutStore, useToggleView, useToolMode, } from "../../store/store"; @@ -27,6 +28,7 @@ const KeyPressListener: React.FC = () => { const { setSelectedWallItem } = useSelectedWallItem(); const { setActiveTool } = useActiveTool(); const { clearSelectedZone } = useSelectedZoneStore(); + const { showShortcuts, setShowShortcuts } = useShortcutStore(); const isTextInput = (element: Element | null): boolean => element instanceof HTMLInputElement || @@ -170,10 +172,15 @@ const KeyPressListener: React.FC = () => { setActiveSubTool("cursor"); setIsPlaying(false); clearSelectedZone(); + setShowShortcuts(false); + } + + if (keyCombination === "Ctrl+Shift+?") { + setShowShortcuts(!showShortcuts); } // Placeholder for future implementation - if (["Ctrl+Z", "Ctrl+Y", "Ctrl+Shift+Z", "Ctrl+H", "Ctrl+F", "Ctrl+?"].includes(keyCombination)) { + if (["Ctrl+Z", "Ctrl+Y", "Ctrl+Shift+Z", "Ctrl+H", "Ctrl+F"].includes(keyCombination)) { // Implement undo/redo/help/find/shortcuts } }; @@ -182,7 +189,7 @@ const KeyPressListener: React.FC = () => { window.addEventListener("keydown", handleKeyPress); return () => window.removeEventListener("keydown", handleKeyPress); // eslint-disable-next-line react-hooks/exhaustive-deps - }, [activeModule, toggleUIRight, toggleUILeft, toggleView]); + }, [activeModule, toggleUIRight, toggleUILeft, toggleView, showShortcuts]); return null; };