Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export interface AgentTriggerSectionProps {
/**
* Shared agent / prompt / instruction-page / context-pages form section.
*
* Used by both TaskAgentTriggersDialog (per-trigger-type) and
* EventAgentTriggerDialog (single trigger). Selection state lives entirely in
* Used by both TaskAgentTriggersDialog (per-trigger-type) and the calendar
* EventModal's inline agent disclosure. Selection state lives entirely in
* the parent through `value`/`onChange` so this component carries no internal
* state a remote refetch could clobber. Collapsible "Advanced" matches the
* task dialog's UX so users see the same affordance in both surfaces.
Expand Down
12 changes: 10 additions & 2 deletions apps/web/src/components/calendar/AgendaView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
isYesterday,
} from 'date-fns';
import { cn } from '@/lib/utils';
import { MapPin, Clock, Users, ExternalLink, Calendar } from 'lucide-react';
import { MapPin, Clock, Users, ExternalLink, Calendar, Zap } from 'lucide-react';
import Link from 'next/link';
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
import { Badge } from '@/components/ui/badge';
Expand Down Expand Up @@ -186,7 +186,15 @@ function EventCard({
{/* Header */}
<div className="flex items-start justify-between gap-2">
<div className="flex-1 min-w-0">
<h3 className="font-semibold truncate">{event.title}</h3>
<h3 className="font-semibold truncate">
{event.hasAgentTrigger && (
<>
<Zap className="inline-block h-3.5 w-3.5 mr-1 text-amber-500 align-text-top" aria-hidden="true" />
<span className="sr-only">Agent trigger configured. </span>
</>
)}
{event.title}
</h3>
{event.description && (
<p className="text-sm text-muted-foreground line-clamp-2 mt-1">
{event.description}
Expand Down
13 changes: 12 additions & 1 deletion apps/web/src/components/calendar/CalendarView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,22 @@ export function CalendarView({ context, driveId, driveName: _driveName, classNam
color?: string;
attendeeIds?: string[];
pageId?: string | null;
agentTrigger?: {
agentPageId: string;
prompt?: string;
instructionPageId: string | null;
contextPageIds: string[];
} | null;
}) => {
if (selectedEvent) {
await updateEvent(selectedEvent.id, eventData);
} else {
await createEvent(eventData);
// POST schema doesn't accept null (only undefined no-op or object upsert)
const { agentTrigger, ...rest } = eventData;
await createEvent({
...rest,
agentTrigger: agentTrigger ?? undefined,
});
}
setIsEventModalOpen(false);
};
Expand Down
22 changes: 19 additions & 3 deletions apps/web/src/components/calendar/DayView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
setMinutes,
} from 'date-fns';
import { cn } from '@/lib/utils';
import { MapPin, Users } from 'lucide-react';
import { MapPin, Users, Zap } from 'lucide-react';
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
import {
CalendarEvent,
Expand Down Expand Up @@ -236,7 +236,15 @@ function TimedEventCard({
onClick();
}}
>
<div className="font-medium truncate">{event.title}</div>
<div className="font-medium truncate">
{event.hasAgentTrigger && (
<>
<Zap className="inline-block h-3 w-3 mr-1 text-amber-500 align-text-top" aria-hidden="true" />
<span className="sr-only">Agent trigger configured. </span>
</>
)}
{event.title}
</div>
<div className="text-xs text-muted-foreground">
{format(new Date(event.startAt), 'h:mm a')} - {format(new Date(event.endAt), 'h:mm a')}
</div>
Expand Down Expand Up @@ -293,7 +301,15 @@ function AllDayEventCard({
)}
onClick={onClick}
>
<div className="font-medium">{event.title}</div>
<div className="font-medium">
{event.hasAgentTrigger && (
<>
<Zap className="inline-block h-3 w-3 mr-1 text-amber-500 align-text-top" aria-hidden="true" />
<span className="sr-only">Agent trigger configured. </span>
</>
)}
{event.title}
</div>
{event.location && (
<div className="flex items-center gap-1 text-xs text-muted-foreground">
<MapPin className="w-3 h-3" />
Expand Down
Loading
Loading