feat: implement date and time picker in HITL edit panel

- Added a DateTimePickerField component to allow users to select date and time in the HITL edit panel.
- Updated the EmailsTagField to use a ref for onChange to improve performance.
- Modified the ExtraField type to support "datetime-local" for better event management in Google Calendar tools.
This commit is contained in:
Anish Sarkar 2026-03-20 23:07:54 +05:30
parent 4b54826d78
commit 5e23949af6
3 changed files with 114 additions and 8 deletions

View file

@ -2,7 +2,6 @@
import { makeAssistantToolUI } from "@assistant-ui/react";
import {
CalendarPlusIcon,
ClockIcon,
MapPinIcon,
UsersIcon,
@ -250,7 +249,6 @@ function ApprovalCard({
{/* Header */}
<div className="flex items-start justify-between px-5 pt-5 pb-4 select-none">
<div className="flex items-center gap-2">
<CalendarPlusIcon className="size-4 text-muted-foreground shrink-0" />
<div>
<p className="text-sm font-semibold text-foreground">
{decided === "reject"
@ -287,7 +285,7 @@ function ApprovalCard({
{ key: "start_datetime", label: "Start", type: "datetime-local", value: pendingEdits?.start_datetime ?? args.start_datetime ?? "" },
{ key: "end_datetime", label: "End", type: "datetime-local", value: pendingEdits?.end_datetime ?? args.end_datetime ?? "" },
{ key: "location", label: "Location", type: "text", value: pendingEdits?.location ?? args.location ?? "" },
{ key: "attendees", label: "Attendees (comma-separated emails)", type: "text", value: pendingEdits?.attendees ?? attendeesList.join(", ") },
{ key: "attendees", label: "Attendees", type: "emails", value: pendingEdits?.attendees ?? attendeesList.join(", ") },
];
openHitlEditPanel({
title: pendingEdits?.summary ?? (args.summary ?? ""),

View file

@ -328,7 +328,7 @@ function ApprovalCard({
{ key: "start_datetime", label: "Start", type: "datetime-local", value: proposedStart },
{ key: "end_datetime", label: "End", type: "datetime-local", value: proposedEnd },
{ key: "location", label: "Location", type: "text", value: proposedLocation },
{ key: "attendees", label: "Attendees (comma-separated emails)", type: "text", value: proposedAttendeesStr },
{ key: "attendees", label: "Attendees", type: "emails", value: proposedAttendeesStr },
];
openHitlEditPanel({
title: proposedSummary,