diff --git a/frontend/src/components/calendar/EventDetailPanel.tsx b/frontend/src/components/calendar/EventDetailPanel.tsx index b8e08e8..211d796 100644 --- a/frontend/src/components/calendar/EventDetailPanel.tsx +++ b/frontend/src/components/calendar/EventDetailPanel.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect, useCallback, useMemo } from 'react'; +import { useState, useEffect, useCallback, useMemo, useRef } from 'react'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { toast } from 'sonner'; import { format, parseISO } from 'date-fns'; @@ -284,6 +284,15 @@ export default function EventDetailPanel({ const [scopeStep, setScopeStep] = useState<'edit' | 'delete' | null>(null); const [editScope, setEditScope] = useState<'this' | 'this_and_future' | null>(null); const [locationSearch, setLocationSearch] = useState(''); + const descRef = useRef(null); + + // Auto-resize description textarea to fit content + useEffect(() => { + const el = descRef.current; + if (!el) return; + el.style.height = 'auto'; + el.style.height = `${Math.min(el.scrollHeight, 200)}px`; + }, [editState.description, isEditing]); // Poll lock status in view mode for shared events (Stream A: real-time lock awareness) // lockInfo is only set from the 423 error path; poll data (viewLockQuery.data) is used directly. @@ -539,7 +548,7 @@ export default function EventDetailPanel({ : event?.title || ''; return ( -
+
e.stopPropagation()}> {/* Header */}
@@ -721,7 +730,7 @@ export default function EventDetailPanel({
) : (isEditing || isCreating) ? ( /* Edit / Create mode */ -
+
{/* Title (only shown in body for create mode; edit mode has it in header) */} {isCreating && (
@@ -737,58 +746,49 @@ export default function EventDetailPanel({
)} -
- -