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): calendar view ui (#5394)
dev-rb45363f7534d3
diff --git a/apps/web/package.json b/apps/web/package.jsonindex cc648c3c43..18d76f69b8 100644--- a/apps/web/package.json+++ b/apps/web/package.json@@ -38,6 +38,7 @@"@codemirror/lang-python": "^6.2.1","@codemirror/lang-rust": "^6.0.2","@codemirror/language": "^6.11.3",+ "@corvu/calendar": "^0.1.2","@corvu/dialog": "^0.2.4","@corvu/drawer": "^0.2.4","@date-fns/tz": "^1.4.1",@@ -46,6 +47,10 @@"@fontsource-variable/inter": "^5.2.8","@fontsource-variable/playfair-display": "^5.2.8","@fontsource-variable/roboto-mono": "^5.2.8",+ "@fullcalendar/core": "^6.1.21",+ "@fullcalendar/daygrid": "^6.1.21",+ "@fullcalendar/interaction": "^6.1.21",+ "@fullcalendar/timegrid": "^6.1.21","@inkibra/tauri-plugins": "git+https://github.com/macro-inc/tauri-plugins.git#26537c8a46bb8424f9cf4021d08aa76aa7cd66ef","@kobalte/core": "^0.13.11","@leeoniya/ufuzzy": "^1.0.19",diff --git a/apps/web/src/components/app/app-sidebar/sidebar.tsx b/apps/web/src/components/app/app-sidebar/sidebar.tsxindex 2155face39..4d63a9ce19 100644--- a/apps/web/src/components/app/app-sidebar/sidebar.tsx+++ b/apps/web/src/components/app/app-sidebar/sidebar.tsx@@ -1,6 +1,7 @@import { GO_TO_COMMAND_SCOPE, GO_TO_LEADER_KEY } from '@app/constants/hotkeys';import { LIST_VIEW_PATHS, type ListView } from '@app/constants/list-views';import { SidebarActiveCallWidget } from '@app/features/block-call/sidebar/active-call-widget';+import { useCalendarUiFlag } from '@app/features/calendar/use-calendar-ui-flag';import { ChannelsRecentWidget } from '@app/features/channel/sidebar/channels-recent-widget';import { CommandState } from '@app/features/command';import { SidebarCreateMenu } from '@app/features/command/sidebar/sidebar-create-menu';@@ -68,6 +69,7 @@ import { activateClosestDOMScope } from '@core/hotkey/utils';import { tryMacroId, useDisplayName } from '@core/user';import LogoIcon from '@icon/macro-logo.svg';import { AnimatedActivityIcon } from '@icon/wide-activity';+import WideCalendarIcon from '@icon/wide-calendar.svg';import { AnimatedCallIcon } from '@icon/wide-call';import { AnimatedChannelIcon } from '@icon/wide-channel';import { AnimatedCompanyIcon } from '@icon/wide-company';@@ -136,6 +138,7 @@ type SidebarSectionLinkId =| 'calls'| 'documents'| 'tasks'+ | 'calendar'| 'agents'| 'companies';@@ -151,6 +154,7 @@ const WORKSPACE_LINK_IDS = ['calls','documents','tasks',+ 'calendar','agents','companies',] as const;@@ -161,6 +165,7 @@ const DEFAULT_SECTION_VISIBILITY: SidebarSectionVisibility = {calls: true,documents: true,tasks: true,+ calendar: true,agents: true,companies: true,};@@ -240,6 +245,14 @@ const SIDEBAR_LINKS = [hotkey: 't',hotkeyToken: TOKENS.sidebar.goTo.tasks,},+ {+ id: 'calendar',+ label: 'Calendar',+ href: '/calendar',+ icon: WideCalendarIcon,+ hotkey: 'r',+ hotkeyToken: TOKENS.sidebar.goTo.calendar,+ },{id: 'channels',label: 'Channels',@@ -389,8 +402,9 @@ export const GoToHotkeys = () => {});const gettingStartedEnabled = useGettingStartedEnabled();+ const calendarUiEnabled = useCalendarUiFlag();const links = createMemo((): SidebarItem[] =>- buildSidebarLinks(gettingStartedEnabled())+ buildSidebarLinks(gettingStartedEnabled(), calendarUiEnabled()));const debounceResetHotkeysState = debounce(resetGoToHotkeysState, 2000);@@ -999,8 +1013,8 @@ const ACTIVITY_LINK: SidebarItem = {/*** Assemble the ordered sidebar link list: the static links plus Home, Getting- * started, and the flag-gated Activity, Calls, and CRM entries in their- * correct positions.+ * started, and the flag-gated Activity, Calendar, Calls, and CRM entries in+ * their correct positions.* Shared by the rendered sidebar (`AppSidebar.visibleLinks`) and the* always-mounted `GoToHotkeys` registrar so their link sets can't drift. Call* from a reactive context — it reads `ENABLE_CALLS()` / `ENABLE_CRM()`.@@ -1010,11 +1024,14 @@ const ACTIVITY_LINK: SidebarItem = {* Rendered sections additionally drop `hiddenFromSidebar` entries, which have* hotkeys but no sidebar row.*/-const buildSidebarLinks = (showGettingStarted: boolean): SidebarItem[] => {+const buildSidebarLinks = (+ showGettingStarted: boolean,+ showCalendar: boolean+): SidebarItem[] => {let links: SidebarItem[] = [DASHBOARD_LINK,...(showGettingStarted ? [GETTING_STARTED_LINK] : []),- ...SIDEBAR_LINKS,+ ...SIDEBAR_LINKS.filter((link) => showCalendar || link.id !== 'calendar'),];if (ENABLE_ACTIVITY) {@@ -1079,7 +1096,7 @@ export const AppSidebar = (props: AppSidebarProps) => {const userInvitesQuery = useUserInvitesQuery();const firstTeamInvite = () => userInvitesQuery.data?.invites.at(0);const [sectionVisibility, setSectionVisibility] = makePersisted(- createSignal<SidebarSectionVisibility>(DEFAULT_SECTION_VISIBILITY),+ createSignal<Partial<SidebarSectionVisibility>>(DEFAULT_SECTION_VISIBILITY),{ name: 'sidebar-section-visibility' });const [tryVisibility, setTryVisibility] = makePersisted(@@ -1101,8 +1118,9 @@ export const AppSidebar = (props: AppSidebarProps) => {});const gettingStartedEnabled = useGettingStartedEnabled();+ const calendarUiEnabled = useCalendarUiFlag();const allLinks = createMemo((): SidebarItem[] =>- buildSidebarLinks(gettingStartedEnabled())+ buildSidebarLinks(gettingStartedEnabled(), calendarUiEnabled()));// Hides only the rendered row: the g+s hotkey and command menu entry keep@@ -1275,6 +1293,9 @@ export const AppSidebar = (props: AppSidebarProps) => {.filter((link): link is SidebarItem => link !== undefined));+ const isSectionVisible = (id: SidebarSectionLinkId) =>+ sectionVisibility()[id] ?? DEFAULT_SECTION_VISIBILITY[id];+// While the Getting Started row is hidden (but still account-gated in via// `findLink`), surface it in the account menu so the page stays reachable.const gettingStartedMenuLink = createMemo(() =>@@ -1283,7 +1304,7 @@ export const AppSidebar = (props: AppSidebarProps) => {const sectionItemsFor = (ids: readonly SidebarSectionLinkId[]) =>ids- .filter((id) => sectionVisibility()[id])+ .filter(isSectionVisible).map((id) => findLink(id)).filter((link): link is SidebarItem => link !== undefined).map(toSectionItem);@@ -1293,7 +1314,7 @@ export const AppSidebar = (props: AppSidebarProps) => {const toggleSectionVisibility = (id: SidebarSectionLinkId) => {setSectionVisibility({...sectionVisibility(),- [id]: !sectionVisibility()[id],+ [id]: !isSectionVisible(id),});scheduleMiddleScrollUpdate();};@@ -1318,7 +1339,7 @@ export const AppSidebar = (props: AppSidebarProps) => {.map((link) => ({id: link.id as SidebarSectionLinkId,label: link.label,- checked: sectionVisibility()[link.id as SidebarSectionLinkId],+ checked: isSectionVisible(link.id as SidebarSectionLinkId),}));const tryItems = createMemo<TryCardItem[]>(() => {diff --git a/apps/web/src/components/app/split-layout/componentRegistry.tsx b/apps/web/src/components/app/split-layout/componentRegistry.tsxindex bfd47ac7c0..f514bb0899 100644--- a/apps/web/src/components/app/split-layout/componentRegistry.tsx+++ b/apps/web/src/components/app/split-layout/componentRegistry.tsx@@ -1,3 +1,4 @@+import { useCalendarUiFlag } from '@app/features/calendar/use-calendar-ui-flag';import { GettingStarted } from '@app/features/getting-started';import { Home } from '@app/features/home';import { queryStateFrom } from '@app/features/next-soup/filters/filter-store';@@ -191,6 +192,32 @@ registerComponent(}));+const CalendarView = lazy(() =>+ import('@app/features/calendar/calendar-view').then((module) => ({+ default: module.CalendarView,+ }))+);++function TrackedCalendarView() {+ usePageViewTracking('calendar');+ return <CalendarView />;+}++function CalendarViewWrapper() {+ const calendarUiEnabled = useCalendarUiFlag();++ return (+ <Show+ when={calendarUiEnabled()}+ fallback={<RedirectSplit to={{ type: 'component', id: 'inbox' }} />}+ >+ <TrackedCalendarView />+ </Show>+ );+}++registerComponent('calendar', withAuth(CalendarViewWrapper));+// The Activity tab briefly shipped as two separate views; restored splits// may still reference their ids.registerComponent('firehose', () => (diff --git a/apps/web/src/components/ui/components/Calendar.tsx b/apps/web/src/components/ui/components/Calendar.tsxnew file mode 100644index 0000000000..ef802cccde--- /dev/null+++ b/apps/web/src/components/ui/components/Calendar.tsx@@ -0,0 +1,374 @@+import CorvuCalendar, {+ type RootSingleProps as CorvuCalendarRootSingleProps,+} from '@corvu/calendar';+import ArrowDownIcon from '@phosphor/arrow-down.svg';+import ArrowUpIcon from '@phosphor/arrow-up.svg';+import CaretDownIcon from '@phosphor/caret-down.svg';+import CaretLeftIcon from '@phosphor/caret-left.svg';+import CaretRightIcon from '@phosphor/caret-right.svg';+import CheckIcon from '@phosphor/check.svg';+import {+ createMemo,+ createSignal,+ Index,+ onCleanup,+ onMount,+ Show,+ splitProps,+} from 'solid-js';+import { Virtualizer, type VirtualizerHandle } from 'virtua/solid';+import { cn } from '../utils/classname';+import { Dropdown } from './Dropdown';++const formatWeekdayLong = new Intl.DateTimeFormat(undefined, {+ weekday: 'long',+}).format;+const formatWeekdayNarrow = new Intl.DateTimeFormat(undefined, {+ weekday: 'narrow',+}).format;++type HighlightedRange = { start: Date; end: Date };++const isDateInRange = (date: Date, range: HighlightedRange | undefined) =>+ range !== undefined && date >= range.start && date < range.end;++const offsetDate = (date: Date, days: number) =>+ new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);++const isRangeStart = (date: Date, range: HighlightedRange | undefined) =>+ isDateInRange(date, range) && !isDateInRange(offsetDate(date, -1), range);++const isRangeEnd = (date: Date, range: HighlightedRange | undefined) =>+ isDateInRange(date, range) && !isDateInRange(offsetDate(date, 1), range);++export type CalendarProps = Omit<+ CorvuCalendarRootSingleProps,+ 'children' | 'mode'+> & {+ /** Additional classes applied to the calendar container. */+ class?: string;+ /** Optional end-exclusive date range to highlight. */+ highlightedRange?: HighlightedRange;+};++/** An accessible, single-date calendar styled with the app's semantic tokens. */+export function Calendar(props: CalendarProps) {+ const [local, calendarProps] = splitProps(props, [+ 'class',+ 'highlightedRange',+ ]);+ const initialFallbackDate = calendarProps.value ?? new Date();++ return (+ <CorvuCalendar+ mode="single"+ {...calendarProps}+ initialMonth={calendarProps.initialMonth ?? initialFallbackDate}+ initialFocusedDay={calendarProps.initialFocusedDay ?? initialFallbackDate}+ >+ {(calendar) => (+ <div class={cn('w-full min-w-0 text-ink', local.class)}>+ <div class="flex items-center gap-2">+ <CorvuCalendar.Label class="min-w-0 flex-1">+ <Dropdown placement="bottom-start">+ <Dropdown.Trigger+ aria-label="Choose month"+ class="h-7 max-w-full min-w-0 justify-start gap-1 border-none bg-transparent px-1 text-xs font-medium text-ink hover:bg-hover"+ >+ <span class="min-w-0 truncate">+ {formatCalendarMonth(calendar.month)}+ </span>+ <CaretDownIcon class="size-3 shrink-0 text-ink-muted" />+ </Dropdown.Trigger>+ <Dropdown.Content class="min-w-40 p-1">+ <CalendarMonthMenu+ month={calendar.month}+ onChange={calendar.setMonth}+ />+ </Dropdown.Content>+ </Dropdown>+ </CorvuCalendar.Label>+ <div class="ml-auto flex shrink-0 items-center gap-0.5">+ <CorvuCalendar.Nav+ action="prev-month"+ aria-label="Go to previous month"+ class="flex size-7 items-center justify-center rounded-md text-ink-muted outline-none hover:bg-hover hover:text-ink focus-visible:ring focus-visible:ring-accent"+ >+ <CaretLeftIcon class="size-3" />+ </CorvuCalendar.Nav>+ <CorvuCalendar.Nav+ action="next-month"+ aria-label="Go to next month"+ class="flex size-7 items-center justify-center rounded-md text-ink-muted outline-none hover:bg-hover hover:text-ink focus-visible:ring focus-visible:ring-accent"+ >+ <CaretRightIcon class="size-3" />+ </CorvuCalendar.Nav>+ </div>+ </div>++ <CorvuCalendar.Table class="mt-2 w-full table-fixed border-collapse">+ <thead>+ <tr>+ <Index each={calendar.weekdays}>+ {(weekday) => (+ <CorvuCalendar.HeadCell+ abbr={formatWeekdayLong(weekday())}+ class="h-7 text-center text-[10px] font-medium text-ink-extra-muted"+ >+ {formatWeekdayNarrow(weekday())}+ </CorvuCalendar.HeadCell>+ )}+ </Index>+ </tr>+ </thead>+ <tbody>+ <Index each={calendar.weeks}>+ {(week) => (+ <tr>+ <Index each={week()}>+ {(day) => (+ <CorvuCalendar.Cell+ class="p-0 text-center data-highlighted-range:bg-active data-highlighted-range-start:rounded-l-md data-highlighted-range-end:rounded-r-md"+ data-highlighted-range={+ isDateInRange(day(), local.highlightedRange)+ ? ''+ : undefined+ }+ data-highlighted-range-end={+ isRangeEnd(day(), local.highlightedRange)+ ? ''+ : undefined+ }+ data-highlighted-range-start={+ isRangeStart(day(), local.highlightedRange)+ ? ''+ : undefined+ }+ >+ <CorvuCalendar.CellTrigger+ day={day()}+ data-highlighted-range={+ isDateInRange(day(), local.highlightedRange)+ ? ''+ : undefined+ }+ class="mx-auto flex size-7 items-center justify-center rounded-md text-xs text-ink-muted outline-none hover:bg-hover hover:text-ink focus-visible:ring focus-visible:ring-accent disabled:pointer-events-none disabled:opacity-30 data-today:border data-today:border-accent data-today:font-semibold data-highlighted-range:text-ink data-selected:bg-accent! data-selected:text-surface!"+ >+ {day().getDate()}+ </CorvuCalendar.CellTrigger>+ </CorvuCalendar.Cell>+ )}+ </Index>+ </tr>+ )}+ </Index>+ </tbody>+ </CorvuCalendar.Table>+ </div>+ )}+ </CorvuCalendar>+ );+}++const MONTH_RANGE_YEARS = 100;+const MONTH_OPTION_HEIGHT = 32;++const formatCalendarMonth = new Intl.DateTimeFormat(undefined, {+ month: 'long',+ year: 'numeric',+}).format;++type MonthOption = {+ date: Date;+ label: string;+ value: string;+};++type MonthOptionRange = {+ options: MonthOption[];+ startYear: number;+};++type CalendarMonthMenuProps = {+ month: Date;+ onChange: (month: Date) => void;+};++const monthValue = (date: Date) =>+ `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}`;++const createMonthOptionRange = (+ selectedMonth: Date,+ todayMonth: Date+): MonthOptionRange => {+ const startYear =+ Math.min(selectedMonth.getFullYear(), todayMonth.getFullYear()) -+ MONTH_RANGE_YEARS;+ const endYear =+ Math.max(selectedMonth.getFullYear(), todayMonth.getFullYear()) ++ MONTH_RANGE_YEARS;++ return {+ startYear,+ options: Array.from(+ { length: (endYear - startYear + 1) * 12 },+ (_, offset) => {+ const date = new Date(startYear, offset, 1);++ return {+ date,+ label: formatCalendarMonth(date),+ value: monthValue(date),+ };+ }+ ),+ };+};++const monthIndex = (month: Date, startYear: number) =>+ (month.getFullYear() - startYear) * 12 + month.getMonth();++function CalendarMonthMenu(props: CalendarMonthMenuProps) {+ const now = new Date();+ const todayMonth = new Date(now.getFullYear(), now.getMonth(), 1);+ const todayValue = monthValue(todayMonth);+ const [virtualizer, setVirtualizer] = createSignal<VirtualizerHandle>();+ const [hasScrolled, setHasScrolled] = createSignal(false);+ const [isTodayVisible, setIsTodayVisible] = createSignal(false);+ const [todayDirection, setTodayDirection] = createSignal<'up' | 'down'>(+ props.month > todayMonth ? 'up' : 'down'+ );+ let initialPositionComplete = false;++ const range = createMemo(() =>+ createMonthOptionRange(props.month, todayMonth)+ );+ const options = () => range().options;+ const selectedValue = () => monthValue(props.month);+ const selectedIndex = () => monthIndex(props.month, range().startYear);+ const todayIndex = () => monthIndex(todayMonth, range().startYear);++ const centeredOffset = (index: number) => {+ const handle = virtualizer();+ if (!handle) return index * MONTH_OPTION_HEIGHT;++ return Math.max(+ 0,+ handle.getItemOffset(index) -+ (handle.viewportSize - handle.getItemSize(index)) / 2+ );+ };++ const scrollToIndex = (index: number) => {+ if (index < 0 || index >= options().length) return;+ virtualizer()?.scrollToIndex(index, { align: 'center' });+ };++ const handleScroll = (offset: number) => {+ if (!initialPositionComplete) return;++ const handle = virtualizer();+ const currentTodayIndex = todayIndex();++ if (handle) {+ const todayStart = handle.getItemOffset(currentTodayIndex);+ const todayEnd = todayStart + handle.getItemSize(currentTodayIndex);++ setIsTodayVisible(+ todayEnd > offset && todayStart < offset + handle.viewportSize+ );+ setTodayDirection(+ offset > centeredOffset(currentTodayIndex) ? 'up' : 'down'+ );+ }++ if (+ !hasScrolled() &&+ Math.abs(offset - centeredOffset(selectedIndex())) > 1+ ) {+ setHasScrolled(true);+ }+ };++ onMount(() => {+ let positionedFrame: number | undefined;+ const frame = requestAnimationFrame(() => {+ scrollToIndex(selectedIndex());+ positionedFrame = requestAnimationFrame(() => {+ initialPositionComplete = true;+ });+ });++ onCleanup(() => {+ cancelAnimationFrame(frame);+ if (positionedFrame !== undefined) cancelAnimationFrame(positionedFrame);+ });+ });++ return (+ <div class="relative">+ <Dropdown.RadioGroup+ value={selectedValue()}+ onChange={(value) => {+ const option = options().find(+ (candidate) => candidate.value === value+ );+ if (option) props.onChange(option.date);+ }}+ >+ <div+ class="h-72 overflow-y-auto overscroll-contain"+ style={{ contain: 'strict' }}+ >+ <Virtualizer+ data={options()}+ itemSize={MONTH_OPTION_HEIGHT}+ onScroll={handleScroll}+ ref={setVirtualizer}+ >+ {(option) => (+ <Dropdown.RadioItem+ aria-current={option.value === todayValue ? 'date' : undefined}+ class="h-8 text-xs"+ closeOnSelect+ value={option.value}+ >+ <span+ aria-hidden="true"+ class="flex size-2 shrink-0 items-center justify-center"+ >+ <Show when={option.value === todayValue}>+ <span class="size-1.5 rounded-full bg-accent" />+ </Show>+ </span>+ <span>{option.label}</span>+ <Dropdown.ItemIndicator class="ml-auto">+ <CheckIcon class="size-3.5 text-accent" />+ </Dropdown.ItemIndicator>+ </Dropdown.RadioItem>+ )}+ </Virtualizer>+ </div>+ </Dropdown.RadioGroup>++ <Show when={hasScrolled() && !isTodayVisible()}>+ <div class="pointer-events-none absolute inset-x-0 bottom-2 z-10 flex justify-center">+ <Dropdown.Item+ class="pointer-events-auto w-auto min-w-16 justify-center rounded-full border border-edge-muted bg-surface px-3 text-xs shadow-menu hover:bg-active data-highlighted:bg-active"+ closeOnSelect={false}+ data-direction={todayDirection()}+ onSelect={() => scrollToIndex(todayIndex())}+ >+ <Show+ when={todayDirection() === 'up'}+ fallback={<ArrowDownIcon aria-hidden="true" class="size-3" />}+ >+ <ArrowUpIcon aria-hidden="true" class="size-3" />+ </Show>+ Today+ </Dropdown.Item>+ </div>+ </Show>+ </div>+ );+}diff --git a/apps/web/src/components/ui/index.ts b/apps/web/src/components/ui/index.tsindex 9d29081871..0964a01c46 100644--- a/apps/web/src/components/ui/index.ts+++ b/apps/web/src/components/ui/index.ts@@ -11,6 +11,8 @@ export { Avatar, AvatarGroup } from './components/Avatar';export type { ButtonProps } from './components/Button';export { Button } from './components/Button';export { ButtonGroup } from './components/ButtonGroup';+export type { CalendarProps } from './components/Calendar';+export { Calendar } from './components/Calendar';export type { ChatInputProps, ChatInputRows } from './components/ChatInput';export type { CheckboxProps } from './components/Checkbox';export {diff --git a/apps/web/src/features/calendar/CalendarPeriodSelector.tsx b/apps/web/src/features/calendar/CalendarPeriodSelector.tsxnew file mode 100644index 0000000000..d422fb3b95--- /dev/null+++ b/apps/web/src/features/calendar/CalendarPeriodSelector.tsx@@ -0,0 +1,140 @@+import { useSidePanel } from '@components/app/side-panel/SidePanel';+import CalendarIcon from '@phosphor/calendar-blank.svg';+import CaretDownIcon from '@phosphor/caret-down.svg';+import CaretRightIcon from '@phosphor/caret-right.svg';+import CheckIcon from '@phosphor/check.svg';+import { Dropdown, Calendar as MiniCalendar } from '@ui';+import { createMemo, For, Show } from 'solid-js';+import { createStore } from 'solid-js/store';+import { useCalendarView } from './CalendarViewContext';+import { useFullCalendar } from './fullcalendar-solid';++const CALENDAR_VIEWS = [+ { value: 'dayGridMonth', label: 'Month' },+ { value: 'timeGridWeek', label: 'Week' },+ { value: 'timeGridDay', label: 'Day' },+];++/** Selects the FullCalendar period and provides narrow custom-date navigation. */+export function CalendarPeriodSelector() {+ const calendarView = useCalendarView();+ const calendar = useFullCalendar();+ const sidePanel = useSidePanel();+ const initialDate = new Date();+ const [pickerState, setPickerState] = createStore({+ open: false,+ month: initialDate,+ focusedDay: initialDate,+ });++ const isNarrow = () => sidePanel?.isNarrow() ?? false;+ const currentDate = createMemo(+ () => calendar.dateInfo()?.view.calendar.getDate() ?? initialDate+ );++ const activeView = createMemo(+ () => calendar.dateInfo()?.view.type ?? 'dayGridMonth'+ );++ const highlightedRange = createMemo(() => {+ const dateInfo = calendar.dateInfo();+ return dateInfo?.view.type === 'timeGridWeek'+ ? { end: dateInfo.end, start: dateInfo.start }+ : undefined;+ });++ const changeView = (view: string) => {+ setPickerState('open', false);+ const calendarApi = calendar.api();+ if (calendarApi?.view.type === view) return;+ calendarApi?.changeView(view);+ };++ const syncCustomDatePicker = () => {+ const date = currentDate();+ setPickerState({ month: date, focusedDay: date });+ };++ const navigateCustomDateMonth = (month: Date) => {+ const focusedDay = pickerState.focusedDay;+ const targetDate =+ focusedDay.getFullYear() === month.getFullYear() &&+ focusedDay.getMonth() === month.getMonth()+ ? focusedDay+ : month;+ setPickerState({ month, focusedDay: targetDate });+ };++ const selectCustomDate = (date: Date | null) => {+ if (!date) return;+ setPickerState({ month: date, focusedDay: date, open: false });+ calendar.api()?.gotoDate(date);+ };++ return (+ <Dropdown+ open={pickerState.open}+ onOpenChange={(open) => setPickerState('open', open)}+ placement="bottom-end"+ >+ <Dropdown.Trigger+ depth={2}+ aria-label="Choose calendar view"+ class="h-7 shrink-0 gap-1 rounded-lg border-edge-muted bg-panel px-2 text-xs font-medium text-ink"+ >+ {CALENDAR_VIEWS.find((view) => view.value === activeView())?.label ??+ 'Month'}+ <CaretDownIcon class="size-3 text-ink-muted" />+ </Dropdown.Trigger>+ <Dropdown.Content class="min-w-36">+ <Dropdown.Group>+ <Dropdown.RadioGroup value={activeView()} onChange={changeView}>+ <For each={CALENDAR_VIEWS}>+ {(view) => (+ <Dropdown.RadioItem closeOnSelect value={view.value}>+ <span class="flex-1">{view.label}</span>+ <Dropdown.ItemIndicator>+ <CheckIcon class="size-3.5 text-accent" />+ </Dropdown.ItemIndicator>+ </Dropdown.RadioItem>+ )}+ </For>+ </Dropdown.RadioGroup>+ </Dropdown.Group>+ <Show when={isNarrow()}>+ <Dropdown.Group>+ <Dropdown.Sub+ onOpenChange={(open) => {+ if (open) syncCustomDatePicker();+ }}+ >+ <Dropdown.SubTrigger>+ <CalendarIcon class="size-3.5 text-ink-muted" />+ <span class="flex-1">Custom date…</span>+ <CaretRightIcon class="size-3 text-ink-muted" />+ </Dropdown.SubTrigger>+ <Dropdown.SubContent class="w-72 max-w-[calc(100vw-1rem)]">+ <Dropdown.Group class="p-3">+ <MiniCalendar+ required+ fixedWeeks+ startOfWeek={calendarView.displaySettings.weekStartsOn}+ value={currentDate()}+ month={pickerState.month}+ focusedDay={pickerState.focusedDay}+ highlightedRange={highlightedRange()}+ onMonthChange={navigateCustomDateMonth}+ onFocusedDayChange={(date) =>+ setPickerState('focusedDay', date)+ }+ onValueChange={selectCustomDate}+ />+ </Dropdown.Group>+ </Dropdown.SubContent>+ </Dropdown.Sub>+ </Dropdown.Group>+ </Show>+ </Dropdown.Content>+ </Dropdown>+ );+}diff --git a/apps/web/src/features/calendar/CalendarSettingsDropdown.tsx b/apps/web/src/features/calendar/CalendarSettingsDropdown.tsxnew file mode 100644index 0000000000..efb836d835--- /dev/null+++ b/apps/web/src/features/calendar/CalendarSettingsDropdown.tsx@@ -0,0 +1,183 @@+import { useSidePanel } from '@components/app/side-panel/SidePanel';+import CaretRightIcon from '@phosphor/caret-right.svg';+import CheckIcon from '@phosphor/check.svg';+import GearIcon from '@phosphor/gear.svg';+import { Dropdown } from '@ui';+import { createMemo, For, Show } from 'solid-js';+import { useCalendarView } from './CalendarViewContext';+import type { CalendarTimeFormat, CalendarWeekStart } from './events/types';++const WEEK_START_OPTIONS: Array<{+ value: CalendarWeekStart;+ label: string;+}> = [+ { value: 0, label: 'Sunday' },+ { value: 1, label: 'Monday' },+];++const TIME_FORMAT_OPTIONS: Array<{+ value: CalendarTimeFormat;+ label: string;+}> = [+ { value: '12-hour', label: '12-hour' },+ { value: '24-hour', label: '24-hour' },+];++/** Calendar display settings with source visibility on narrow layouts. */+export function CalendarSettingsDropdown() {+ const calendarView = useCalendarView();+ const sidePanel = useSidePanel();++ const showCalendarVisibility = () => sidePanel?.isNarrow() ?? false;+ const weekStartLabel = createMemo(+ () =>+ WEEK_START_OPTIONS.find(+ (option) => option.value === calendarView.displaySettings.weekStartsOn+ )?.label ?? 'Sunday'+ );++ const timeFormatLabel = createMemo(+ () =>+ TIME_FORMAT_OPTIONS.find(+ (option) => option.value === calendarView.displaySettings.timeFormat+ )?.label ?? '12-hour'+ );++ const changeSourceVisibility = (sourceId: string, visible: boolean) => {+ calendarView.closeEventDetails();+ calendarView.setSourceVisibility(sourceId, visible);+ };++ const changeShowWeekends = (showWeekends: boolean) => {+ calendarView.closeEventDetails();+ calendarView.setShowWeekends(showWeekends);+ };++ const changeWeekStartsOn = (weekStartsOn: CalendarWeekStart) => {+ calendarView.closeEventDetails();+ calendarView.setWeekStartsOn(weekStartsOn);+ };++ const changeTimeFormat = (timeFormat: CalendarTimeFormat) => {+ calendarView.closeEventDetails();+ calendarView.setTimeFormat(timeFormat);+ };++ return (+ <Dropdown placement="bottom-end">+ <Dropdown.Trigger+ variant="ghost"+ size="icon-sm"+ class="h-7 w-7 shrink-0 rounded-lg"+ label="Calendar settings"+ >+ <GearIcon class="size-3.5" />+ </Dropdown.Trigger>+ <Dropdown.Content class="w-60 max-w-[calc(100vw-1rem)]">+ <Show when={showCalendarVisibility()}>+ <Dropdown.Group>+ <Dropdown.GroupLabel>Calendars</Dropdown.GroupLabel>+ <For each={calendarView.sources()}>+ {(source) => (+ <Dropdown.CheckboxItem+ checked={calendarView.isSourceVisible(source.id)}+ closeOnSelect={false}+ onChange={(checked) =>+ changeSourceVisibility(source.id, checked)+ }+ >+ <span+ aria-hidden="true"+ class="size-2.5 shrink-0 rounded-sm"+ style={{ 'background-color': source.color }}+ />+ <span class="min-w-0 flex-1 truncate">{source.name}</span>+ </Dropdown.CheckboxItem>+ )}+ </For>+ </Dropdown.Group>+ </Show>++ <Dropdown.Group>+ <Dropdown.GroupLabel>Display</Dropdown.GroupLabel>+ <Dropdown.CheckboxItem+ checked={calendarView.displaySettings.showWeekends}+ closeOnSelect={false}+ onChange={changeShowWeekends}+ >+ <span class="flex-1 truncate">Show weekends</span>+ </Dropdown.CheckboxItem>++ <Dropdown.Sub>+ <Dropdown.SubTrigger>+ <span class="min-w-0 flex-1 truncate text-xs text-ink-muted">+ Week starts on+ </span>+ <span class="text-sm font-medium text-ink">+ {weekStartLabel()}+ </span>+ <CaretRightIcon class="size-3 shrink-0 text-ink-muted" />+ </Dropdown.SubTrigger>+ <Dropdown.SubContent class="min-w-36">+ <Dropdown.Group>+ <Dropdown.RadioGroup+ value={String(calendarView.displaySettings.weekStartsOn)}+ onChange={(value) =>+ changeWeekStartsOn(Number(value) as CalendarWeekStart)+ }+ >+ <For each={WEEK_START_OPTIONS}>+ {(option) => (+ <Dropdown.RadioItem+ closeOnSelect+ value={String(option.value)}+ >+ <span class="flex-1">{option.label}</span>+ <Dropdown.ItemIndicator>+ <CheckIcon class="size-3.5 text-accent" />+ </Dropdown.ItemIndicator>+ </Dropdown.RadioItem>+ )}+ </For>+ </Dropdown.RadioGroup>+ </Dropdown.Group>+ </Dropdown.SubContent>+ </Dropdown.Sub>++ <Dropdown.Sub>+ <Dropdown.SubTrigger>+ <span class="min-w-0 flex-1 truncate text-xs text-ink-muted">+ Time format+ </span>+ <span class="text-sm font-medium text-ink">+ {timeFormatLabel()}+ </span>+ <CaretRightIcon class="size-3 shrink-0 text-ink-muted" />+ </Dropdown.SubTrigger>+ <Dropdown.SubContent class="min-w-36">+ <Dropdown.Group>+ <Dropdown.RadioGroup+ value={calendarView.displaySettings.timeFormat}+ onChange={(value) =>+ changeTimeFormat(value as CalendarTimeFormat)+ }+ >+ <For each={TIME_FORMAT_OPTIONS}>+ {(option) => (+ <Dropdown.RadioItem closeOnSelect value={option.value}>+ <span class="flex-1">{option.label}</span>+ <Dropdown.ItemIndicator>+ <CheckIcon class="size-3.5 text-accent" />+ </Dropdown.ItemIndicator>+ </Dropdown.RadioItem>+ )}+ </For>+ </Dropdown.RadioGroup>+ </Dropdown.Group>+ </Dropdown.SubContent>+ </Dropdown.Sub>+ </Dropdown.Group>+ </Dropdown.Content>+ </Dropdown>+ );+}diff --git a/apps/web/src/features/calendar/CalendarSidePanelSections.tsx b/apps/web/src/features/calendar/CalendarSidePanelSections.tsxnew file mode 100644index 0000000000..0b46d12793--- /dev/null+++ b/apps/web/src/features/calendar/CalendarSidePanelSections.tsx@@ -0,0 +1,149 @@+import { SidePanel, useSidePanel } from '@components/app/side-panel/SidePanel';+import CloseIcon from '@phosphor/x.svg';+import { Button, Calendar as MiniCalendar } from '@ui';+import { createEffect, createMemo, createSignal, on, Show } from 'solid-js';+import { useCalendarView } from './CalendarViewContext';+import { CalendarControls } from './events/CalendarControls';+import { EventDetails } from './events/EventDetails';+import { useFullCalendar } from './fullcalendar-solid';++function CalendarEventSidePanelSection() {+ const calendarView = useCalendarView();+ const sidePanel = useSidePanel();++ createEffect(+ on(+ () => [calendarView.selectedEvent()?.id, sidePanel?.isNarrow()] as const,+ ([eventId, isNarrow]) => {+ if (!eventId || !sidePanel || isNarrow) return;++ sidePanel.setIsOpen(true);+ if (!sidePanel.openSectionIds().includes('calendar-event')) {+ sidePanel.setOpenSectionIds([+ ...sidePanel.openSectionIds(),+ 'calendar-event',+ ]);+ }+ }+ )+ );++ return (+ <Show when={calendarView.selectedEvent()}>+ {(event) => (+ <SidePanel.Section+ id="calendar-event"+ title="Event"+ order={0}+ defaultOpen+ actions={+ <Button+ variant="ghost"+ size="icon-sm"+ label="Close event details"+ onClick={calendarView.closeEventDetails}+ >+ <CloseIcon class="size-3.5" />+ </Button>+ }+ >+ <EventDetails+ event={event()}+ timeFormat={calendarView.displaySettings.timeFormat}+ />+ </SidePanel.Section>+ )}+ </Show>+ );+}++function CalendarMiniCalendarSidePanelSection() {+ const calendarView = useCalendarView();+ const calendar = useFullCalendar();+ const initialDate = new Date();+ const [focusedDay, setFocusedDay] = createSignal(initialDate);++ const currentDate = createMemo(+ () => calendar.dateInfo()?.view.calendar.getDate() ?? initialDate+ );++ const highlightedRange = createMemo(() => {+ const dateInfo = calendar.dateInfo();+ return dateInfo?.view.type === 'timeGridWeek'+ ? { end: dateInfo.end, start: dateInfo.start }+ : undefined;+ });++ const selectDate = (date: Date | null) => {+ if (!date) return;+ setFocusedDay(date);+ calendar.api()?.gotoDate(date);+ };++ const navigateMonth = (month: Date) => {+ const focused = focusedDay();+ const targetDate =+ focused.getFullYear() === month.getFullYear() &&+ focused.getMonth() === month.getMonth()+ ? focused+ : month;+ setFocusedDay(targetDate);+ calendar.api()?.gotoDate(targetDate);+ };++ createEffect(on(currentDate, setFocusedDay));++ return (+ <SidePanel.Section+ id="calendar-mini-calendar"+ title="Calendar"+ order={10}+ defaultOpen+ >+ <MiniCalendar+ required+ fixedWeeks+ startOfWeek={calendarView.displaySettings.weekStartsOn}+ value={currentDate()}+ month={currentDate()}+ focusedDay={focusedDay()}+ highlightedRange={highlightedRange()}+ onMonthChange={navigateMonth}+ onFocusedDayChange={setFocusedDay}+ onValueChange={selectDate}+ />+ </SidePanel.Section>+ );+}++function CalendarSourcesSidePanelSection() {+ const calendarView = useCalendarView();++ return (+ <SidePanel.Section+ id="calendar-controls"+ title="Calendars"+ order={20}+ defaultOpen+ >+ <CalendarControls+ sources={calendarView.sources()}+ isVisible={calendarView.isSourceVisible}+ onVisibilityChange={calendarView.setSourceVisibility}+ />+ </SidePanel.Section>+ );+}++/** Registers the calendar's contextual right-side panel sections. */+export function CalendarSidePanelSections() {+ const sidePanel = useSidePanel();++ return (+ <Show when={!sidePanel?.isNarrow()}>+ <CalendarEventSidePanelSection />+ <CalendarMiniCalendarSidePanelSection />+ <CalendarSourcesSidePanelSection />+ </Show>+ );+}diff --git a/apps/web/src/features/calendar/CalendarViewContext.tsx b/apps/web/src/features/calendar/CalendarViewContext.tsxnew file mode 100644index 0000000000..c1c7bd7a8e--- /dev/null+++ b/apps/web/src/features/calendar/CalendarViewContext.tsx@@ -0,0 +1,185 @@+import { createAssertedContextProvider } from '@core/context/createContext';+import type { EventDropArg } from '@fullcalendar/core';+import type { EventResizeDoneArg } from '@fullcalendar/interaction';+import { createMemo, createSignal } from 'solid-js';+import { createStore } from 'solid-js/store';+import { mapCalendarEventToFullCalendar } from './events/event-mapper';+import type {+ CalendarEvent,+ CalendarSource,+ CalendarTimeFormat,+ CalendarWeekStart,+} from './events/types';+import { getDefaultCalendarTimeFormat } from './time-format';++interface CalendarEventState {+ visibleSourceIds: string[];+ selectedEventId: string | undefined;+}++interface CalendarDisplaySettings {+ showWeekends: boolean;+ weekStartsOn: CalendarWeekStart;+ timeFormat: CalendarTimeFormat;+}++export const [CalendarViewContextProvider, useCalendarView] =+ createAssertedContextProvider('CalendarViewContext', () => {+ const [eventData, setEventData] = createSignal<+ CalendarEvent[] | undefined+ >();++ const [eventState, setEventState] = createStore<CalendarEventState>({+ visibleSourceIds: [],+ selectedEventId: undefined,+ });++ const [displaySettings, setDisplaySettings] =+ createStore<CalendarDisplaySettings>({+ showWeekends: true,+ weekStartsOn: 0,+ timeFormat: getDefaultCalendarTimeFormat(),+ });++ const [sources, setSources] = createSignal<CalendarSource[]>([]);+ const [selectedEventAnchor, setSelectedEventAnchor] =+ createSignal<HTMLElement>();+ const [useNarrowDayHeaders, setUseNarrowDayHeaders] = createSignal(false);++ const events = createMemo(() => eventData() ?? []);+ const eventsById = createMemo(+ () => new Map(events().map((event) => [event.id, event]))+ );+ const selectedEvent = createMemo(() => {+ const eventId = eventState.selectedEventId;+ return eventId ? eventsById().get(eventId) : undefined;+ });+ const visibleEvents = createMemo(() =>+ events().filter((event) =>+ eventState.visibleSourceIds.includes(event.calendar.id)+ )+ );+ const fullCalendarEvents = createMemo(() =>+ visibleEvents().map(mapCalendarEventToFullCalendar)+ );++ const isSourceVisible = (sourceId: string) =>+ eventState.visibleSourceIds.includes(sourceId);++ const replaceEvents = (nextEvents: CalendarEvent[]) => {+ setEventData(nextEvents);++ const nextSources = new Map(+ sources().map((source) => [source.id, source])+ );++ for (const event of nextEvents) {+ nextSources.set(event.calendar.id, event.calendar);+ }++ replaceSources([...nextSources.values()]);++ if (+ eventState.selectedEventId &&+ !nextEvents.some((event) => event.id === eventState.selectedEventId)+ ) {+ setEventState('selectedEventId', undefined);+ setSelectedEventAnchor(undefined);+ }+ };++ const replaceSources = (nextSources: CalendarSource[]) => {+ const knownSourceIds = sources().map((source) => source.id);++ setSources(nextSources);+ setEventState('visibleSourceIds', (current) => {+ const next = [...current];++ for (const source of nextSources) {+ if (+ !knownSourceIds.includes(source.id) &&+ !next.includes(source.id)+ ) {+ next.push(source.id);+ }+ }++ return next;+ });+ };++ const closeEventDetails = () => {+ setEventState('selectedEventId', undefined);+ setSelectedEventAnchor(undefined);+ };++ const setSourceVisibility = (sourceId: string, visible: boolean) => {+ setEventState('visibleSourceIds', (current) => {+ if (visible) {+ return current.includes(sourceId) ? current : [...current, sourceId];+ }++ return current.filter((id) => id !== sourceId);+ });++ if (!visible && selectedEvent()?.calendar.id === sourceId) {+ closeEventDetails();+ }+ };++ const updateEventDates = ({+ event,+ revert,+ }: EventDropArg | EventResizeDoneArg) => {+ if (!eventsById().has(event.id) || !event.startStr || !event.endStr) {+ revert();+ return;+ }++ closeEventDetails();+ setEventData((current) =>+ (current ?? []).map((calendarEvent) =>+ calendarEvent.id === event.id+ ? {+ ...calendarEvent,+ start: event.startStr,+ end: event.endStr,+ allDay: event.allDay,+ }+ : calendarEvent+ )+ );+ };++ const selectEvent = (eventId: string, anchor: HTMLElement) => {+ setEventState('selectedEventId', eventId);+ setSelectedEventAnchor(anchor);+ };++ return {+ eventData,+ eventState,+ displaySettings,+ events,+ sources,+ eventsById,+ selectedEvent,+ fullCalendarEvents,+ isSourceVisible,+ selectedEventAnchor,+ useNarrowDayHeaders,+ setUseNarrowDayHeaders,+ replaceEvents,+ replaceSources,+ setShowWeekends: (showWeekends: boolean) =>+ setDisplaySettings('showWeekends', showWeekends),+ setWeekStartsOn: (weekStartsOn: CalendarWeekStart) =>+ setDisplaySettings('weekStartsOn', weekStartsOn),+ setTimeFormat: (timeFormat: CalendarTimeFormat) =>+ setDisplaySettings('timeFormat', timeFormat),+ closeEventDetails,+ setSourceVisibility,+ updateEventDates,+ selectEvent,+ };+ });diff --git a/apps/web/src/features/calendar/calendar-view.tsx b/apps/web/src/features/calendar/calendar-view.tsxnew file mode 100644index 0000000000..c478e7a5e1--- /dev/null+++ b/apps/web/src/features/calendar/calendar-view.tsx@@ -0,0 +1,443 @@+import { SidePanel, useSidePanel } from '@components/app/side-panel/SidePanel';+import { HeaderIsland } from '@components/app/split-layout/components/HeaderIsland';+import {+ SplitHeaderLeft,+ SplitHeaderRight,+} from '@components/app/split-layout/components/SplitHeader';+import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';+import type { DatesSetArg } from '@fullcalendar/core';+import dayGridPlugin from '@fullcalendar/daygrid';+import interactionPlugin from '@fullcalendar/interaction';+import timeGridPlugin from '@fullcalendar/timegrid';+import CaretLeftIcon from '@phosphor/caret-left.svg';+import CaretRightIcon from '@phosphor/caret-right.svg';+import { Button, Layer } from '@ui';+import {+ type Accessor,+ createEffect,+ createMemo,+ createSignal,+ on,+ onCleanup,+ onMount,+ Show,+} from 'solid-js';+import { CalendarPeriodSelector } from './CalendarPeriodSelector';+import { CalendarSettingsDropdown } from './CalendarSettingsDropdown';+import { CalendarSidePanelSections } from './CalendarSidePanelSections';+import {+ CalendarViewContextProvider,+ useCalendarView,+} from './CalendarViewContext';+import { CalendarEventContent } from './events/EventContent';+import { EventDetailsPopover } from './events/EventDetailsPopover';+import type { CalendarTimeFormat } from './events/types';+import { FullCalendar, useFullCalendar } from './fullcalendar-solid';+import {+ CALENDAR_TIME_FORMAT_OPTIONS,+ formatCalendarTime,+} from './time-format';+import { useCalendarTimeGridHoverIndicator } from './useCalendarTimeGridHoverIndicator';+import './calendar.css';++const formatMonthTitle = new Intl.DateTimeFormat(undefined, {+ month: 'long',+ year: 'numeric',+}).format;++const formatWeekdayHeader = {+ narrow: new Intl.DateTimeFormat(undefined, {+ weekday: 'narrow',+ }).format,+ short: new Intl.DateTimeFormat(undefined, {+ weekday: 'short',+ }).format,+};++const formatDayNumber = new Intl.DateTimeFormat(undefined, {+ day: 'numeric',+}).format;++const isSameLocalDate = (first: Date, second: Date) =>+ first.getFullYear() === second.getFullYear() &&+ first.getMonth() === second.getMonth() &&+ first.getDate() === second.getDate();++function CurrentTimeAxisIndicator(props: {+ date: Date;+ timeFormat: CalendarTimeFormat;+}) {+ return (+ <span class="calendar-now-axis-indicator">+ <span class="calendar-now-time">+ {formatCalendarTime(props.date, props.timeFormat)}+ </span>+ </span>+ );+}++function getLocalScrollTime() {+ const now = new Date();+ const minutesSinceMidnight = now.getHours() * 60 + now.getMinutes();+ const scrollMinutes = Math.max(+ 0,+ Math.floor((minutesSinceMidnight - 60) / 30) * 30+ );+ const hours = Math.floor(scrollMinutes / 60);+ const minutes = scrollMinutes % 60;++ return `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:00`;+}++function useCalendarScrollFades(+ calendarElement: Accessor<HTMLElement | undefined>+) {+ createEffect(+ on(calendarElement, (element) => {+ if (!element) return;++ const handleCalendarScroll = (event: Event) => {+ const scroller = event.target;+ if (!(scroller instanceof HTMLElement)) return;++ const harness = scroller.closest<HTMLElement>(+ '.fc-scroller-harness-liquid'+ );+ if (!harness || scroller.parentElement !== harness) return;++ harness.toggleAttribute(+ 'data-scrolled-from-top',+ scroller.scrollTop > 1+ );+ };++ element.addEventListener('scroll', handleCalendarScroll, true);++ onCleanup(() => {+ element.removeEventListener('scroll', handleCalendarScroll, true);+ });+ })+ );+}++function ResponsiveCalendarHost() {+ const calendar = useFullCalendar();+ const calendarView = useCalendarView();+ const [element, setElement] = createSignal<HTMLDivElement>();++ useCalendarTimeGridHoverIndicator(element);+ useCalendarScrollFades(element);++ createEffect(+ on(+ () => [element(), calendar.api()] as const,+ ([calendarElement, calendarApi]) => {+ if (!calendarElement || !calendarApi) return;++ let observedWidth = calendarElement.clientWidth;+ let resizeFrame: number | undefined;+ const resizeObserver = new ResizeObserver(([entry]) => {+ observedWidth =+ entry?.contentRect.width ?? calendarElement.clientWidth;++ if (resizeFrame !== undefined) cancelAnimationFrame(resizeFrame);++ resizeFrame = requestAnimationFrame(() => {+ resizeFrame = undefined;+ calendarView.setUseNarrowDayHeaders(observedWidth < 520);+ calendarApi.updateSize();+ });+ });++ resizeObserver.observe(calendarElement);++ onCleanup(() => {+ resizeObserver.disconnect();++ if (resizeFrame !== undefined) cancelAnimationFrame(resizeFrame);+ });+ }+ )+ );++ return (+ <Layer depth={2}>+ <FullCalendar.Host+ tabIndex={-1}+ ref={(calendarElement) => {+ setElement(calendarElement);+ calendarView.setUseNarrowDayHeaders(+ calendarElement.clientWidth < 520+ );+ }}+ class="calendar-view-host min-w-0 min-h-0 flex-1 overflow-hidden rounded-xl"+ />+ </Layer>+ );+}++/** A calendar-focused workspace view backed by FullCalendar. */+export function CalendarView() {+ return (+ <CalendarViewContextProvider>+ <CalendarViewContent />+ </CalendarViewContextProvider>+ );+}++function CalendarViewContent() {+ const calendarView = useCalendarView();+ let visibleRangeKey: string | undefined;++ const handleDatesSet = ({ end, start, view }: DatesSetArg) => {+ const nextRangeKey = `${view.type}:${start.toISOString()}:${end.toISOString()}`;+ if (visibleRangeKey !== undefined && visibleRangeKey !== nextRangeKey) {+ calendarView.closeEventDetails();+ }+ visibleRangeKey = nextRangeKey;+ };++ return (+ <FullCalendar.Root+ plugins={[dayGridPlugin, interactionPlugin, timeGridPlugin]}+ initialView="dayGridMonth"+ height="100%"+ expandRows+ fixedWeekCount={false}+ handleWindowResize={false}+ allDayText="All day"+ nowIndicator+ headerToolbar={false}+ scrollTime={getLocalScrollTime()}+ scrollTimeReset={false}+ weekends={calendarView.displaySettings.showWeekends}+ firstDay={calendarView.displaySettings.weekStartsOn}+ slotLabelFormat={+ CALENDAR_TIME_FORMAT_OPTIONS[calendarView.displaySettings.timeFormat]+ }+ eventTimeFormat={+ CALENDAR_TIME_FORMAT_OPTIONS[calendarView.displaySettings.timeFormat]+ }+ eventStartEditable+ eventDurationEditable+ eventResizableFromStart+ events={calendarView.fullCalendarEvents()}+ eventDragStart={calendarView.closeEventDetails}+ eventDrop={calendarView.updateEventDates}+ eventResizeStart={calendarView.closeEventDetails}+ eventResize={calendarView.updateEventDates}+ eventClick={({ el, event, jsEvent }) => {+ jsEvent.preventDefault();+ calendarView.selectEvent(event.id, el);+ }}+ datesSet={handleDatesSet}+ dayHeaderFormat={{+ weekday: calendarView.useNarrowDayHeaders() ? 'narrow' : 'short',+ }}+ dayCellClassNames={({ date, view }) =>+ isSameLocalDate(date, view.calendar.getDate())+ ? ['calendar-day-selected']+ : []+ }+ >+ <FullCalendar.DayHeaderContent>+ {({ date, text, view }) => {+ if (view.type === 'timeGridWeek' || view.type === 'timeGridDay') {+ const weekday =+ view.type === 'timeGridDay'+ ? formatWeekdayHeader.short(date)+ : formatWeekdayHeader[+ calendarView.useNarrowDayHeaders() ? 'narrow' : 'short'+ ](date);++ return (+ <>+ <span class="calendar-day-header-weekday">{weekday}</span>{' '}+ <span+ class="calendar-day-header-date"+ classList={{+ 'calendar-day-header-date-selected': isSameLocalDate(+ date,+ view.calendar.getDate()+ ),+ }}+ >+ {formatDayNumber(date)}+ </span>+ </>+ );+ }+ return text;+ }}+ </FullCalendar.DayHeaderContent>++ <FullCalendar.EventContent>+ {(renderProps) => {+ const event = calendarView.eventsById().get(renderProps.event.id);+ if (!event) return null;++ return (+ <CalendarEventContent event={event} renderProps={renderProps} />+ );+ }}+ </FullCalendar.EventContent>++ <FullCalendar.NowIndicatorContent>+ {({ isAxis, view }) => {+ if (isAxis) {+ return view.type === 'timeGridWeek' ? (+ <span+ aria-hidden="true"+ class="calendar-now-axis-indicator calendar-now-axis-indicator-gutter"+ />+ ) : null;+ }++ return (+ <CurrentTimeAxisIndicator+ date={new Date()}+ timeFormat={calendarView.displaySettings.timeFormat}+ />+ );+ }}+ </FullCalendar.NowIndicatorContent>++ <SidePanel.Layout>+ <CalendarWorkspace />+ </SidePanel.Layout>+ </FullCalendar.Root>+ );+}++function createLocalToday() {+ const [today, setToday] = createSignal(new Date());+ let refreshTimer: number | undefined;++ const scheduleRefresh = () => {+ const now = new Date();+ const nextMidnight = new Date(now);+ nextMidnight.setDate(nextMidnight.getDate() + 1);+ nextMidnight.setHours(0, 0, 0, 0);++ refreshTimer = window.setTimeout(+ () => {+ setToday(new Date());+ scheduleRefresh();+ },+ nextMidnight.getTime() - now.getTime() + 100+ );+ };++ scheduleRefresh();++ onCleanup(() => {+ if (refreshTimer !== undefined) clearTimeout(refreshTimer);+ });++ return today;+}++function CalendarWorkspace() {+ const panel = useSplitPanelOrThrow();+ const sidePanel = useSidePanel();+ const calendar = useFullCalendar();+ const calendarView = useCalendarView();+ const initialDate = new Date();+ const today = createLocalToday();++ const isNarrow = () => sidePanel?.isNarrow() ?? false;+ const currentDate = createMemo(+ () => calendar.dateInfo()?.view.calendar.getDate() ?? initialDate+ );+ const dateTitle = createMemo(() => formatMonthTitle(currentDate()));+ const visibleRange = createMemo(() => {+ const dateInfo = calendar.dateInfo();+ return dateInfo ? { end: dateInfo.end, start: dateInfo.start } : undefined;+ });+ const isTodayVisible = createMemo(() => {+ const range = visibleRange();+ if (!range) return true;++ const currentDay = today();+ return currentDay >= range.start && currentDay < range.end;+ });++ onMount(() => panel.handle.setDisplayName('Calendar'));++ return (+ <>+ <SplitHeaderLeft>+ <HeaderIsland class="shrink">+ <div class="flex min-w-0 items-center gap-2">+ <span class="min-w-0 truncate text-base font-semibold text-ink">+ {dateTitle()}+ </span>+ <Show when={!isTodayVisible()}>+ <Button+ variant="active"+ size="sm"+ class="h-7 rounded-lg px-3"+ depth={2}+ label="Go to today"+ onClick={() => calendar.api()?.today()}+ >+ Today+ </Button>+ </Show>+ </div>+ </HeaderIsland>+ </SplitHeaderLeft>++ <SplitHeaderRight>+ <HeaderIsland class="px-1">+ <div class="flex items-center gap-1">+ <CalendarPeriodSelector />+ <div class="flex shrink-0 items-center gap-1">+ <Button+ variant="ghost"+ size="icon-sm"+ class="size-7 rounded-lg [&_svg]:size-4!"+ label="Previous period"+ onClick={() => calendar.api()?.prev()}+ >+ <CaretLeftIcon class="size-4" />+ </Button>+ <Button+ variant="ghost"+ size="icon-sm"+ class="size-7 rounded-lg [&_svg]:size-4!"+ label="Next period"+ onClick={() => calendar.api()?.next()}+ >+ <CaretRightIcon class="size-4" />+ </Button>+ </div>+ <CalendarSettingsDropdown />+ </div>+ </HeaderIsland>+ </SplitHeaderRight>++ <CalendarSidePanelSections />++ <Show when={isNarrow() ? calendarView.selectedEvent() : undefined}>+ {(event) => (+ <EventDetailsPopover+ anchor={calendarView.selectedEventAnchor()}+ event={event()}+ open={calendarView.selectedEventAnchor() !== undefined}+ timeFormat={calendarView.displaySettings.timeFormat}+ onOpenChange={(open) => {+ if (!open) calendarView.closeEventDetails();+ }}+ />+ )}+ </Show>++ <main class="calendar-view flex size-full min-h-0">+ <div class="calendar-view-content flex min-w-0 min-h-0 flex-1 flex-col">+ <ResponsiveCalendarHost />+ </div>+ </main>+ </>+ );+}diff --git a/apps/web/src/features/calendar/calendar.css b/apps/web/src/features/calendar/calendar.cssnew file mode 100644index 0000000000..67ac43cc69--- /dev/null+++ b/apps/web/src/features/calendar/calendar.css@@ -0,0 +1,473 @@+.calendar-view {+ container-name: calendar-view;+ container-type: inline-size;+ --fc-page-bg-color: transparent;+ --fc-neutral-bg-color: var(--color-hover);+ --fc-neutral-text-color: var(--color-ink-muted);+ --fc-border-color: var(--color-edge-muted);+ --fc-event-bg-color: color-mix(+ in oklch,+ var(--color-calendar) 5%,+ var(--color-surface)+ );+ --fc-event-border-color: var(--color-calendar);+ --fc-event-text-color: var(--color-calendar);+ --fc-highlight-color: var(--color-accent-bg);+ --fc-today-bg-color: transparent;+ --fc-now-indicator-color: var(--color-accent);+}++.calendar-view-content {+ box-sizing: border-box;+ padding: 0.5rem;+}++.calendar-view .fc {+ color: var(--color-ink);+ font-family: inherit;+ font-size: 0.8125rem;+}++.calendar-view .fc .fc-view-harness {+ border-radius: 0.75rem;+ overflow: hidden;+}++.calendar-view .fc-theme-standard .fc-scrollgrid {+ border-width: 0;+}++.calendar-view .fc .fc-scrollgrid-section-header > * {+ border-left-width: 0;+ border-right-width: 0;+ border-top-width: 0;+}++.calendar-view .fc .fc-scrollgrid tr > :first-child {+ border-left-width: 0;+}++.calendar-view .fc .fc-scrollgrid tr > :last-child {+ border-right-width: 0;+}++.calendar-view .fc .fc-scrollgrid thead > tr:first-child > * {+ border-top-width: 0;+}++.calendar-view .fc .fc-scrollgrid tbody > tr:last-child > * {+ border-bottom-width: 0;+}++.calendar-view .fc .fc-col-header-cell {+ background: transparent;+ border-width: 0;+}++.calendar-view .fc .fc-col-header-cell-cushion {+ color: var(--color-ink-extra-muted);+ font-size: 0.875rem;+ font-weight: 400;+ padding: 0.375rem 0.25rem;+}++.calendar-view .fc .fc-timegrid .fc-col-header-cell {+ text-align: center;+}++.calendar-view .fc .fc-timegrid .fc-col-header-cell-cushion {+ display: inline-flex;+ flex-direction: column;+ align-items: center;+ gap: 0;+ padding: 0.375rem 0;+}++.calendar-view .fc .fc-timegrid .calendar-day-header-weekday {+ font-size: 0.875rem;+ font-weight: 400;+}++.calendar-view .fc .fc-timegrid .calendar-day-header-date {+ display: inline-flex;+ width: clamp(1.5rem, 6cqi, 2.25rem);+ height: clamp(1.5rem, 6cqi, 2.25rem);+ align-items: center;+ justify-content: center;+ font-size: clamp(1rem, 4cqi, 1.5rem);+ font-weight: 400;+ line-height: 1;+}++.calendar-view .fc .fc-daygrid-day-number {+ color: var(--color-ink-muted);+ padding: 0.5rem 0.625rem;+}++.calendar-view .fc .fc-dayGridMonth-view .fc-day-today .fc-daygrid-day-number {+ display: inline-flex;+ width: 1.25rem;+ height: 1.25rem;+ align-items: center;+ justify-content: center;+ margin: 0.25rem;+ padding: 0;+ border: 1px solid var(--color-accent);+ border-radius: 0.375rem;+ font-weight: 600;+}++.calendar-view+ .fc+ .fc-dayGridMonth-view+ .calendar-day-selected+ .fc-daygrid-day-number {+ display: inline-flex;+ width: 1.25rem;+ height: 1.25rem;+ align-items: center;+ justify-content: center;+ margin: 0.25rem;+ padding: 0;+ border: 1px solid var(--color-accent);+ border-radius: 0.375rem;+ background: var(--color-accent);+ color: var(--color-surface);+ font-weight: 600;+}++.calendar-view+ .fc+ .fc-timegrid+ .fc-col-header-cell.fc-day-today+ .calendar-day-header-weekday {+ color: var(--color-accent);+}++.calendar-view+ .fc+ .fc-timegrid+ .fc-col-header-cell.fc-day-today+ .calendar-day-header-date {+ border: 1px solid var(--color-accent);+ border-radius: 0.375rem;+ font-weight: 600;+}++.calendar-view .fc .fc-timegrid .calendar-day-header-date-selected {+ border: 1px solid var(--color-accent);+ border-radius: 0.375rem;+ background: var(--color-accent);+ color: var(--color-surface);+ font-weight: 600;+}++.calendar-view+ .fc+ .fc-timegrid+ .fc-col-header-cell.fc-day-today+ .calendar-day-header-date-selected {+ border-color: var(--color-accent);+}++.calendar-view .fc .fc-day-other .fc-daygrid-day-number {+ color: var(--color-ink-disabled);+}++.calendar-view .fc-direction-ltr .fc-daygrid-event {+ margin-right: 0.25rem;+}++.calendar-view .fc-direction-rtl .fc-daygrid-event {+ margin-left: 0.25rem;+}++.calendar-view .fc-direction-ltr .fc-h-event:not(.fc-event-end) {+ border-right-width: 1px;+ border-top-right-radius: 0.375rem;+ border-bottom-right-radius: 0.375rem;+}++.calendar-view .fc-direction-rtl .fc-h-event:not(.fc-event-start) {+ border-left-width: 1px;+ border-top-left-radius: 0.375rem;+ border-bottom-left-radius: 0.375rem;+}++.calendar-view .fc-direction-ltr .fc-timegrid-col-events {+ margin-right: 0.25rem;+}++.calendar-view .fc-direction-rtl .fc-timegrid-col-events {+ margin-left: 0.25rem;+}++.calendar-view .fc .fc-dayGridMonth-view .fc-daygrid-day-frame {+ min-height: 4rem;+}++.calendar-view .fc .fc-dayGridMonth-view .fc-daygrid-day-top {+ justify-content: center;+}++.calendar-view .fc .fc-timegrid .fc-daygrid-day-frame,+.calendar-view .fc .fc-timegrid .fc-daygrid-day-events {+ min-height: 1.5rem;+}++.calendar-view .fc .fc-timegrid .fc-daygrid-day-events {+ margin-bottom: 0;+}++.calendar-view .fc .fc-timegrid-divider {+ height: 0;+ padding: 0;+ border-width: 0;+ background: transparent;+}++.calendar-view .fc .fc-timeGridWeek-view .fc-timegrid-slot,+.calendar-view .fc .fc-timeGridDay-view .fc-timegrid-slot {+ height: 2rem;+}++.calendar-view .fc .fc-timegrid-slot-minor {+ border-top-color: transparent;+}++.calendar-view .fc .fc-timegrid .fc-scroller-harness-liquid::before,+.calendar-view .fc .fc-timegrid .fc-scroller-harness-liquid::after {+ position: absolute;+ right: 0;+ left: 0;+ z-index: 5;+ height: 1.5rem;+ pointer-events: none;+ content: "";+}++.calendar-view .fc .fc-timegrid .fc-scroller-harness-liquid::before {+ top: 0;+ background: linear-gradient(+ to bottom,+ color-mix(in oklch, var(--color-surface) 75%, transparent),+ transparent+ );+ opacity: 0;+ transition: opacity 150ms ease-out;+}++.calendar-view+ .fc+ .fc-timegrid+ .fc-scroller-harness-liquid[data-scrolled-from-top]::before {+ opacity: 1;+}++.calendar-view .fc .fc-timegrid .fc-scroller-harness-liquid::after {+ bottom: 0;+ background: linear-gradient(+ to top,+ color-mix(in oklch, var(--color-surface) 75%, transparent),+ transparent+ );+}++.calendar-view .fc .fc-timegrid-axis-cushion,+.calendar-view .fc .fc-timegrid-slot-label-cushion {+ color: var(--color-ink-extra-muted);+ font-size: 0.6875rem;+}++.calendar-view .fc .fc-timegrid-axis-cushion {+ opacity: 0;+}++.calendar-view .fc .fc-timegrid-axis,+.calendar-view .fc .fc-timegrid-slot-label {+ border-width: 0;+}++.calendar-view .fc .fc-timegrid-slot-label {+ vertical-align: top;+}++.calendar-view .fc .fc-timegrid-slot-label-cushion {+ padding-right: 0.5rem;+ transform: translateY(-50%);+}++.calendar-view+ .fc+ .fc-timegrid-slots+ tbody+ tr:first-child+ .fc-timegrid-slot-label-cushion {+ visibility: hidden;+}++.calendar-view .fc .fc-timegrid-now-indicator-line {+ --calendar-now-arrow-bottom: 50%;+ --calendar-now-arrow-top: 50%;+ --calendar-now-axis-height: 0.75rem;+ --calendar-now-axis-radius: 0.125rem;+ --calendar-now-axis-width: 0.625rem;+ --calendar-now-expanded: 0;+ border: 0;+ opacity: 1;+ pointer-events: auto;+}++.calendar-view .fc .fc-timegrid-now-indicator-line:hover {+ --calendar-now-arrow-bottom: 100%;+ --calendar-now-arrow-top: 0%;+ --calendar-now-axis-height: 1.375rem;+ --calendar-now-axis-radius: 0.375rem;+ --calendar-now-axis-width: 4.125rem;+ --calendar-now-expanded: 1;+}++.calendar-view .fc .fc-timegrid-now-indicator-line::before {+ position: absolute;+ top: 0;+ right: 0;+ left: 0;+ z-index: 6;+ height: 1px;+ border-radius: 0.25rem;+ background: var(--color-accent);+ content: "";+}++.calendar-view .fc .fc-timegrid-now-indicator-line::after {+ position: absolute;+ top: -0.25rem;+ right: 0;+ left: 0;+ z-index: 4;+ height: 0.5rem;+ content: "";+}++.calendar-view .fc .fc-timegrid-col .fc-timegrid-now-indicator-container {+ overflow: visible;+}++.calendar-view .fc .fc-timegrid-now-indicator-arrow {+ display: none;+}++.calendar-view .fc .fc-timeGridWeek-view .fc-timegrid-now-indicator-arrow {+ right: 0;+ left: 0;+ display: flex;+ height: auto;+ margin-top: 0;+ justify-content: flex-end;+ overflow: visible;+ border: 0;+ background: transparent;+ transform: translateY(-50%);+}++.calendar-view .fc .fc-timeGridWeek-view .fc-timegrid-axis {+ width: 4.5rem;+}++.calendar-view .fc .calendar-now-axis-indicator {+ z-index: 7;+ display: inline-flex;+ width: var(--calendar-now-axis-width, 0.625rem);+ height: var(--calendar-now-axis-height, 0.75rem);+ align-items: center;+ justify-content: center;+ overflow: hidden;+ border-radius: var(--calendar-now-axis-radius, 0.125rem);+ background: var(--color-accent);+ pointer-events: auto;+ clip-path: polygon(+ 0 0,+ 100% var(--calendar-now-arrow-top, 50%),+ 100% var(--calendar-now-arrow-bottom, 50%),+ 0 100%+ );+ transition:+ width 420ms cubic-bezier(0.2, 0.8, 0.2, 1),+ height 420ms cubic-bezier(0.2, 0.8, 0.2, 1),+ border-radius 300ms ease-out,+ clip-path 420ms cubic-bezier(0.2, 0.8, 0.2, 1);+}++.calendar-view .fc .calendar-now-axis-indicator-gutter {+ width: 0.375rem;+ height: 0.625rem;+ border-radius: 0 9999px 9999px 0;+ clip-path: none;+ pointer-events: none;+}++.calendar-view+ .fc+ .fc-timegrid-now-indicator-line+ > .calendar-now-axis-indicator {+ position: absolute;+ top: 0;+ right: 100%;+ transform: translateY(-50%);+}++.calendar-view+ .fc+ .fc-timeGridDay-view+ .fc-timegrid-now-indicator-line+ > .calendar-now-axis-indicator {+ right: auto;+ left: 0;+}++.calendar-view .fc .calendar-now-time {+ display: inline-flex;+ height: 100%;+ align-items: center;+ padding: 0 0.375rem;+ color: var(--color-surface);+ font-size: 0.6875rem;+ font-weight: 600;+ line-height: 1;+ white-space: nowrap;+ opacity: var(--calendar-now-expanded, 0);+ visibility: hidden;+ transition:+ opacity 300ms ease-out,+ visibility 0s linear 300ms;+}++.calendar-view .fc .fc-timegrid-now-indicator-line:hover .calendar-now-time {+ visibility: visible;+ transition-delay: 0s;+}++.calendar-view .fc .fc-timegrid-col-frame[data-time-grid-hover]::after {+ position: absolute;+ top: var(--calendar-time-grid-hover-top);+ right: 0;+ left: 0;+ z-index: 4;+ border-top: 1px dashed+ color-mix(in oklch, var(--color-ink-extra-muted) 40%, transparent);+ pointer-events: none;+ content: "";+}++@container calendar-view (max-width: 700px) {+ .calendar-view .fc .fc-daygrid-day-number {+ padding: 0.375rem;+ }+}++@media (max-width: 639px) {+ html[data-touch-device="true"] .calendar-view-content {+ padding-top: calc(var(--mobile-content-inset-top, 0px) + 0.5rem);+ padding-bottom: calc(var(--mobile-content-inset-bottom, 0px) + 0.5rem);+ }+}diff --git a/apps/web/src/features/calendar/events/CalendarControls.tsx b/apps/web/src/features/calendar/events/CalendarControls.tsxnew file mode 100644index 0000000000..757542a791--- /dev/null+++ b/apps/web/src/features/calendar/events/CalendarControls.tsx@@ -0,0 +1,35 @@+import { Checkbox } from '@ui';+import { For } from 'solid-js';+import type { CalendarSource } from './types';++interface CalendarControlsProps {+ sources: CalendarSource[];+ isVisible: (sourceId: string) => boolean;+ onVisibilityChange: (sourceId: string, visible: boolean) => void;+}++/** Controls which calendar sources are visible in the calendar. */+export function CalendarControls(props: CalendarControlsProps) {+ return (+ <div class="flex flex-col gap-0.5">+ <For each={props.sources}>+ {(source) => (+ <Checkbox+ as="label"+ checked={props.isVisible(source.id)}+ onChange={(checked) => props.onVisibilityChange(source.id, checked)}+ class="flex w-full items-center rounded-lg px-2 py-1.5 text-xs text-ink hover:bg-hover"+ >+ <span+ aria-hidden="true"+ class="size-2.5 shrink-0 rounded-sm"+ style={{ 'background-color': source.color }}+ />+ <span class="min-w-0 flex-1 truncate">{source.name}</span>+ <Checkbox.Control />+ </Checkbox>+ )}+ </For>+ </div>+ );+}diff --git a/apps/web/src/features/calendar/events/EventContent.tsx b/apps/web/src/features/calendar/events/EventContent.tsxnew file mode 100644index 0000000000..b730e877a0--- /dev/null+++ b/apps/web/src/features/calendar/events/EventContent.tsx@@ -0,0 +1,52 @@+import type { EventContentArg } from '@fullcalendar/core';+import { Show } from 'solid-js';+import type { CalendarEvent } from './types';++interface CalendarEventContentProps {+ event: CalendarEvent;+ renderProps: EventContentArg;+}++/** Renders responsive event content for FullCalendar. */+export function CalendarEventContent(props: CalendarEventContentProps) {+ const isCompact = () =>+ props.event.allDay || props.renderProps.view.type === 'dayGridMonth';+ const showLocation = () =>+ !props.event.allDay && props.renderProps.view.type === 'timeGridDay';++ return (+ <Show+ when={!isCompact()}+ fallback={+ <div class="flex min-w-0 items-center gap-1 overflow-hidden px-1 py-0.5 text-[0.6875rem] leading-tight">+ <Show when={props.renderProps.timeText}>+ {(timeText) => (+ <span class="shrink-0 font-semibold tabular-nums">+ {timeText()}+ </span>+ )}+ </Show>+ <span class="truncate font-medium">{props.event.title}</span>+ </div>+ }+ >+ <div class="flex size-full min-h-0 flex-col overflow-hidden p-1">+ <span class="truncate text-xs font-semibold leading-tight">+ {props.event.title}+ </span>+ <Show when={props.renderProps.timeText}>+ {(timeText) => (+ <span class="mt-0.5 truncate text-[0.6875rem] leading-tight opacity-85 tabular-nums">+ {timeText()}+ </span>+ )}+ </Show>+ <Show when={showLocation() && props.event.location}>+ <span class="mt-1 truncate text-[0.6875rem] leading-tight opacity-80">+ {props.event.location}+ </span>+ </Show>+ </div>+ </Show>+ );+}diff --git a/apps/web/src/features/calendar/events/EventDetails.tsx b/apps/web/src/features/calendar/events/EventDetails.tsxnew file mode 100644index 0000000000..c2b28df605--- /dev/null+++ b/apps/web/src/features/calendar/events/EventDetails.tsx@@ -0,0 +1,108 @@+import CalendarIcon from '@phosphor/calendar-blank.svg';+import ClockIcon from '@phosphor/clock.svg';+import MapPinIcon from '@phosphor/map-pin.svg';+import { Show } from 'solid-js';+import { formatCalendarTime } from '../time-format';+import type { CalendarEvent, CalendarTimeFormat } from './types';++const formatDate = new Intl.DateTimeFormat(undefined, {+ weekday: 'short',+ month: 'long',+ day: 'numeric',+});+const formatShortDate = new Intl.DateTimeFormat(undefined, {+ month: 'short',+ day: 'numeric',+});+const isDateOnly = (value: string) => /^\d{4}-\d{2}-\d{2}$/.test(value);++function parseCalendarDate(value: string) {+ if (!isDateOnly(value)) return new Date(value);++ const [year, month, day] = value.split('-').map(Number);+ return new Date(year ?? 0, (month ?? 1) - 1, day ?? 1);+}++const isSameLocalDate = (first: Date, second: Date) =>+ first.getFullYear() === second.getFullYear() &&+ first.getMonth() === second.getMonth() &&+ first.getDate() === second.getDate();++function formatEventSchedule(+ event: CalendarEvent,+ timeFormat: CalendarTimeFormat+) {+ const start = parseCalendarDate(event.start);+ const end = parseCalendarDate(event.end);++ if (event.allDay) {+ const inclusiveEnd = new Date(end);+ inclusiveEnd.setDate(inclusiveEnd.getDate() - 1);+ return isSameLocalDate(start, inclusiveEnd)+ ? `${formatDate.format(start)} · All day`+ : `${formatShortDate.format(start)}–${formatShortDate.format(inclusiveEnd)} · All day`;+ }++ return isSameLocalDate(start, end)+ ? `${formatDate.format(start)} · ${formatCalendarTime(start, timeFormat)}–${formatCalendarTime(end, timeFormat)}`+ : `${formatDate.format(start)}, ${formatCalendarTime(start, timeFormat)}–${formatDate.format(end)}, ${formatCalendarTime(end, timeFormat)}`;+}++/** Displays read-only details for a selected calendar event. */+export function EventDetails(props: {+ event: CalendarEvent;+ timeFormat: CalendarTimeFormat;+}) {+ return (+ <div class="min-w-0 p-1 text-ink">+ <div class="flex items-start gap-2">+ <div+ aria-hidden="true"+ class="mt-1 size-2.5 shrink-0 rounded-sm"+ style={{ 'background-color': props.event.calendar.color }}+ />+ <div class="min-w-0 flex-1">+ <div class="text-sm font-semibold leading-snug text-ink">+ {props.event.title}+ </div>+ <div class="mt-2 flex flex-col gap-2 text-xs text-ink-muted">+ <div class="flex items-start gap-2">+ <Show+ when={props.event.allDay}+ fallback={+ <ClockIcon class="mt-0.5 size-3.5 shrink-0 text-ink-extra-muted" />+ }+ >+ <CalendarIcon class="mt-0.5 size-3.5 shrink-0 text-ink-extra-muted" />+ </Show>+ <span>{formatEventSchedule(props.event, props.timeFormat)}</span>+ </div>+ <Show when={props.event.location}>+ {(location) => (+ <div class="flex items-start gap-2">+ <MapPinIcon class="mt-0.5 size-3.5 shrink-0 text-ink-extra-muted" />+ <span>{location()}</span>+ </div>+ )}+ </Show>+ <div class="flex items-center gap-2">+ <span+ aria-hidden="true"+ class="size-2 shrink-0 rounded-sm"+ style={{ 'background-color': props.event.calendar.color }}+ />+ <span>{props.event.calendar.name}</span>+ </div>+ </div>+ <Show when={props.event.description}>+ {(description) => (+ <p class="mt-3 border-t border-edge-muted pt-3 text-xs leading-relaxed text-ink-muted">+ {description()}+ </p>+ )}+ </Show>+ </div>+ </div>+ </div>+ );+}diff --git a/apps/web/src/features/calendar/events/EventDetailsPopover.tsx b/apps/web/src/features/calendar/events/EventDetailsPopover.tsxnew file mode 100644index 0000000000..5dc99451ec--- /dev/null+++ b/apps/web/src/features/calendar/events/EventDetailsPopover.tsx@@ -0,0 +1,62 @@+import { Popover } from '@kobalte/core/popover';+import CloseIcon from '@phosphor/x.svg';+import { Layer } from '@ui';+import { createEffect } from 'solid-js';+import { EventDetails } from './EventDetails';+import type { CalendarEvent, CalendarTimeFormat } from './types';++interface EventDetailsPopoverProps {+ anchor: HTMLElement | undefined;+ event: CalendarEvent;+ open: boolean;+ timeFormat: CalendarTimeFormat;+ onOpenChange: (open: boolean) => void;+}++/** Anchors read-only event details to a rendered event on narrow layouts. */+export function EventDetailsPopover(props: EventDetailsPopoverProps) {+ let lastAnchor: HTMLElement | undefined;++ createEffect(() => {+ if (props.anchor) lastAnchor = props.anchor;+ });++ return (+ <Popover+ anchorRef={() => props.anchor}+ open={props.open}+ onOpenChange={props.onOpenChange}+ placement="right-start"+ gutter={8}+ flip+ slide+ >+ <Popover.Portal>+ <Layer depth={3}>+ <Popover.Content+ class="z-modal max-w-[calc(100vw-2rem)] outline-none"+ onCloseAutoFocus={(event) => {+ const shouldRestoreFocus = !event.defaultPrevented;+ event.preventDefault();+ if (shouldRestoreFocus && lastAnchor?.isConnected) {+ lastAnchor.focus();+ }+ }}+ >+ <Popover.Arrow class="fill-surface" />+ <div class="relative w-80 max-w-full rounded-xl bg-surface p-3 pr-10 text-ink shadow-menu ring ring-edge-muted">+ <Popover.Title class="sr-only">{props.event.title}</Popover.Title>+ <EventDetails event={props.event} timeFormat={props.timeFormat} />+ <Popover.CloseButton+ aria-label="Close event details"+ class="absolute right-2 top-2 flex size-6 items-center justify-center rounded-md text-ink-extra-muted outline-none hover:bg-hover hover:text-ink focus-visible:ring focus-visible:ring-accent"+ >+ <CloseIcon class="size-3.5" />+ </Popover.CloseButton>+ </div>+ </Popover.Content>+ </Layer>+ </Popover.Portal>+ </Popover>+ );+}diff --git a/apps/web/src/features/calendar/events/event-mapper.ts b/apps/web/src/features/calendar/events/event-mapper.tsnew file mode 100644index 0000000000..7db89106b4--- /dev/null+++ b/apps/web/src/features/calendar/events/event-mapper.ts@@ -0,0 +1,24 @@+import type { EventInput } from '@fullcalendar/core';+import type { CalendarEvent } from './types';++/** Maps calendar-owned event data into FullCalendar's rendering contract. */+export function mapCalendarEventToFullCalendar(+ event: CalendarEvent+): EventInput {+ const eventBackground = `color-mix(in oklch, ${event.calendar.color} 5%, var(--color-surface))`;++ return {+ id: event.id,+ title: event.title,+ start: event.start,+ end: event.end,+ allDay: event.allDay,+ backgroundColor: eventBackground,+ borderColor: event.calendar.color,+ textColor: event.calendar.color,+ display: 'block',+ extendedProps: {+ calendarEventId: event.id,+ },+ };+}diff --git a/apps/web/src/features/calendar/events/types.ts b/apps/web/src/features/calendar/events/types.tsnew file mode 100644index 0000000000..76e46de676--- /dev/null+++ b/apps/web/src/features/calendar/events/types.ts@@ -0,0 +1,35 @@+/** Supported first day of the calendar week. */+export type CalendarWeekStart = 0 | 1;++/** Supported calendar time display formats. */+export type CalendarTimeFormat = '12-hour' | '24-hour';++/** A calendar source used to group and style events. */+export interface CalendarSource {+ /** Stable source identifier. */+ id: string;+ /** Human-readable source name. */+ name: string;+ /** Semantic CSS color used for events from this source. */+ color: string;+}++/** Calendar-owned event data, independent from FullCalendar. */+export interface CalendarEvent {+ /** Stable event identifier. */+ id: string;+ /** Event title. */+ title: string;+ /** ISO timestamp or local date string for all-day events. */+ start: string;+ /** Exclusive ISO timestamp or local date string. */+ end: string;+ /** Whether the event occupies the all-day area. */+ allDay: boolean;+ /** Calendar source that owns the event. */+ calendar: CalendarSource;+ /** Optional event location. */+ location?: string;+ /** Optional event description. */+ description?: string;+}diff --git a/apps/web/src/features/calendar/fullcalendar-solid/FullCalendar.test.tsx b/apps/web/src/features/calendar/fullcalendar-solid/FullCalendar.test.tsxnew file mode 100644index 0000000000..e4729a93ae--- /dev/null+++ b/apps/web/src/features/calendar/fullcalendar-solid/FullCalendar.test.tsx@@ -0,0 +1,264 @@+/**+ * @vitest-environment jsdom+ */++import {+ Calendar,+ type DatesSetArg,+ type EventContentArg,+} from '@fullcalendar/core';+import dayGridPlugin from '@fullcalendar/daygrid';+import { render, screen, waitFor } from '@solidjs/testing-library';+import {+ createContext,+ createSignal,+ onCleanup,+ Show,+ useContext,+} from 'solid-js';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { FullCalendar, useFullCalendar } from './FullCalendar';++beforeEach(() => {+ vi.stubGlobal(+ 'requestAnimationFrame',+ vi.fn(() => 1)+ );+ vi.stubGlobal('cancelAnimationFrame', vi.fn());+});++afterEach(() => {+ vi.restoreAllMocks();+ vi.unstubAllGlobals();+});++describe('FullCalendar Solid connector', () => {+ it('composes a host and context-aware Solid content', () => {+ const AppContext = createContext('missing');+ const [prefix, setPrefix] = createSignal('Planning');++ function ContextualEvent(props: { event: EventContentArg }) {+ const appValue = useContext(AppContext);+ const calendar = useFullCalendar();++ return (+ <span data-testid="event-content">+ {appValue}: {calendar.api()?.view.type}: {prefix()}:{' '}+ {props.event.event.title}+ </span>+ );+ }++ render(() => (+ <AppContext.Provider value="inherited">+ <FullCalendar.Root+ plugins={[dayGridPlugin]}+ initialView="dayGridMonth"+ initialDate="2025-01-15"+ headerToolbar={false}+ handleWindowResize={false}+ events={[{ id: 'planning', title: 'Planning', start: '2025-01-15' }]}+ >+ <FullCalendar.EventContent>+ {(event) => <ContextualEvent event={event} />}+ </FullCalendar.EventContent>+ <FullCalendar.Host+ class="calendar-host"+ data-testid="calendar-host"+ />+ </FullCalendar.Root>+ </AppContext.Provider>+ ));++ expect(screen.getByTestId('calendar-host').className).toContain(+ 'calendar-host'+ );+ expect(screen.getByTestId('event-content').textContent).toBe(+ 'inherited: dayGridMonth: Planning: Planning'+ );++ setPrefix('Updated');++ expect(screen.getByTestId('event-content').textContent).toBe(+ 'inherited: dayGridMonth: Updated: Planning'+ );+ });++ it('reacts to root options and exposes the calendar API through context', async () => {+ const [events, setEvents] = createSignal([+ { id: 'first', title: 'First', start: '2025-01-15' },+ ]);+ let calendarContext: ReturnType<typeof useFullCalendar> | undefined;++ function CalendarContextCapture() {+ calendarContext = useFullCalendar();+ return null;+ }++ const getCalendar = () => {+ const api = calendarContext?.api();+ if (!api) throw new Error('Calendar API was not set');+ return api;+ };++ render(() => (+ <FullCalendar.Root+ plugins={[dayGridPlugin]}+ initialView="dayGridMonth"+ initialDate="2025-01-15"+ headerToolbar={false}+ handleWindowResize={false}+ events={events()}+ >+ <CalendarContextCapture />+ <FullCalendar.Host />+ </FullCalendar.Root>+ ));++ expect(+ getCalendar()+ .getEvents()+ .map((event) => event.title)+ ).toEqual(['First']);++ setEvents([{ id: 'first', title: 'Updated', start: '2025-01-16' }]);++ await waitFor(() => {+ expect(+ getCalendar()+ .getEvents()+ .map((event) => event.title)+ ).toEqual(['Updated']);+ });+ });++ it('exposes date info before invoking the datesSet callback', () => {+ let calendarContext: ReturnType<typeof useFullCalendar> | undefined;++ function CalendarContextCapture() {+ calendarContext = useFullCalendar();+ return null;+ }++ const datesSet = vi.fn((dateInfo: DatesSetArg) => {+ expect(calendarContext?.dateInfo()).toBe(dateInfo);+ });++ const { unmount } = render(() => (+ <FullCalendar.Root+ plugins={[dayGridPlugin]}+ initialView="dayGridMonth"+ initialDate="2025-01-15"+ headerToolbar={false}+ handleWindowResize={false}+ datesSet={datesSet}+ >+ <CalendarContextCapture />+ <FullCalendar.Host />+ </FullCalendar.Root>+ ));++ expect(datesSet).toHaveBeenCalledOnce();+ expect(calendarContext?.dateInfo()?.view.type).toBe('dayGridMonth');+ expect(calendarContext?.api()?.view.type).toBe('dayGridMonth');++ const initialStart = calendarContext?.dateInfo()?.start.getTime();+ calendarContext?.api()?.next();++ expect(datesSet).toHaveBeenCalledTimes(2);+ expect(calendarContext?.dateInfo()?.start.getTime()).not.toBe(initialStart);++ unmount();++ expect(calendarContext?.api()).toBeUndefined();+ expect(calendarContext?.dateInfo()).toBeUndefined();+ });++ it('reacts to content children and dynamically registers them', async () => {+ const resetOptions = vi.spyOn(Calendar.prototype, 'resetOptions');+ const [showCustomContent, setShowCustomContent] = createSignal(true);+ const [renderEvent, setRenderEvent] = createSignal(+ (event: EventContentArg) => (+ <span data-testid="custom-event">Custom {event.event.title}</span>+ )+ );++ const { container } = render(() => (+ <FullCalendar.Root+ plugins={[dayGridPlugin]}+ initialView="dayGridMonth"+ initialDate="2025-01-15"+ headerToolbar={false}+ handleWindowResize={false}+ events={[{ id: 'planning', title: 'Planning', start: '2025-01-15' }]}+ >+ <Show when={showCustomContent()}>+ <FullCalendar.EventContent>{renderEvent()}</FullCalendar.EventContent>+ </Show>+ <FullCalendar.Host />+ </FullCalendar.Root>+ ));++ expect(screen.getByTestId('custom-event').textContent).toBe(+ 'Custom Planning'+ );++ resetOptions.mockClear();+ setRenderEvent(() => (event: EventContentArg) => (+ <span data-testid="custom-event">Updated {event.event.title}</span>+ ));++ expect(screen.getByTestId('custom-event').textContent).toBe(+ 'Updated Planning'+ );+ expect(resetOptions).not.toHaveBeenCalled();++ setShowCustomContent(false);++ await waitFor(() => {+ expect(screen.queryByTestId('custom-event')).toBeNull();+ expect(container.textContent).toContain('Planning');+ });++ setShowCustomContent(true);++ await waitFor(() => {+ expect(screen.getByTestId('custom-event').textContent).toBe(+ 'Updated Planning'+ );+ });+ });++ it('destroys FullCalendar and disposes registered content on unmount', () => {+ const destroy = vi.spyOn(Calendar.prototype, 'destroy');+ const disposeContent = vi.fn();++ function EventContent() {+ onCleanup(disposeContent);+ return <span data-testid="owned-content">Owned content</span>;+ }++ const { unmount } = render(() => (+ <FullCalendar.Root+ plugins={[dayGridPlugin]}+ initialView="dayGridMonth"+ initialDate="2025-01-15"+ headerToolbar={false}+ handleWindowResize={false}+ events={[{ id: 'planning', title: 'Planning', start: '2025-01-15' }]}+ >+ <FullCalendar.EventContent>+ {() => <EventContent />}+ </FullCalendar.EventContent>+ <FullCalendar.Host />+ </FullCalendar.Root>+ ));++ expect(screen.getByTestId('owned-content').isConnected).toBe(true);++ unmount();++ expect(destroy).toHaveBeenCalledOnce();+ expect(disposeContent).toHaveBeenCalledOnce();+ });+});diff --git a/apps/web/src/features/calendar/fullcalendar-solid/FullCalendar.tsx b/apps/web/src/features/calendar/fullcalendar-solid/FullCalendar.tsxnew file mode 100644index 0000000000..58271293b3--- /dev/null+++ b/apps/web/src/features/calendar/fullcalendar-solid/FullCalendar.tsx@@ -0,0 +1,541 @@+import {+ type AllDayContentArg,+ Calendar,+ type CalendarApi,+ type CalendarOptions,+ type DatesSetArg,+ type DayCellContentArg,+ type DayHeaderContentArg,+ type EventContentArg,+ type MoreLinkContentArg,+ type NowIndicatorContentArg,+ type SlotLabelContentArg,+ type SlotLaneContentArg,+ type WeekNumberContentArg,+} from '@fullcalendar/core';+import type { CustomRendering } from '@fullcalendar/core/internal';+import { mergeRefs } from '@solid-primitives/refs';+import {+ type Accessor,+ type Component,+ createContext,+ createEffect,+ createSignal,+ getOwner,+ type JSX,+ type Owner,+ on,+ onCleanup,+ splitProps,+ useContext,+} from 'solid-js';+import { render } from 'solid-js/web';++/**+ * Content accepted by FullCalendar's Solid-aware rendering hooks.+ *+ * Return values follow Solid JSX semantics. FullCalendar's framework-neutral+ * `true`, `{ html }`, and `{ domNodes }` forms are intentionally not supported;+ * omit or unmount a content registration to restore FullCalendar's default.+ */+export type SolidCalendarContent = JSX.Element;++/** A Solid render function for a FullCalendar content hook. */+export type SolidCalendarContentGenerator<RenderProps> = (+ renderProps: RenderProps+) => SolidCalendarContent;++interface SolidContentOptions {+ allDayContent?: SolidCalendarContentGenerator<AllDayContentArg>;+ dayCellContent?: SolidCalendarContentGenerator<DayCellContentArg>;+ dayHeaderContent?: SolidCalendarContentGenerator<DayHeaderContentArg>;+ eventContent?: SolidCalendarContentGenerator<EventContentArg>;+ moreLinkContent?: SolidCalendarContentGenerator<MoreLinkContentArg>;+ nowIndicatorContent?: SolidCalendarContentGenerator<NowIndicatorContentArg>;+ slotLabelContent?: SolidCalendarContentGenerator<SlotLabelContentArg>;+ slotLaneContent?: SolidCalendarContentGenerator<SlotLaneContentArg>;+ weekNumberContent?: SolidCalendarContentGenerator<WeekNumberContentArg>;+}++type SolidContentOptionName = keyof SolidContentOptions;+type ConnectorOptionName =+ | 'customRenderingMetaMap'+ | 'customRenderingReplaces'+ | 'handleCustomRendering';++/** FullCalendar options accepted by the Solid connector root. */+export type FullCalendarOptions = Omit<+ CalendarOptions,+ SolidContentOptionName | ConnectorOptionName+>;++/** Props for the FullCalendar context root. */+export type FullCalendarRootProps = FullCalendarOptions & {+ /** Calendar controls, content registrations, and a `FullCalendar.Host`. */+ children?: JSX.Element;+};++/** Props for the DOM element owned by FullCalendar. */+export type FullCalendarHostProps = Omit<+ JSX.HTMLAttributes<HTMLDivElement>,+ 'children' | 'ref'+> & {+ /** Receives FullCalendar's host element. */+ ref?: (element: HTMLDivElement) => void;+};++/** Public state and API available to descendants of `FullCalendar.Root`. */+export interface FullCalendarContextValue {+ /** The mounted FullCalendar API, or `undefined` before a host mounts. */+ api: Accessor<CalendarApi | undefined>;+ /** The latest date information emitted by FullCalendar. */+ dateInfo: Accessor<DatesSetArg | undefined>;+}++interface SolidRenderingMeta {+ generator: unknown;+ owner: Owner | null;+ type: typeof SOLID_RENDERING_META;+}++interface ContentRegistration {+ generator: unknown;+ owner: Owner | null;+ token: symbol;+}++interface ContentRegistrationHandle {+ dispose(): void;+}++interface FullCalendarController extends FullCalendarContextValue {+ destroy(): void;+ mount(element: HTMLDivElement): void;+ registerContent(+ optionName: SolidContentOptionName,+ generator: unknown,+ owner: Owner | null+ ): ContentRegistrationHandle;+ unmount(element: HTMLDivElement): void;+}++type AnyCustomRendering = CustomRendering<unknown>;+type SetCustomRendering = (rendering: AnyCustomRendering) => void;++interface MountedCustomRendering {+ containerEl: HTMLElement;+ dispose: () => void;+ generatorName: string;+ owner: Owner | null;+ setRendering: SetCustomRendering;+}++interface CustomRenderingManager {+ destroy(): void;+ handle(rendering: AnyCustomRendering): void;+ retainGeneratorNames(generatorNames: ReadonlySet<string>): void;+}++interface BuiltCalendarOptions {+ contentOptionNames: Set<string>;+ options: CalendarOptions;+}++const SOLID_RENDERING_META = Symbol('FullCalendarSolidRendering');+const FullCalendarContext = createContext<FullCalendarController>();++/**+ * Provides a FullCalendar controller and accepts its initial and reactive+ * options. Descendants determine where the calendar and custom content render.+ */+export function FullCalendarRoot(props: FullCalendarRootProps) {+ const [local, options] = splitProps(props, ['children']);+ const controller = createFullCalendarController(() => ({ ...options }));++ onCleanup(() => controller.destroy());++ return (+ <FullCalendarContext.Provider value={controller}>+ {local.children}+ </FullCalendarContext.Provider>+ );+}++/** The DOM host that FullCalendar renders into. */+export function FullCalendarHost(props: FullCalendarHostProps) {+ const controller = useFullCalendarController();+ const [local, elementProps] = splitProps(props, ['ref']);+ const [element, setElement] = createSignal<HTMLDivElement>();++ createEffect(+ on(element, (hostElement) => {+ if (!hostElement) return;++ controller.mount(hostElement);+ onCleanup(() => controller.unmount(hostElement));+ })+ );++ return <div {...elementProps} ref={mergeRefs(setElement, local.ref)} />;+}++interface CalendarContentSlotProps<RenderProps> {+ children: (renderProps: RenderProps) => SolidCalendarContent;+}++type ContentRenderProps<OptionName extends SolidContentOptionName> =+ NonNullable<+ SolidContentOptions[OptionName]+ > extends SolidCalendarContentGenerator<infer RenderProps>+ ? RenderProps+ : never;++function registerContentSlot<OptionName extends SolidContentOptionName>(+ optionName: OptionName+): Component<CalendarContentSlotProps<ContentRenderProps<OptionName>>> {+ return (props) => {+ const controller = useFullCalendarController();+ const renderContent = (renderProps: ContentRenderProps<OptionName>) =>+ props.children(renderProps);+ const registration = controller.registerContent(+ optionName,+ renderContent,+ getOwner()+ );++ onCleanup(() => registration.dispose());+ return null;+ };+}++/** Registers Solid content for FullCalendar's all-day label. */+export const FullCalendarAllDayContent = registerContentSlot('allDayContent');++/** Registers Solid content for FullCalendar day cells. */+export const FullCalendarDayCellContent = registerContentSlot('dayCellContent');++/** Registers Solid content for FullCalendar day headers. */+export const FullCalendarDayHeaderContent =+ registerContentSlot('dayHeaderContent');++/** Registers Solid content for calendar events. */+export const FullCalendarEventContent = registerContentSlot('eventContent');++/** Registers Solid content for FullCalendar's more-events link. */+export const FullCalendarMoreLinkContent =+ registerContentSlot('moreLinkContent');++/** Registers Solid content for FullCalendar's current-time indicator. */+export const FullCalendarNowIndicatorContent = registerContentSlot(+ 'nowIndicatorContent'+);++/** Registers Solid content for FullCalendar slot labels. */+export const FullCalendarSlotLabelContent =+ registerContentSlot('slotLabelContent');++/** Registers Solid content for FullCalendar slot lanes. */+export const FullCalendarSlotLaneContent =+ registerContentSlot('slotLaneContent');++/** Registers Solid content for FullCalendar week numbers. */+export const FullCalendarWeekNumberContent =+ registerContentSlot('weekNumberContent');++/** Returns the nearest FullCalendar controller. */+export function useFullCalendar(): FullCalendarContextValue {+ return useFullCalendarController();+}++function useFullCalendarController(): FullCalendarController {+ const controller = useContext(FullCalendarContext);+ if (!controller) {+ throw new Error(+ 'FullCalendar components must be used within FullCalendar.Root'+ );+ }++ return controller;+}++function createFullCalendarController(+ getOptions: Accessor<FullCalendarOptions>+): FullCalendarController {+ const [calendar, setCalendar] = createSignal<Calendar>();+ const [dateInfo, setDateInfo] = createSignal<DatesSetArg>();+ const [hostElement, setHostElement] = createSignal<HTMLDivElement>();+ const [resizeFrame, setResizeFrame] = createSignal<number>();+ const [isUnmounting, setIsUnmounting] = createSignal(false);+ const contentRegistrations = new Map<+ SolidContentOptionName,+ ContentRegistration+ >();++ const requestResize = () => {+ if (isUnmounting() || !calendar()) return;++ const currentResizeFrame = resizeFrame();+ if (currentResizeFrame !== undefined) {+ cancelAnimationFrame(currentResizeFrame);+ }+ setResizeFrame(+ requestAnimationFrame(() => {+ setResizeFrame(undefined);+ calendar()?.updateSize();+ })+ );+ };++ const customRenderingManager = createCustomRenderingManager(requestResize);+ const handleCustomRendering = (rendering: AnyCustomRendering) => {+ customRenderingManager.handle(rendering);+ };++ const buildOptions = () =>+ buildCalendarOptions(+ getOptions(),+ contentRegistrations,+ handleCustomRendering,+ setDateInfo+ );++ const resetOptions = () => {+ const calendarInstance = calendar();+ if (!calendarInstance) return;++ const nextOptions = buildOptions();+ customRenderingManager.retainGeneratorNames(nextOptions.contentOptionNames);+ calendarInstance.resetOptions(nextOptions.options);+ };++ createEffect(on(getOptions, resetOptions, { defer: true }));++ const unmount = (element: HTMLDivElement) => {+ if (hostElement() !== element) return;++ setIsUnmounting(true);+ const currentResizeFrame = resizeFrame();+ if (currentResizeFrame !== undefined) {+ cancelAnimationFrame(currentResizeFrame);+ setResizeFrame(undefined);+ }+ calendar()?.destroy();+ setCalendar(undefined);+ setDateInfo(undefined);+ setHostElement(undefined);+ customRenderingManager.destroy();+ };++ return {+ api: calendar,+ dateInfo,+ destroy() {+ const mountedHostElement = hostElement();+ if (mountedHostElement) unmount(mountedHostElement);+ contentRegistrations.clear();+ },+ mount(element) {+ if (hostElement()) {+ throw new Error('FullCalendar.Root can only contain one mounted host');+ }++ setIsUnmounting(false);+ setHostElement(element);+ const initialOptions = buildOptions();+ customRenderingManager.retainGeneratorNames(+ initialOptions.contentOptionNames+ );+ const calendarInstance = new Calendar(element, initialOptions.options);+ setCalendar(calendarInstance);+ calendarInstance.render();+ },+ registerContent(optionName, generator, owner) {+ if (contentRegistrations.has(optionName)) {+ throw new Error(+ `FullCalendar.${optionName} can only be registered once per root`+ );+ }++ const registration: ContentRegistration = {+ generator,+ owner,+ token: Symbol(optionName),+ };+ contentRegistrations.set(optionName, registration);+ resetOptions();++ return {+ dispose() {+ if (+ contentRegistrations.get(optionName)?.token !== registration.token+ ) {+ return;+ }++ contentRegistrations.delete(optionName);+ resetOptions();+ },+ };+ },+ unmount,+ };+}++function buildCalendarOptions(+ rootOptions: FullCalendarOptions,+ contentRegistrations: Map<SolidContentOptionName, ContentRegistration>,+ handleCustomRendering: (rendering: AnyCustomRendering) => void,+ setDateInfo: (dateInfo: DatesSetArg) => void+): BuiltCalendarOptions {+ const options = { ...rootOptions } as Record<string, unknown>;+ const externalDatesSet = rootOptions.datesSet;+ const customRenderingMetaMap: Record<string, SolidRenderingMeta> = {};++ options.datesSet = (dateInfo: DatesSetArg) => {+ setDateInfo(dateInfo);+ externalDatesSet?.(dateInfo);+ };++ for (const [optionName, registration] of contentRegistrations) {+ customRenderingMetaMap[optionName] = createSolidRenderingMeta(+ registration.generator,+ registration.owner+ );+ delete options[optionName];+ }++ return {+ contentOptionNames: new Set(Object.keys(customRenderingMetaMap)),+ options: {+ ...options,+ customRenderingMetaMap,+ handleCustomRendering,+ } as CalendarOptions,+ };+}++function createSolidRenderingMeta(+ generator: unknown,+ owner: Owner | null+): SolidRenderingMeta {+ return { generator, owner, type: SOLID_RENDERING_META };+}++function isSolidRenderingMeta(value: unknown): value is SolidRenderingMeta {+ return (+ typeof value === 'object' &&+ value !== null &&+ 'type' in value &&+ value.type === SOLID_RENDERING_META+ );+}++function createCustomRenderingManager(+ onRenderingChange: () => void+): CustomRenderingManager {+ const mountedRenderings = new Map<string, MountedCustomRendering>();++ const remove = (id: string) => {+ const mounted = mountedRenderings.get(id);+ if (!mounted) return;++ mounted.dispose();+ mountedRenderings.delete(id);+ };++ return {+ destroy() {+ for (const mounted of mountedRenderings.values()) mounted.dispose();+ mountedRenderings.clear();+ },+ handle(rendering) {+ if (!rendering.isActive) {+ remove(rendering.id);+ onRenderingChange();+ return;+ }++ const renderingOwner = getCustomRenderingOwner(rendering);+ const mounted = mountedRenderings.get(rendering.id);+ if (+ mounted?.containerEl === rendering.containerEl &&+ mounted.owner === renderingOwner+ ) {+ mounted.setRendering(rendering);+ onRenderingChange();+ return;+ }++ remove(rendering.id);++ const [currentRendering, setCurrentRendering] =+ createSignal<AnyCustomRendering>(rendering, { equals: false });+ const renderContent = () => {+ const current = currentRendering();+ return resolveCustomContent(current.generatorMeta, current.renderProps);+ };+ const dispose = render(+ // Solid's DOM renderer treats an accessor as a reactive child.+ () => renderContent as unknown as JSX.Element,+ rendering.containerEl,+ undefined,+ { owner: renderingOwner }+ );++ mountedRenderings.set(rendering.id, {+ containerEl: rendering.containerEl,+ dispose,+ generatorName: rendering.generatorName,+ owner: renderingOwner,+ setRendering: setCurrentRendering,+ });+ onRenderingChange();+ },+ retainGeneratorNames(generatorNames) {+ let didRemoveRendering = false;++ for (const [id, mounted] of mountedRenderings) {+ if (!generatorNames.has(mounted.generatorName)) {+ remove(id);+ didRemoveRendering = true;+ }+ }++ if (didRemoveRendering) onRenderingChange();+ },+ };+}++function getCustomRenderingOwner(rendering: AnyCustomRendering): Owner | null {+ return isSolidRenderingMeta(rendering.generatorMeta)+ ? rendering.generatorMeta.owner+ : null;+}++function resolveCustomContent(+ generatorMeta: unknown,+ renderProps: unknown+): JSX.Element {+ const generator = isSolidRenderingMeta(generatorMeta)+ ? generatorMeta.generator+ : generatorMeta;++ return (+ typeof generator === 'function' ? generator(renderProps) : generator+ ) as JSX.Element;+}++/** Compound components for composing a Solid FullCalendar integration. */+export const FullCalendar = {+ AllDayContent: FullCalendarAllDayContent,+ DayCellContent: FullCalendarDayCellContent,+ DayHeaderContent: FullCalendarDayHeaderContent,+ EventContent: FullCalendarEventContent,+ Host: FullCalendarHost,+ MoreLinkContent: FullCalendarMoreLinkContent,+ NowIndicatorContent: FullCalendarNowIndicatorContent,+ Root: FullCalendarRoot,+ SlotLabelContent: FullCalendarSlotLabelContent,+ SlotLaneContent: FullCalendarSlotLaneContent,+ WeekNumberContent: FullCalendarWeekNumberContent,+} as const;diff --git a/apps/web/src/features/calendar/fullcalendar-solid/index.ts b/apps/web/src/features/calendar/fullcalendar-solid/index.tsnew file mode 100644index 0000000000..be7ee0f840--- /dev/null+++ b/apps/web/src/features/calendar/fullcalendar-solid/index.ts@@ -0,0 +1,21 @@+export {+ FullCalendar,+ FullCalendarAllDayContent,+ type FullCalendarContextValue,+ FullCalendarDayCellContent,+ FullCalendarDayHeaderContent,+ FullCalendarEventContent,+ FullCalendarHost,+ type FullCalendarHostProps,+ FullCalendarMoreLinkContent,+ FullCalendarNowIndicatorContent,+ type FullCalendarOptions,+ FullCalendarRoot,+ type FullCalendarRootProps,+ FullCalendarSlotLabelContent,+ FullCalendarSlotLaneContent,+ FullCalendarWeekNumberContent,+ type SolidCalendarContent,+ type SolidCalendarContentGenerator,+ useFullCalendar,+} from './FullCalendar';diff --git a/apps/web/src/features/calendar/time-format.ts b/apps/web/src/features/calendar/time-format.tsnew file mode 100644index 0000000000..11eca746ba--- /dev/null+++ b/apps/web/src/features/calendar/time-format.ts@@ -0,0 +1,40 @@+import type { CalendarTimeFormat } from './events/types';++/** FullCalendar and Intl options for the supported calendar time formats. */+export const CALENDAR_TIME_FORMAT_OPTIONS = {+ '12-hour': {+ hour: 'numeric',+ minute: '2-digit',+ hour12: true,+ },+ '24-hour': {+ hour: 'numeric',+ minute: '2-digit',+ hour12: false,+ },+} satisfies Record<CalendarTimeFormat, Intl.DateTimeFormatOptions>;++const calendarTimeFormatters = {+ '12-hour': new Intl.DateTimeFormat(+ undefined,+ CALENDAR_TIME_FORMAT_OPTIONS['12-hour']+ ),+ '24-hour': new Intl.DateTimeFormat(+ undefined,+ CALENDAR_TIME_FORMAT_OPTIONS['24-hour']+ ),+} satisfies Record<CalendarTimeFormat, Intl.DateTimeFormat>;++/** Returns the time format that matches the user's current locale. */+export function getDefaultCalendarTimeFormat(): CalendarTimeFormat {+ return new Intl.DateTimeFormat(undefined, {+ hour: 'numeric',+ }).resolvedOptions().hour12 === false+ ? '24-hour'+ : '12-hour';+}++/** Formats a time using the calendar's selected 12/24-hour preference. */+export function formatCalendarTime(date: Date, timeFormat: CalendarTimeFormat) {+ return calendarTimeFormatters[timeFormat].format(date);+}diff --git a/apps/web/src/features/calendar/useCalendarTimeGridHoverIndicator.ts b/apps/web/src/features/calendar/useCalendarTimeGridHoverIndicator.tsnew file mode 100644index 0000000000..efbe08defa--- /dev/null+++ b/apps/web/src/features/calendar/useCalendarTimeGridHoverIndicator.ts@@ -0,0 +1,70 @@+import type { Accessor } from 'solid-js';+import { createEffect, on, onCleanup } from 'solid-js';++const POINTER_TIME_FRAME_SELECTOR = '.fc-timegrid-col-frame';++/** Tracks the mouse time position across FullCalendar's week and day columns. */+export function useCalendarTimeGridHoverIndicator(+ calendarElement: Accessor<HTMLElement | undefined>+) {+ createEffect(+ on(calendarElement, (element) => {+ if (!element) return;++ const frames = () =>+ element.querySelectorAll<HTMLElement>(POINTER_TIME_FRAME_SELECTOR);++ const resetHoverIndicator = () => {+ for (const frame of frames()) {+ frame.style.removeProperty('--calendar-time-grid-hover-top');+ frame.removeAttribute('data-time-grid-hover');+ }+ };++ const handlePointerMove = (event: PointerEvent) => {+ let targetFrame: HTMLElement | undefined;++ if (event.pointerType === 'mouse') {+ for (const frame of frames()) {+ const frameBounds = frame.getBoundingClientRect();+ const scrollerBounds = frame+ .closest<HTMLElement>('.fc-scroller')+ ?.getBoundingClientRect();++ if (+ scrollerBounds &&+ event.clientX >= frameBounds.left &&+ event.clientX <= frameBounds.right &&+ event.clientY >= scrollerBounds.top &&+ event.clientY <= scrollerBounds.bottom+ ) {+ targetFrame = frame;+ break;+ }+ }+ }++ resetHoverIndicator();++ if (!targetFrame) return;++ const frameBounds = targetFrame.getBoundingClientRect();+ targetFrame.style.setProperty(+ '--calendar-time-grid-hover-top',+ `${event.clientY - frameBounds.top}px`+ );+ targetFrame.setAttribute('data-time-grid-hover', '');+ };++ element.addEventListener('scroll', resetHoverIndicator, true);+ element.addEventListener('pointermove', handlePointerMove);+ element.addEventListener('pointerleave', resetHoverIndicator);++ onCleanup(() => {+ element.removeEventListener('scroll', resetHoverIndicator, true);+ element.removeEventListener('pointermove', handlePointerMove);+ element.removeEventListener('pointerleave', resetHoverIndicator);+ });+ })+ );+}diff --git a/apps/web/src/lib/core/hotkey/tokens.ts b/apps/web/src/lib/core/hotkey/tokens.tsindex f69c8d5fe6..86318d48b6 100644--- a/apps/web/src/lib/core/hotkey/tokens.ts+++ b/apps/web/src/lib/core/hotkey/tokens.ts@@ -98,6 +98,7 @@ export const TOKENS = {gettingStarted: 'sidebar.goTo.gettingStarted',inbox: 'sidebar.goTo.inbox',activity: 'sidebar.goTo.activity',+ calendar: 'sidebar.goTo.calendar',search: 'sidebar.goTo.search',agents: 'sidebar.goTo.agents',mail: 'sidebar.goTo.mail',diff --git a/apps/web/src/routes/Root.tsx b/apps/web/src/routes/Root.tsxindex 2de44d4bfa..bbab08c52c 100644--- a/apps/web/src/routes/Root.tsx+++ b/apps/web/src/routes/Root.tsx@@ -357,6 +357,10 @@ const ROUTES: RouteDefinition[] = [path: '/activity',component: LAYOUT_ROUTE.component,},+ {+ path: '/calendar',+ component: LAYOUT_ROUTE.component,+ },{path: '/agents',component: LAYOUT_ROUTE.component,diff --git a/bun.lock b/bun.lockindex 6ec343a540..14b23fce97 100644--- a/bun.lock+++ b/bun.lock@@ -16,6 +16,7 @@"@codemirror/lang-python": "^6.2.1","@codemirror/lang-rust": "^6.0.2","@codemirror/language": "^6.11.3",+ "@corvu/calendar": "^0.1.2","@corvu/dialog": "^0.2.4","@corvu/drawer": "^0.2.4","@date-fns/tz": "^1.4.1",@@ -24,6 +25,10 @@"@fontsource-variable/inter": "^5.2.8","@fontsource-variable/playfair-display": "^5.2.8","@fontsource-variable/roboto-mono": "^5.2.8",+ "@fullcalendar/core": "^6.1.21",+ "@fullcalendar/daygrid": "^6.1.21",+ "@fullcalendar/interaction": "^6.1.21",+ "@fullcalendar/timegrid": "^6.1.21","@inkibra/tauri-plugins": "git+https://github.com/macro-inc/tauri-plugins.git#26537c8a46bb8424f9cf4021d08aa76aa7cd66ef","@kobalte/core": "^0.13.11","@leeoniya/ufuzzy": "^1.0.19",@@ -623,6 +628,8 @@"@coparse/web": ["@coparse/web@workspace:apps/web"],+ "@corvu/calendar": ["@corvu/[email protected]", "", { "dependencies": { "@corvu/utils": "~0.4.2" }, "peerDependencies": { "solid-js": "^1.8" } }, "sha512-Vbdns1iNNI0WTIwDZS7m9pHWtr/YTz7yrisXhHUCfl4mxDvb9W8MMmun651wiEjhL7+OrcNbbl2kTOmYSFIf4g=="],+"@corvu/dialog": ["@corvu/[email protected]", "", { "dependencies": { "@corvu/utils": "~0.4.2", "solid-dismissible": "~0.1.1", "solid-focus-trap": "~0.1.8", "solid-presence": "~0.2.0", "solid-prevent-scroll": "~0.1.10" }, "peerDependencies": { "solid-js": "^1.8" } }, "sha512-n54vJq+fOy8GVrnYBdJpD6JXNuyx7LOeMrRxwzAvZnYGpW8+AA12tnb/P/2emJj/HjOO5otheGKb0breshdFlA=="],"@corvu/drawer": ["@corvu/[email protected]", "", { "dependencies": { "@corvu/dialog": "~0.2.4", "@corvu/utils": "~0.4.2", "@solid-primitives/memo": "^1.4.1", "solid-transition-size": "~0.1.4" }, "peerDependencies": { "solid-js": "^1.8" } }, "sha512-7jQoGZ8ROB9CmXam2nMY2wEskU3IoFwZQywkF/7vrBc/edGsPv7mOVQ1GN6G+4nd7nrMZ3UtqHAhmRh9V0azlw=="],@@ -755,6 +762,14 @@"@fontsource-variable/roboto-mono": ["@fontsource-variable/[email protected]", "", {}, "sha512-h5r+KY/6qy8JEOj33JgcrFO81YAnvrc1EAwMpl/EPJLb2OIvOy0/jmB5M7qs7x/uXk5JUP5Ux4LrkeOK7faHkQ=="],+ "@fullcalendar/core": ["@fullcalendar/[email protected]", "", { "dependencies": { "preact": "~10.12.1" } }, "sha512-t3u/+sqh3Iq7TWtUnVLcGDUE6OWZh0UD3c04bI/l7lSLAgAKr3kngBmhHiQD1QXpwC8ZN5iNqG7a7gOVixhSKQ=="],++ "@fullcalendar/daygrid": ["@fullcalendar/[email protected]", "", { "peerDependencies": { "@fullcalendar/core": "~6.1.21" } }, "sha512-QYb1y40RGYLlOxKpYWg8O+7njEnKnFG8Tt7qjnubJGR35s1phQg67E+81y2TyAbbm59p2JFOCXGDk9t6KDujIA=="],++ "@fullcalendar/interaction": ["@fullcalendar/[email protected]", "", { "peerDependencies": { "@fullcalendar/core": "~6.1.21" } }, "sha512-WPYpqtljDWmU0Xm2cOtFrLlocgxv7cgkOppj34Q6OUUat8a6Cnd6kYo2JR+irP223PE5lBYHFNp1qh7SIpJc0w=="],++ "@fullcalendar/timegrid": ["@fullcalendar/[email protected]", "", { "dependencies": { "@fullcalendar/daygrid": "~6.1.21" }, "peerDependencies": { "@fullcalendar/core": "~6.1.21" } }, "sha512-2DnShx/jallGmb8QCkr6pAOu/zuPhJrP7+uTrAtSnbqsX7GF3lTxqSeNGkTQwsgF5g/ia8udhQ+JNYaE+TN1cQ=="],+"@gerrit0/mini-shiki": ["@gerrit0/[email protected]", "", { "dependencies": { "@shikijs/engine-oniguruma": "^3.23.0", "@shikijs/langs": "^3.23.0", "@shikijs/themes": "^3.23.0", "@shikijs/types": "^3.23.0", "@shikijs/vscode-textmate": "^10.0.2" } }, "sha512-bEMORlG0cqdjVyCEuU0cDQbORWX+kYCeo0kV1lbxF5bt4r7SID2l9bqsxJEM0zndaxpOUT7riCyIVEuqq/Ynxg=="],"@google-cloud/common": ["@google-cloud/[email protected]", "", { "dependencies": { "@google-cloud/projectify": "^4.0.0", "@google-cloud/promisify": "^4.0.0", "arrify": "^2.0.1", "duplexify": "^4.1.1", "extend": "^3.0.2", "google-auth-library": "^9.0.0", "html-entities": "^2.5.2", "retry-request": "^7.0.0", "teeny-request": "^9.0.0" } }, "sha512-V7bmBKYQyu0eVG2BFejuUjlBt+zrya6vtsKdY+JxMM/dNntPF41vZ9+LhOshEUH01zOHEqBSvI7Dad7ZS6aUeA=="],@@ -2699,7 +2714,7 @@"posthog-js": ["[email protected]", "", { "dependencies": { "@posthog/browser-common": "^0.2.4", "@posthog/core": "^1.45.2", "@posthog/types": "^1.398.0", "core-js": "^3.49.0", "dompurify": "^3.3.2", "fflate": "^0.4.8", "preact": "^10.29.3", "query-selector-shadow-dom": "^1.0.1", "web-vitals": "^5.3.0" } }, "sha512-I3rE1WQI9by/RrtgoE34opVmEsnCyUui5EkD3VYJWRiBIkglcn7A3Ixk7tniPEOfGMiDZFETX8ORAQBt47Z0VA=="],- "preact": ["[email protected]", "", { "peerDependencies": { "preact-render-to-string": ">=5" }, "optionalPeers": ["preact-render-to-string"] }, "sha512-DCHYrK/B10yUD3ZjLfhZ3WIE/9Vf9VFUODcRE2dRomTYDpJk6z6L9wecSfhfE6M9ZTHUdyQkoC46arIDhEV84Q=="],+ "preact": ["[email protected]", "", {}, "sha512-l8386ixSsBdbreOAkqtrwqHwdvR35ID8c3rKPa8lCWuO86dBi32QWHV4vfsZK1utLLFMvw+Z5Ad4XLkZzchscg=="],"prefix-style": ["[email protected]", "", {}, "sha512-gdr1MBNVT0drzTq95CbSNdsrBDoHGlb2aDJP/FoY+1e+jSDPOb1Cv554gH2MGiSr2WTcXi/zu+NaFzfcHQkfBQ=="],@@ -3537,6 +3552,8 @@"posthog-js/fflate": ["[email protected]", "", {}, "sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA=="],+ "posthog-js/preact": ["[email protected]", "", { "peerDependencies": { "preact-render-to-string": ">=5" }, "optionalPeers": ["preact-render-to-string"] }, "sha512-DCHYrK/B10yUD3ZjLfhZ3WIE/9Vf9VFUODcRE2dRomTYDpJk6z6L9wecSfhfE6M9ZTHUdyQkoC46arIDhEV84Q=="],+"pretty-format/ansi-styles": ["[email protected]", "", {}, "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA=="],"protobufjs/@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": ">=7.24.0 <7.24.7" } }, "sha512-OScDchr2fwuUmWdf4kZ9h7PcJiYDVInhJizG/biAq3cAvqwYktuy/TYGGdZNMtNTFUP7rnb0NU4TUdm82kt4Rg=="],diff --git a/nix-support/node_modules-hashes.json b/nix-support/node_modules-hashes.jsonindex 5961a44a6e..4cdaf1ab2a 100644--- a/nix-support/node_modules-hashes.json+++ b/nix-support/node_modules-hashes.json@@ -1,6 +1,6 @@{"nodeModules": {- "aarch64-darwin": "sha256-rkAFd6FOl3zek1zp+qnWdqfxSOIZooaewfJEVQYkGsI=",- "x86_64-linux": "sha256-yyIi9+SGgDW9/ZfaQFMBk9aAbehy/GwXC/7KzL+QE9I="+ "aarch64-darwin": "sha256-9faTf5jCfZqQ6iZQJZ+l6uMtiZxGdBwA7LLvJiI1RTU=",+ "x86_64-linux": "sha256-nIFUdH7qp4wf8a/IObVpLWZSKP/n2RSJ64cOPfDzG3s="}}