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:
@@ -94,10 +94,6 @@ export const TOOL_DEFINITIONS: ToolDefinition[] = [
|
||||
type: "string",
|
||||
description: "Optional event description",
|
||||
},
|
||||
isRecurring: {
|
||||
type: "boolean",
|
||||
description: "Whether this is a recurring event",
|
||||
},
|
||||
recurrenceRule: {
|
||||
type: "string",
|
||||
description: "RRULE format string for recurring events",
|
||||
@@ -133,10 +129,6 @@ export const TOOL_DEFINITIONS: ToolDefinition[] = [
|
||||
type: "string",
|
||||
description: "New description (optional). NEVER put RRULE here!",
|
||||
},
|
||||
isRecurring: {
|
||||
type: "boolean",
|
||||
description: "Whether this is a recurring event (optional)",
|
||||
},
|
||||
recurrenceRule: {
|
||||
type: "string",
|
||||
description:
|
||||
|
||||
@@ -57,7 +57,6 @@ export function executeToolCall(
|
||||
startTime: new Date(args.startTime as string),
|
||||
endTime: new Date(args.endTime as string),
|
||||
description: args.description as string | undefined,
|
||||
isRecurring: args.isRecurring as boolean | undefined,
|
||||
recurrenceRule: args.recurrenceRule as string | undefined,
|
||||
};
|
||||
const dateStr = formatDate(event.startTime);
|
||||
@@ -88,8 +87,6 @@ export function executeToolCall(
|
||||
updates.startTime = new Date(args.startTime as string);
|
||||
if (args.endTime) updates.endTime = new Date(args.endTime as string);
|
||||
if (args.description) updates.description = args.description;
|
||||
if (args.isRecurring !== undefined)
|
||||
updates.isRecurring = args.isRecurring;
|
||||
if (args.recurrenceRule) updates.recurrenceRule = args.recurrenceRule;
|
||||
|
||||
// Build event object for display (merge existing with updates)
|
||||
@@ -99,8 +96,6 @@ export function executeToolCall(
|
||||
endTime: (updates.endTime as Date) || existingEvent.endTime,
|
||||
description:
|
||||
(updates.description as string) || existingEvent.description,
|
||||
isRecurring:
|
||||
(updates.isRecurring as boolean) ?? existingEvent.isRecurring,
|
||||
recurrenceRule:
|
||||
(updates.recurrenceRule as string) || existingEvent.recurrenceRule,
|
||||
exceptionDates: existingEvent.exceptionDates,
|
||||
@@ -131,7 +126,7 @@ export function executeToolCall(
|
||||
|
||||
// Build descriptive content based on delete mode
|
||||
let modeDescription = "";
|
||||
if (existingEvent.isRecurring) {
|
||||
if (existingEvent.recurrenceRule) {
|
||||
switch (deleteMode) {
|
||||
case "single":
|
||||
modeDescription = " (nur dieses Vorkommen)";
|
||||
@@ -155,12 +150,11 @@ export function executeToolCall(
|
||||
startTime: existingEvent.startTime,
|
||||
endTime: existingEvent.endTime,
|
||||
description: existingEvent.description,
|
||||
isRecurring: existingEvent.isRecurring,
|
||||
recurrenceRule: existingEvent.recurrenceRule,
|
||||
exceptionDates: existingEvent.exceptionDates,
|
||||
},
|
||||
deleteMode: existingEvent.isRecurring ? deleteMode : undefined,
|
||||
occurrenceDate: existingEvent.isRecurring
|
||||
deleteMode: existingEvent.recurrenceRule ? deleteMode : undefined,
|
||||
occurrenceDate: existingEvent.recurrenceRule
|
||||
? occurrenceDate
|
||||
: undefined,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user