Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat(calendar): all guests declined event ui (#5911)
dev-rb7570e7e33495
diff --git a/apps/web/src/features/block-calendar/components/SelectedEventDetails.tsx b/apps/web/src/features/block-calendar/components/SelectedEventDetails.tsxindex 36ae6a4d8e..8a96453881 100644--- a/apps/web/src/features/block-calendar/components/SelectedEventDetails.tsx+++ b/apps/web/src/features/block-calendar/components/SelectedEventDetails.tsx@@ -1,3 +1,4 @@+import { hasEveryoneElseDeclined } from '@app/features/calendar/components/EventContent';import {EventAttendeesSection,EventDetails,@@ -10,6 +11,7 @@ import { MobileDrawer } from '@components/app/mobile/MobileDrawer';import { toast } from '@core/component/Toast/Toast';import { isMobile } from '@core/mobile/isMobile';import { Popover } from '@kobalte/core/popover';+import ExclamationIcon from '@phosphor/exclamation-mark.svg';import LinkIcon from '@phosphor/link.svg';import PencilSimpleIcon from '@phosphor/pencil-simple.svg';import TrashIcon from '@phosphor/trash.svg';@@ -117,6 +119,51 @@ interface EventDetailsOverlayProps {onOpenChange: (open: boolean) => void;}+function EveryoneElseDeclinedNotice(props: {+ event: CalendarEvent;+ canModify: boolean;+ onDelete: () => void;+ onReschedule: () => void;+}) {+ return (+ <Show when={hasEveryoneElseDeclined(props.event)}>+ <div class="border-edge-muted mx-3 mb-3 grid grid-cols-[1.25rem_minmax(0,1fr)] gap-x-4 rounded-lg border bg-active p-3 text-sm text-ink-muted sm:mt-2 sm:grid-cols-[1rem_minmax(0,1fr)] sm:gap-x-3 sm:text-xs">+ <span+ aria-hidden="true"+ class="flex size-5 shrink-0 items-center justify-center rounded bg-ink/10 text-ink-muted sm:size-4"+ >+ <ExclamationIcon class="size-3" />+ </span>+ <div class="flex min-w-0 flex-col gap-4">+ <div role="status" class="font-medium text-ink">+ Everyone else declined this event+ </div>+ <Show when={props.canModify}>+ <div class="flex justify-end gap-1">+ <Button+ variant="ghost"+ size="sm"+ class="rounded-lg"+ onClick={props.onDelete}+ >+ Delete+ </Button>+ <Button+ variant="cta"+ size="sm"+ class="rounded-lg"+ onClick={props.onReschedule}+ >+ Reschedule+ </Button>+ </div>+ </Show>+ </div>+ </div>+ </Show>+ );+}+function EventDetailsDrawer(props: EventDetailsOverlayProps) {const openEventComposer = useOpenEventComposer();const deleteDialog = useDeleteEventDialog({@@ -194,6 +241,12 @@ function EventDetailsDrawer(props: EventDetailsOverlayProps) {</div></div><MobileDrawer.ScrollBody>+ <EveryoneElseDeclinedNotice+ event={props.event}+ canModify={canModify()}+ onDelete={deleteDialog.open}+ onReschedule={openEditor}+ /><div class="px-3"><EventDetailsevent={props.event}@@ -425,6 +478,12 @@ function EventDetailsPopover(props: EventDetailsPopoverProps) {<CloseIcon /></Popover.CloseButton></div>+ <EveryoneElseDeclinedNotice+ event={props.event}+ canModify={canModify()}+ onDelete={deleteDialog.open}+ onReschedule={openEditor}+ /><div><div class="px-3 pb-3"><EventDetailsdiff --git a/apps/web/src/features/calendar/calendar.css b/apps/web/src/features/calendar/calendar.cssindex 8471678588..13e25332ff 100644--- a/apps/web/src/features/calendar/calendar.css+++ b/apps/web/src/features/calendar/calendar.css@@ -349,6 +349,29 @@font-size: clamp(0.625rem, min(6cqi, 20cqh), 0.75rem);}+.calendar-view .fc .calendar-event-everyone-declined-indicator {+ background-color: currentColor;+}++.calendar-view .fc .calendar-event-everyone-declined-indicator svg {+ color: var(--color-surface);+}++.calendar-view+ .fc+ .calendar-event-content-selected+ .calendar-event-everyone-declined-indicator {+ background-color: var(--color-surface);+}++.calendar-view+ .fc+ .calendar-event-content-selected+ .calendar-event-everyone-declined-indicator+ svg {+ color: var(--color-accent);+}+.calendar-view .fc .calendar-event-content-compact .calendar-event-title {font-size: inherit;}diff --git a/apps/web/src/features/calendar/components/EventContent.tsx b/apps/web/src/features/calendar/components/EventContent.tsxindex 24a3a04ff2..4de3e3a0de 100644--- a/apps/web/src/features/calendar/components/EventContent.tsx+++ b/apps/web/src/features/calendar/components/EventContent.tsx@@ -1,4 +1,5 @@import type { EventContentArg } from '@fullcalendar/core';+import ExclamationIcon from '@phosphor/exclamation-mark.svg';import { cn } from '@ui';import { Show } from 'solid-js';import type { CalendarEvent, CalendarTimeFormat } from '../types';@@ -17,6 +18,22 @@ interface EventContentProps {const SINGLE_LINE_EVENT_DURATION_MS = 15 * 60 * 1000;+/** Whether the viewer is the only attendee who has not declined the event. */+export function hasEveryoneElseDeclined(+ event: Pick<CalendarEvent, 'attendees' | 'isCancelled'>+) {+ if (event.isCancelled) return false;++ const self = event.attendees.find((attendee) => attendee.isSelf);+ if (!self || self.responseStatus === 'declined') return false;++ const otherAttendees = event.attendees.filter((attendee) => !attendee.isSelf);+ return (+ otherAttendees.length > 0 &&+ otherAttendees.every((attendee) => attendee.responseStatus === 'declined')+ );+}+/** Renders responsive event content for FullCalendar. */export function EventContent(props: EventContentProps) {const isRenderedAllDay = () => props.renderProps.event.allDay;@@ -26,6 +43,7 @@ export function EventContent(props: EventContentProps) {!isRenderedAllDay() && props.renderProps.view.type === 'timeGridDay';const selfResponseStatus = () =>props.event.attendees.find((attendee) => attendee.isSelf)?.responseStatus;+ const everyoneElseDeclined = () => hasEveryoneElseDeclined(props.event);const usesSingleLineLayout = () => {const duration =new Date(props.event.end).getTime() -@@ -70,13 +88,25 @@ export function EventContent(props: EventContentProps) {'calendar-event-content-layout-single-line')}>- <span- class={cn(- 'calendar-event-title max-w-full shrink-0 font-semibold leading-tight',- props.isNarrow ? 'whitespace-nowrap' : 'truncate'- )}- >- {props.event.title}+ <span class="calendar-event-title-row flex max-w-full min-w-0 shrink-0 items-center gap-0.5">+ <Show when={everyoneElseDeclined()}>+ <span+ role="img"+ aria-label="Everyone else declined"+ title="Everyone else declined"+ class="calendar-event-everyone-declined-indicator flex size-2.5 shrink-0 items-center justify-center rounded-[2px]"+ >+ <ExclamationIcon aria-hidden="true" class="size-2" />+ </span>+ </Show>+ <span+ class={cn(+ 'calendar-event-title min-w-0 max-w-full shrink font-semibold leading-tight',+ props.isNarrow ? 'whitespace-nowrap' : 'truncate'+ )}+ >+ {props.event.title}+ </span></span><Show when={timeText()}>{(text) => (