Refactor and enhance zone and wall item management:

- Update zone handling in ZoneGroup to include selected zone visibility.
- Improve camera transition speed in ZoneCentreTarget.
- Add clearSelectedZone functionality in useZoneStore.
- Integrate clearSelectedZone in KeyPressListener for ESCAPE key action.
- Adjust sidebar and module toggle positioning for better UI layout.
- Clean up unused code and comments in Project component.
This commit is contained in:
2025-05-09 14:54:45 +05:30
parent 6026d0bc10
commit a477e0c48f
10 changed files with 400 additions and 337 deletions

View File

@@ -12,6 +12,7 @@ import {
} from "../../store/store";
import { usePlayButtonStore } from "../../store/usePlayButtonStore";
import { detectModifierKeys } from "./detectModifierKeys";
import { useSelectedZoneStore } from "../../store/visualization/useZoneStore";
const KeyPressListener: React.FC = () => {
const { activeModule, setActiveModule } = useModuleStore();
@@ -25,6 +26,7 @@ const KeyPressListener: React.FC = () => {
const { setAddAction } = useAddAction();
const { setSelectedWallItem } = useSelectedWallItem();
const { setActiveTool } = useActiveTool();
const { clearSelectedZone} = useSelectedZoneStore();
const isTextInput = (element: Element | null): boolean =>
element instanceof HTMLInputElement ||
@@ -131,6 +133,7 @@ const KeyPressListener: React.FC = () => {
if (keyCombination === "ESCAPE") {
setActiveTool("cursor");
setIsPlaying(false);
clearSelectedZone();
}
// Placeholder for future implementation