From 82e15ae232108c2fc2af1c184b1be1ab2d351da8 Mon Sep 17 00:00:00 2001 From: Roohith Bala Date: Sat, 13 Jun 2026 18:31:25 +0530 Subject: [PATCH 1/2] fix: calendar properties and inline code font --- .../fullcalendar/event/EventDisplay.tsx | 13 ++++++++++++ .../event/components/MonthAllDayEvent.tsx | 17 +++++++++++++++- .../components/MonthMultiDayTimedEvent.tsx | 17 +++++++++++++++- .../event/components/MonthTimedEvent.tsx | 18 +++++++++++++++-- .../event/components/WeekAllDayEvent.tsx | 17 +++++++++++++++- .../event/components/WeekTimedEvent.tsx | 20 ++++++++++++++++--- .../editor/components/leaf/Leaf.tsx | 2 +- tsconfig.json | 1 + 8 files changed, 96 insertions(+), 9 deletions(-) diff --git a/src/components/database/fullcalendar/event/EventDisplay.tsx b/src/components/database/fullcalendar/event/EventDisplay.tsx index e0515ff1e..b15d342cf 100644 --- a/src/components/database/fullcalendar/event/EventDisplay.tsx +++ b/src/components/database/fullcalendar/event/EventDisplay.tsx @@ -1,4 +1,8 @@ import { EventApi, EventContentArg } from '@fullcalendar/core'; +import { useMemo } from 'react'; + +import { useFieldsSelector, isAIFieldType } from '@/application/database-yjs'; +import { useAIEnabled } from '@/components/app/app.hooks'; import { MonthAllDayEvent, @@ -26,6 +30,14 @@ export function EventDisplay({ className, }: EventDisplayProps) { const rowId = event.extendedProps?.rowId; + const fields = useFieldsSelector(); + const aiEnabled = useAIEnabled(); + + const showFields = useMemo(() => { + return fields.filter( + (field) => !field.isPrimary && (aiEnabled || !isAIFieldType(field.fieldType)) + ); + }, [fields, aiEnabled]); if (!rowId) return null; @@ -54,6 +66,7 @@ export function EventDisplay({ showLeftIndicator={showLeftIndicator} className={className} rowId={rowId} + showFields={showFields} /> ); diff --git a/src/components/database/fullcalendar/event/components/MonthAllDayEvent.tsx b/src/components/database/fullcalendar/event/components/MonthAllDayEvent.tsx index e786d5537..85dfd119f 100644 --- a/src/components/database/fullcalendar/event/components/MonthAllDayEvent.tsx +++ b/src/components/database/fullcalendar/event/components/MonthAllDayEvent.tsx @@ -2,6 +2,8 @@ import { EventApi, EventContentArg } from '@fullcalendar/core'; import { useCallback } from 'react'; import { cn } from '@/lib/utils'; +import { Column } from '@/application/database-yjs'; +import CardField from '@/components/database/components/field/CardField'; import { EventIconButton } from './EventIconButton'; @@ -12,6 +14,7 @@ interface MonthAllDayEventProps { showLeftIndicator?: boolean; className?: string; rowId: string; + showFields?: Column[]; } export function MonthAllDayEvent({ @@ -21,6 +24,7 @@ export function MonthAllDayEvent({ showLeftIndicator = true, className, rowId, + showFields, }: MonthAllDayEventProps) { const isEventStart = eventInfo.isStart; const isEventEnd = eventInfo.isEnd; @@ -113,8 +117,19 @@ export function MonthAllDayEvent({
- {getDisplayContent()} + {getDisplayContent()}
+ {showFields && showFields.length > 0 && ( +
+ {showFields.map((field) => ( + + ))} +
+ )}
diff --git a/src/components/database/fullcalendar/event/components/MonthMultiDayTimedEvent.tsx b/src/components/database/fullcalendar/event/components/MonthMultiDayTimedEvent.tsx index 212310f8e..e9ce77f53 100644 --- a/src/components/database/fullcalendar/event/components/MonthMultiDayTimedEvent.tsx +++ b/src/components/database/fullcalendar/event/components/MonthMultiDayTimedEvent.tsx @@ -4,6 +4,8 @@ import { useCallback } from 'react'; import { useTimeFormat } from '@/components/database/fullcalendar/hooks'; import { cn } from '@/lib/utils'; +import { Column } from '@/application/database-yjs'; +import CardField from '@/components/database/components/field/CardField'; import { EventIconButton } from './EventIconButton'; @@ -14,6 +16,7 @@ interface MonthMultiDayTimedEventProps { showLeftIndicator?: boolean; className?: string; rowId: string; + showFields?: Column[]; } export function MonthMultiDayTimedEvent({ @@ -23,6 +26,7 @@ export function MonthMultiDayTimedEvent({ showLeftIndicator = true, className, rowId, + showFields, }: MonthMultiDayTimedEventProps) { const { formatTimeDisplay } = useTimeFormat(); const isEventStart = eventInfo.isStart; @@ -122,8 +126,19 @@ export function MonthMultiDayTimedEvent({ )} - {getDisplayContent()} + {getDisplayContent()} + {showFields && showFields.length > 0 && ( +
+ {showFields.map((field) => ( + + ))} +
+ )} diff --git a/src/components/database/fullcalendar/event/components/MonthTimedEvent.tsx b/src/components/database/fullcalendar/event/components/MonthTimedEvent.tsx index fa602fb75..677bbe657 100644 --- a/src/components/database/fullcalendar/event/components/MonthTimedEvent.tsx +++ b/src/components/database/fullcalendar/event/components/MonthTimedEvent.tsx @@ -3,6 +3,8 @@ import dayjs from 'dayjs'; import { useTimeFormat } from '@/components/database/fullcalendar/hooks'; import { cn } from '@/lib/utils'; +import { Column } from '@/application/database-yjs'; +import CardField from '@/components/database/components/field/CardField'; import { EventIconButton } from './EventIconButton'; @@ -13,9 +15,10 @@ interface MonthTimedEventProps { showLeftIndicator?: boolean; className?: string; rowId: string; + showFields?: Column[]; } -export function MonthTimedEvent({ event, onClick, showLeftIndicator = true, className, rowId }: MonthTimedEventProps) { +export function MonthTimedEvent({ event, onClick, showLeftIndicator = true, className, rowId, showFields }: MonthTimedEventProps) { const { formatTimeDisplay } = useTimeFormat(); const handleClick = () => { onClick?.(event); @@ -48,9 +51,20 @@ export function MonthTimedEvent({ event, onClick, showLeftIndicator = true, clas )}
- {event.title || 'Untitled'} + {event.title || 'Untitled'}
+ {showFields && showFields.length > 0 && ( +
+ {showFields.map((field) => ( + + ))} +
+ )} diff --git a/src/components/database/fullcalendar/event/components/WeekAllDayEvent.tsx b/src/components/database/fullcalendar/event/components/WeekAllDayEvent.tsx index 2b11b94af..0d7c1e37d 100644 --- a/src/components/database/fullcalendar/event/components/WeekAllDayEvent.tsx +++ b/src/components/database/fullcalendar/event/components/WeekAllDayEvent.tsx @@ -2,6 +2,8 @@ import { EventApi, EventContentArg } from '@fullcalendar/core'; import { useCallback, useMemo } from 'react'; import { cn } from '@/lib/utils'; +import { Column } from '@/application/database-yjs'; +import CardField from '@/components/database/components/field/CardField'; import { EventIconButton } from './EventIconButton'; @@ -12,6 +14,7 @@ interface WeekAllDayEventProps { showLeftIndicator?: boolean; className?: string; rowId: string; + showFields?: Column[]; } export function WeekAllDayEvent({ @@ -21,6 +24,7 @@ export function WeekAllDayEvent({ showLeftIndicator = true, className, rowId, + showFields, }: WeekAllDayEventProps) { const isEventStart = eventInfo.isStart; const isEventEnd = eventInfo.isEnd; @@ -85,7 +89,7 @@ export function WeekAllDayEvent({ return (
- {getDisplayContent()} + {getDisplayContent()}
); }, [getDisplayContent, rowId]); @@ -121,6 +125,17 @@ export function WeekAllDayEvent({ {showLeftIndicator && !hideLine &&
}
{renderAllDayEvent} + {showFields && showFields.length > 0 && ( +
+ {showFields.map((field) => ( + + ))} +
+ )}
diff --git a/src/components/database/fullcalendar/event/components/WeekTimedEvent.tsx b/src/components/database/fullcalendar/event/components/WeekTimedEvent.tsx index d1e188cbb..42720c3bf 100644 --- a/src/components/database/fullcalendar/event/components/WeekTimedEvent.tsx +++ b/src/components/database/fullcalendar/event/components/WeekTimedEvent.tsx @@ -4,6 +4,8 @@ import { useCallback, useMemo } from 'react'; import { useTimeFormat } from '@/components/database/fullcalendar/hooks'; import { cn } from '@/lib/utils'; +import { Column } from '@/application/database-yjs'; +import CardField from '@/components/database/components/field/CardField'; import { EventIconButton } from './EventIconButton'; @@ -14,9 +16,10 @@ interface WeekTimedEventProps { showLeftIndicator?: boolean; className?: string; rowId: string; + showFields?: Column[]; } -export function WeekTimedEvent({ event, eventInfo, onClick, className, rowId }: WeekTimedEventProps) { +export function WeekTimedEvent({ event, eventInfo, onClick, className, rowId, showFields }: WeekTimedEventProps) { const { formatTimeDisplay } = useTimeFormat(); const isEventStart = eventInfo.isStart; const isEventEnd = eventInfo.isEnd; @@ -94,7 +97,7 @@ export function WeekTimedEvent({ event, eventInfo, onClick, className, rowId }: : undefined } > - {getDisplayContent()} + {getDisplayContent()} {moreThanHalfHour ? '' : ','} @@ -107,9 +110,20 @@ export function WeekTimedEvent({ event, eventInfo, onClick, className, rowId }: )} + {moreThanHalfHour && showFields && showFields.length > 0 && ( +
+ {showFields.map((field) => ( + + ))} +
+ )} ); - }, [event.end, event.start, rowId, getDisplayContent, isEventStart, formatTimeDisplay, isRange]); + }, [event.end, event.start, rowId, getDisplayContent, isEventStart, formatTimeDisplay, isRange, showFields]); const isShortEvent = event.end && dayjs(event.end).diff(dayjs(event.start), 'minute') < 30; const isCompactLayout = !event.end || isShortEvent; diff --git a/src/components/editor/components/leaf/Leaf.tsx b/src/components/editor/components/leaf/Leaf.tsx index 3ffb02137..ac07cb34d 100644 --- a/src/components/editor/components/leaf/Leaf.tsx +++ b/src/components/editor/components/leaf/Leaf.tsx @@ -62,7 +62,7 @@ export function Leaf({ attributes, children, leaf, text }: RenderLeafProps) { if (leaf.code && !(leaf.formula || leaf.mention || leaf.reference)) { newChildren = ( - + {newChildren} ); diff --git a/tsconfig.json b/tsconfig.json index 7e79824f4..028eff918 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -27,6 +27,7 @@ "jest" ], "typeRoots": [ + "./node_modules/@types", "./node_modules/@fullcalendar" ], "baseUrl": ".", From 37f840b1033e1063f7818a90f15930bc711a9602 Mon Sep 17 00:00:00 2001 From: Roohith Bala Date: Sat, 13 Jun 2026 18:44:20 +0530 Subject: [PATCH 2/2] refactor: extract EventPropertiesList and limit properties display to first 5 fields --- .../event/components/EventPropertiesList.tsx | 26 +++++++++++++++++++ .../event/components/MonthAllDayEvent.tsx | 14 ++-------- .../components/MonthMultiDayTimedEvent.tsx | 14 ++-------- .../event/components/MonthTimedEvent.tsx | 14 ++-------- .../event/components/WeekAllDayEvent.tsx | 14 ++-------- .../event/components/WeekTimedEvent.tsx | 14 ++-------- .../fullcalendar/event/components/index.ts | 3 ++- 7 files changed, 38 insertions(+), 61 deletions(-) create mode 100644 src/components/database/fullcalendar/event/components/EventPropertiesList.tsx diff --git a/src/components/database/fullcalendar/event/components/EventPropertiesList.tsx b/src/components/database/fullcalendar/event/components/EventPropertiesList.tsx new file mode 100644 index 000000000..e65dc91e7 --- /dev/null +++ b/src/components/database/fullcalendar/event/components/EventPropertiesList.tsx @@ -0,0 +1,26 @@ +import { Column } from '@/application/database-yjs'; +import CardField from '@/components/database/components/field/CardField'; + +interface EventPropertiesListProps { + rowId: string; + showFields?: Column[]; +} + +export function EventPropertiesList({ rowId, showFields }: EventPropertiesListProps) { + if (!showFields || showFields.length === 0) return null; + + // Cap to first 5 fields to prevent dense calendar views from becoming too tall/noisy + const displayedFields = showFields.slice(0, 5); + + return ( +
+ {displayedFields.map((field) => ( + + ))} +
+ ); +} diff --git a/src/components/database/fullcalendar/event/components/MonthAllDayEvent.tsx b/src/components/database/fullcalendar/event/components/MonthAllDayEvent.tsx index 85dfd119f..0dd1cc1ba 100644 --- a/src/components/database/fullcalendar/event/components/MonthAllDayEvent.tsx +++ b/src/components/database/fullcalendar/event/components/MonthAllDayEvent.tsx @@ -3,7 +3,7 @@ import { useCallback } from 'react'; import { cn } from '@/lib/utils'; import { Column } from '@/application/database-yjs'; -import CardField from '@/components/database/components/field/CardField'; +import { EventPropertiesList } from './EventPropertiesList'; import { EventIconButton } from './EventIconButton'; @@ -119,17 +119,7 @@ export function MonthAllDayEvent({ {getDisplayContent()} - {showFields && showFields.length > 0 && ( -
- {showFields.map((field) => ( - - ))} -
- )} + diff --git a/src/components/database/fullcalendar/event/components/MonthMultiDayTimedEvent.tsx b/src/components/database/fullcalendar/event/components/MonthMultiDayTimedEvent.tsx index e9ce77f53..1e6148ee1 100644 --- a/src/components/database/fullcalendar/event/components/MonthMultiDayTimedEvent.tsx +++ b/src/components/database/fullcalendar/event/components/MonthMultiDayTimedEvent.tsx @@ -5,7 +5,7 @@ import { useCallback } from 'react'; import { useTimeFormat } from '@/components/database/fullcalendar/hooks'; import { cn } from '@/lib/utils'; import { Column } from '@/application/database-yjs'; -import CardField from '@/components/database/components/field/CardField'; +import { EventPropertiesList } from './EventPropertiesList'; import { EventIconButton } from './EventIconButton'; @@ -128,17 +128,7 @@ export function MonthMultiDayTimedEvent({ {getDisplayContent()} - {showFields && showFields.length > 0 && ( -
- {showFields.map((field) => ( - - ))} -
- )} + diff --git a/src/components/database/fullcalendar/event/components/MonthTimedEvent.tsx b/src/components/database/fullcalendar/event/components/MonthTimedEvent.tsx index 677bbe657..52cbb282b 100644 --- a/src/components/database/fullcalendar/event/components/MonthTimedEvent.tsx +++ b/src/components/database/fullcalendar/event/components/MonthTimedEvent.tsx @@ -4,7 +4,7 @@ import dayjs from 'dayjs'; import { useTimeFormat } from '@/components/database/fullcalendar/hooks'; import { cn } from '@/lib/utils'; import { Column } from '@/application/database-yjs'; -import CardField from '@/components/database/components/field/CardField'; +import { EventPropertiesList } from './EventPropertiesList'; import { EventIconButton } from './EventIconButton'; @@ -54,17 +54,7 @@ export function MonthTimedEvent({ event, onClick, showLeftIndicator = true, clas {event.title || 'Untitled'} - {showFields && showFields.length > 0 && ( -
- {showFields.map((field) => ( - - ))} -
- )} + diff --git a/src/components/database/fullcalendar/event/components/WeekAllDayEvent.tsx b/src/components/database/fullcalendar/event/components/WeekAllDayEvent.tsx index 0d7c1e37d..f9bb51551 100644 --- a/src/components/database/fullcalendar/event/components/WeekAllDayEvent.tsx +++ b/src/components/database/fullcalendar/event/components/WeekAllDayEvent.tsx @@ -3,7 +3,7 @@ import { useCallback, useMemo } from 'react'; import { cn } from '@/lib/utils'; import { Column } from '@/application/database-yjs'; -import CardField from '@/components/database/components/field/CardField'; +import { EventPropertiesList } from './EventPropertiesList'; import { EventIconButton } from './EventIconButton'; @@ -125,17 +125,7 @@ export function WeekAllDayEvent({ {showLeftIndicator && !hideLine &&
}
{renderAllDayEvent} - {showFields && showFields.length > 0 && ( -
- {showFields.map((field) => ( - - ))} -
- )} +
diff --git a/src/components/database/fullcalendar/event/components/WeekTimedEvent.tsx b/src/components/database/fullcalendar/event/components/WeekTimedEvent.tsx index 42720c3bf..a1d416808 100644 --- a/src/components/database/fullcalendar/event/components/WeekTimedEvent.tsx +++ b/src/components/database/fullcalendar/event/components/WeekTimedEvent.tsx @@ -5,7 +5,7 @@ import { useCallback, useMemo } from 'react'; import { useTimeFormat } from '@/components/database/fullcalendar/hooks'; import { cn } from '@/lib/utils'; import { Column } from '@/application/database-yjs'; -import CardField from '@/components/database/components/field/CardField'; +import { EventPropertiesList } from './EventPropertiesList'; import { EventIconButton } from './EventIconButton'; @@ -110,17 +110,7 @@ export function WeekTimedEvent({ event, eventInfo, onClick, className, rowId, sh
)} - {moreThanHalfHour && showFields && showFields.length > 0 && ( -
- {showFields.map((field) => ( - - ))} -
- )} + ); }, [event.end, event.start, rowId, getDisplayContent, isEventStart, formatTimeDisplay, isRange, showFields]); diff --git a/src/components/database/fullcalendar/event/components/index.ts b/src/components/database/fullcalendar/event/components/index.ts index eb7c80082..9c1aaaaa0 100644 --- a/src/components/database/fullcalendar/event/components/index.ts +++ b/src/components/database/fullcalendar/event/components/index.ts @@ -3,4 +3,5 @@ export { MonthTimedEvent } from './MonthTimedEvent'; export { MonthMultiDayTimedEvent } from './MonthMultiDayTimedEvent'; export { WeekAllDayEvent } from './WeekAllDayEvent'; export { WeekTimedEvent } from './WeekTimedEvent'; -export { EventIconButton } from './EventIconButton'; \ No newline at end of file +export { EventIconButton } from './EventIconButton'; +export { EventPropertiesList } from './EventPropertiesList'; \ No newline at end of file