diff --git a/client/src/components/Planner/DayPlanSidebar.tsx b/client/src/components/Planner/DayPlanSidebar.tsx
index 023ce932..dde92aea 100644
--- a/client/src/components/Planner/DayPlanSidebar.tsx
+++ b/client/src/components/Planner/DayPlanSidebar.tsx
@@ -23,6 +23,7 @@ import { useSettingsStore } from '../../store/settingsStore'
import { useTranslation } from '../../i18n'
import { formatDate, formatTime, dayTotalCost, currencyDecimals } from '../../utils/formatters'
import { useDayNotes } from '../../hooks/useDayNotes'
+import Tooltip from '../shared/Tooltip'
import type { Trip, Day, Place, Category, Assignment, Reservation, AssignmentsMap, RouteResult } from '../../types'
const NOTE_ICONS = [
@@ -1143,9 +1144,10 @@ const DayPlanSidebar = React.memo(function DayPlanSidebar({
}
{canEditDays && onAddTransport && (
+
+
)}
{(() => {
const dayAccs = accommodations.filter(a => day.id >= a.start_day_id && day.id <= a.end_day_id)
@@ -1217,15 +1220,15 @@ const DayPlanSidebar = React.memo(function DayPlanSidebar({
- {canEditDays && }
toggleDay(day.id, e)}
style={{ flexShrink: 0, background: 'none', border: 'none', padding: 6, cursor: 'pointer', display: 'flex', alignItems: 'center', color: 'var(--text-faint)' }}
diff --git a/client/src/components/Planner/PlacesSidebar.tsx b/client/src/components/Planner/PlacesSidebar.tsx
index b7de7478..40f23a3a 100644
--- a/client/src/components/Planner/PlacesSidebar.tsx
+++ b/client/src/components/Planner/PlacesSidebar.tsx
@@ -13,6 +13,7 @@ import { useCanDo } from '../../store/permissionsStore'
import type { Place, Category, Day, AssignmentsMap } from '../../types'
import FileImportModal from './FileImportModal'
import ConfirmDialog from '../shared/ConfirmDialog'
+import Tooltip from '../shared/Tooltip'
interface PlacesSidebarProps {
tripId: number
@@ -372,74 +373,65 @@ const PlacesSidebar = React.memo(function PlacesSidebar({
>
{t(hasMultipleListImportProviders ? 'places.importList' : 'places.importGoogleList')}
- { setSelectMode(v => !v); setSelectedIds(new Set()) }}
- style={{
- display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 5,
- padding: '5px 10px', borderRadius: 8,
- border: `1px solid ${selectMode ? 'var(--accent)' : 'var(--border-primary)'}`,
- background: selectMode ? 'color-mix(in srgb, var(--accent) 12%, transparent)' : 'none',
- color: selectMode ? 'var(--accent)' : 'var(--text-faint)', fontSize: 11, fontWeight: 500,
- cursor: 'pointer', fontFamily: 'inherit', flexShrink: 0,
- }}
- >
- {t('common.select')}
-
- {selectMode && (
-
-
- {t('places.selectionCount', { count: selectedIds.size })}
-
- {
- if (selectedIds.size === filtered.length) {
- setSelectedIds(new Set())
- } else {
- setSelectedIds(new Set(filtered.map(p => p.id)))
- }
- }}
- style={{ background: 'none', border: 'none', cursor: 'pointer', color: 'var(--text-muted)', fontSize: 11, fontFamily: 'inherit', padding: '2px 4px', borderRadius: 4 }}
- >
- {selectedIds.size === filtered.length && filtered.length > 0 ? t('common.deselectAll') : t('common.selectAll')}
-
- {
- if (selectedIds.size === 0) return
- if (isMobile) {
- setPendingDeleteIds(Array.from(selectedIds))
- } else {
- onBulkDeletePlaces?.(Array.from(selectedIds))
- }
- }}
- disabled={selectedIds.size === 0}
- style={{
- display: 'flex', alignItems: 'center', gap: 4, background: 'none', border: 'none',
- cursor: selectedIds.size > 0 ? 'pointer' : 'default',
- color: selectedIds.size > 0 ? '#ef4444' : 'var(--text-faint)',
- fontSize: 11, fontFamily: 'inherit', padding: '2px 4px', borderRadius: 4, fontWeight: 500,
- }}
- >
- {t('places.deleteSelected')}
-
-
-
-
-
- )}
>}
{/* Filter-Tabs */}
-
- {([{ id: 'all', label: t('places.all') }, { id: 'unplanned', label: t('places.unplanned') }, hasTracks ? { id: 'tracks', label: t('places.filterTracks') } : null] as const).filter(Boolean).map(f => (
- { setFilter(f.id); onPlacesFilterChange?.(f.id); setSelectedIds(new Set()) }} style={{
- padding: '4px 10px', borderRadius: 20, border: 'none', cursor: 'pointer',
- fontSize: 11, fontWeight: 500, fontFamily: 'inherit',
- background: filter === f.id ? 'var(--accent)' : 'var(--bg-tertiary)',
- color: filter === f.id ? 'var(--accent-text)' : 'var(--text-muted)',
- }}>{f.label}
- ))}
-
+ {(() => {
+ const baseFiltered = places.filter(p => {
+ if (categoryFilters.size > 0) {
+ if (p.category_id == null) {
+ if (!categoryFilters.has('uncategorized')) return false
+ } else if (!categoryFilters.has(String(p.category_id))) return false
+ }
+ if (search && !p.name.toLowerCase().includes(search.toLowerCase()) &&
+ !(p.address || '').toLowerCase().includes(search.toLowerCase())) return false
+ return true
+ })
+ const counts = {
+ all: baseFiltered.length,
+ unplanned: baseFiltered.filter(p => !plannedIds.has(p.id)).length,
+ tracks: baseFiltered.filter(p => p.route_geometry).length,
+ }
+ const tabs = ([
+ { id: 'all', label: t('places.all') },
+ { id: 'unplanned', label: t('places.unplanned') },
+ hasTracks ? { id: 'tracks', label: t('places.filterTracks') } : null,
+ ] as const).filter(Boolean) as Array<{ id: 'all' | 'unplanned' | 'tracks'; label: string }>
+ return (
+
+ {tabs.map(f => {
+ const active = filter === f.id
+ return (
+ { setFilter(f.id); onPlacesFilterChange?.(f.id); setSelectedIds(new Set()) }}
+ style={{
+ appearance: 'none', border: 'none', cursor: 'pointer', fontFamily: 'inherit',
+ display: 'inline-flex', alignItems: 'center', gap: 5,
+ padding: '4px 9px', borderRadius: 99,
+ fontSize: 11, fontWeight: 500, whiteSpace: 'nowrap',
+ background: active ? 'var(--accent)' : 'var(--bg-card)',
+ color: active ? 'var(--accent-text)' : 'var(--text-primary)',
+ boxShadow: active ? 'none' : '0 1px 2px rgba(0,0,0,0.06)',
+ transition: 'background 0.15s, color 0.15s, box-shadow 0.15s',
+ }}
+ >
+ {f.label}
+
+ {counts[f.id]}
+
+
+ )
+ })}
+
+ )
+ })()}
{/* Suchfeld */}
@@ -470,9 +462,9 @@ const PlacesSidebar = React.memo(function PlacesSidebar({
? (categoryFilters.has('uncategorized') ? t('places.noCategory') : categories.find(c => categoryFilters.has(String(c.id)))?.name || t('places.allCategories'))
: `${categoryFilters.size} ${t('places.categoriesSelected')}`
return (
-
+
setCatDropOpen(v => !v)} style={{
- width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'space-between',
+ flex: 1, minWidth: 0, display: 'flex', alignItems: 'center', justifyContent: 'space-between',
padding: '6px 10px', borderRadius: 8, border: '1px solid var(--border-primary)',
background: 'var(--bg-card)', fontSize: 12, color: 'var(--text-primary)',
cursor: 'pointer', fontFamily: 'inherit',
@@ -480,6 +472,41 @@ const PlacesSidebar = React.memo(function PlacesSidebar({
{label}
+ {canEditPlaces && (
+
+ { setSelectMode(v => !v); setSelectedIds(new Set()) }}
+ aria-label={t('common.select')}
+ aria-pressed={selectMode}
+ style={{
+ position: 'relative', width: 30, flexShrink: 0, borderRadius: 8,
+ border: `1px solid ${selectMode ? 'var(--accent)' : 'var(--border-primary)'}`,
+ background: selectMode ? 'color-mix(in srgb, var(--accent) 14%, transparent)' : 'var(--bg-card)',
+ color: selectMode ? 'var(--accent)' : 'var(--text-faint)',
+ cursor: 'pointer', fontFamily: 'inherit', padding: 0,
+ transition: 'background 0.18s, color 0.18s, border-color 0.18s',
+ overflow: 'hidden',
+ }}
+ >
+
+
+
+
+
+
+
+
+ )}
{catDropOpen && (
- {/* Anzahl */}
-
- {filtered.length === 1 ? t('places.countSingular') : t('places.count', { count: filtered.length })}
-
+ {/* Anzahl / Auswahl-Leiste */}
+ {selectMode ? (
+
+
+ {t('places.selectionCount', { count: selectedIds.size })}
+
+ 0 ? t('common.deselectAll') : t('common.selectAll')} placement="bottom">
+ {
+ if (selectedIds.size === filtered.length) setSelectedIds(new Set())
+ else setSelectedIds(new Set(filtered.map(p => p.id)))
+ }}
+ aria-label={selectedIds.size === filtered.length && filtered.length > 0 ? t('common.deselectAll') : t('common.selectAll')}
+ style={{
+ display: 'flex', alignItems: 'center', justifyContent: 'center',
+ width: 24, height: 24, borderRadius: 6, border: 'none',
+ background: 'transparent', color: 'var(--text-muted)', cursor: 'pointer', padding: 0,
+ }}
+ onMouseEnter={e => { e.currentTarget.style.background = 'var(--bg-hover)' }}
+ onMouseLeave={e => { e.currentTarget.style.background = 'transparent' }}
+ >
+
+
+
+
+ {
+ if (selectedIds.size === 0) return
+ if (isMobile) setPendingDeleteIds(Array.from(selectedIds))
+ else onBulkDeletePlaces?.(Array.from(selectedIds))
+ }}
+ disabled={selectedIds.size === 0}
+ aria-label={t('places.deleteSelected')}
+ style={{
+ display: 'flex', alignItems: 'center', justifyContent: 'center',
+ width: 24, height: 24, borderRadius: 6, border: 'none',
+ background: 'transparent',
+ color: selectedIds.size > 0 ? '#ef4444' : 'var(--text-faint)',
+ cursor: selectedIds.size > 0 ? 'pointer' : 'default', padding: 0,
+ }}
+ onMouseEnter={e => { if (selectedIds.size > 0) e.currentTarget.style.background = 'color-mix(in srgb, #ef4444 14%, transparent)' }}
+ onMouseLeave={e => { e.currentTarget.style.background = 'transparent' }}
+ >
+
+
+
+
+ ) : (
+
+ {filtered.length === 1 ? t('places.countSingular') : t('places.count', { count: filtered.length })}
+
+ )}
{/* Liste */}
diff --git a/client/src/components/shared/Tooltip.tsx b/client/src/components/shared/Tooltip.tsx
new file mode 100644
index 00000000..bb9653f3
--- /dev/null
+++ b/client/src/components/shared/Tooltip.tsx
@@ -0,0 +1,98 @@
+import React, { useState, useRef, useEffect } from 'react'
+import ReactDOM from 'react-dom'
+
+type Placement = 'top' | 'bottom' | 'left' | 'right'
+
+interface TooltipProps {
+ label: string
+ placement?: Placement
+ delay?: number
+ disabled?: boolean
+ children: React.ReactElement
+}
+
+export function Tooltip({ label, placement = 'bottom', delay = 250, disabled, children }: TooltipProps) {
+ const [open, setOpen] = useState(false)
+ const [coords, setCoords] = useState<{ top: number; left: number } | null>(null)
+ const triggerRef = useRef
(null)
+ const tooltipRef = useRef(null)
+ const timerRef = useRef(null)
+
+ const show = () => {
+ if (disabled || !label) return
+ if (timerRef.current) window.clearTimeout(timerRef.current)
+ timerRef.current = window.setTimeout(() => setOpen(true), delay)
+ }
+ const hide = () => {
+ if (timerRef.current) window.clearTimeout(timerRef.current)
+ setOpen(false)
+ }
+
+ useEffect(() => () => { if (timerRef.current) window.clearTimeout(timerRef.current) }, [])
+
+ useEffect(() => {
+ if (!open || !triggerRef.current) return
+ const r = triggerRef.current.getBoundingClientRect()
+ const tipW = tooltipRef.current?.offsetWidth ?? 0
+ const tipH = tooltipRef.current?.offsetHeight ?? 0
+ const gap = 6
+ let top = 0, left = 0
+ if (placement === 'top') { top = r.top - tipH - gap; left = r.left + r.width / 2 - tipW / 2 }
+ else if (placement === 'bottom') { top = r.bottom + gap; left = r.left + r.width / 2 - tipW / 2 }
+ else if (placement === 'left') { top = r.top + r.height / 2 - tipH / 2; left = r.left - tipW - gap }
+ else { top = r.top + r.height / 2 - tipH / 2; left = r.right + gap }
+ const pad = 6
+ left = Math.max(pad, Math.min(left, window.innerWidth - tipW - pad))
+ top = Math.max(pad, Math.min(top, window.innerHeight - tipH - pad))
+ setCoords({ top, left })
+ }, [open, placement, label])
+
+ const child = React.Children.only(children)
+ const trigger = React.cloneElement(child, {
+ ref: (node: HTMLElement | null) => {
+ triggerRef.current = node
+ const r = (child as any).ref
+ if (typeof r === 'function') r(node)
+ else if (r && typeof r === 'object') r.current = node
+ },
+ onMouseEnter: (e: any) => { show(); child.props.onMouseEnter?.(e) },
+ onMouseLeave: (e: any) => { hide(); child.props.onMouseLeave?.(e) },
+ onFocus: (e: any) => { show(); child.props.onFocus?.(e) },
+ onBlur: (e: any) => { hide(); child.props.onBlur?.(e) },
+ })
+
+ return (
+ <>
+ {trigger}
+ {open && ReactDOM.createPortal(
+
+ {label}
+
,
+ document.body,
+ )}
+ >
+ )
+}
+
+export default Tooltip
diff --git a/client/src/i18n/translations/de.ts b/client/src/i18n/translations/de.ts
index 9ae9a435..eb7c9b2b 100644
--- a/client/src/i18n/translations/de.ts
+++ b/client/src/i18n/translations/de.ts
@@ -932,7 +932,7 @@ const de: Record = {
// Places Sidebar
'places.addPlace': 'Ort/Aktivität hinzufügen',
- 'places.importFile': 'Datei importieren',
+ 'places.importFile': 'Dateimport',
'places.sidebarDrop': 'Ablegen zum Importieren',
'places.importFileHint': '.gpx-, .kml- oder .kmz-Dateien aus Tools wie Google My Maps, Google Earth oder einem GPS-Tracker importieren.',
'places.importFileDropHere': 'Datei auswählen oder hierher ziehen und ablegen',