feat: add EditEventScreen with calendar and chat mode support

Add a unified event editor that works in two modes:
- Calendar mode: Create/edit events directly via EventService API
- Chat mode: Edit AI-proposed events before confirming them

The chat mode allows users to modify proposed events (title, time,
recurrence) and persists changes both locally and to the server.

New components: DateTimePicker, ScrollableDropdown, useDropdownPosition
New API: PUT /api/chat/messages/:messageId/proposal
This commit is contained in:
2026-01-31 18:46:31 +01:00
parent 617543a603
commit 6f0d172bf2
33 changed files with 1394 additions and 289 deletions

View File

@@ -0,0 +1,37 @@
import { useCallback, useRef, useState } from "react";
import { View } from "react-native";
type DropdownPosition = {
top: number;
left: number;
width: number;
};
/**
* Hook for managing dropdown position measurement and visibility.
* @param widthMultiplier - Multiply the measured width (default: 1)
*/
export const useDropdownPosition = (widthMultiplier = 1) => {
const [visible, setVisible] = useState(false);
const [position, setPosition] = useState<DropdownPosition>({
top: 0,
left: 0,
width: 0,
});
const ref = useRef<View>(null);
const open = useCallback(() => {
ref.current?.measureInWindow((x, y, width, height) => {
setPosition({
top: y + height,
left: x,
width: width * widthMultiplier,
});
setVisible(true);
});
}, [widthMultiplier]);
const close = useCallback(() => setVisible(false), []);
return { ref, visible, position, open, close };
};