v1.3.1: Fix symbol loading, DEL key, SOMA/Pendenzen in rapport, improved onboarding, org settings tab, logo upload

This commit is contained in:
Pepe Ziberi
2026-02-25 22:28:10 +01:00
parent 5917fa88ad
commit 708bdf6be0
17 changed files with 570 additions and 55 deletions

View File

@@ -6,7 +6,7 @@ import 'maplibre-gl/dist/maplibre-gl.css'
import { useDrop } from 'react-dnd'
import Moveable from 'react-moveable'
import { getSymbolById, getSymbolDataUri } from '@/lib/fw-symbols'
import type { Project, DrawFeature, DrawMode } from '@/app/app/page'
import type { Project, DrawFeature, DrawMode } from '@/types'
// Haversine distance between two [lng, lat] points in meters
function haversineDistance(a: number[], b: number[]): number {
@@ -1892,9 +1892,19 @@ export function MapView({
}
}, [drawMode, deselectSymbol])
// ESC to cancel drawing / finalize measurement
// ESC to cancel drawing, DEL to delete selected symbol
useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
// DEL / Backspace → delete selected symbol
if (e.key === 'Delete' || e.key === 'Backspace') {
const tag = (e.target as HTMLElement)?.tagName
if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT' || (e.target as HTMLElement)?.isContentEditable) return
if (selectedSymbolRef.current) {
e.preventDefault()
deleteSelectedSymbol()
return
}
}
if (e.key === 'Escape') {
// In measure mode: finalize (keep line + labels), just stop adding
if (drawModeRef.current === 'measure' && drawingRef.current.isDrawing) {
@@ -1921,7 +1931,7 @@ export function MapView({
}
window.addEventListener('keydown', handleKeyDown)
return () => window.removeEventListener('keydown', handleKeyDown)
}, [])
}, [deleteSelectedSymbol])
// Drop zone for symbols — use stable ref connection (no inline ref callback)
const [, drop] = useDrop(() => ({