Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(conversations): add "Apply and set to on hold" to snooze picker (#74583)

Luke Belton6d2b713ab817
diff --git a/frontend/src/lib/lemon-ui/LemonCalendar/LemonCalendarSelect.tsx b/frontend/src/lib/lemon-ui/LemonCalendar/LemonCalendarSelect.tsx
index e9687d86915b..0c701c33d3de 100644
--- a/frontend/src/lib/lemon-ui/LemonCalendar/LemonCalendarSelect.tsx
+++ b/frontend/src/lib/lemon-ui/LemonCalendar/LemonCalendarSelect.tsx
@@ -87,6 +87,8 @@ export interface LemonCalendarSelectProps {
onToggleTime?: (value: boolean) => void
/** Use 24-hour format instead of 12-hour with AM/PM */
use24HourFormat?: boolean
+ /** Extra "Apply" variants shown in a dropdown next to the Apply button. Each receives the selected date. */
+ applyActions?: { label: string; onClick: (date: dayjs.Dayjs) => void }[]
}
export function LemonCalendarSelect({
@@ -100,6 +102,7 @@ export function LemonCalendarSelect({
showTimeToggle,
onToggleTime,
use24HourFormat = false,
+ applyActions,
}: LemonCalendarSelectProps): JSX.Element {
const calendarRef = useRef<HTMLDivElement | null>(null)
const [selectValue, setSelectValue] = useState<dayjs.Dayjs | null>(value ? value.startOf(granularity) : null)
@@ -232,6 +235,28 @@ export function LemonCalendarSelect({
disabled={!selectValue}
onClick={() => selectValue && onChange && onChange(selectValue)}
data-attr="lemon-calendar-select-apply"
+ sideAction={
+ applyActions?.length
+ ? {
+ disabled: !selectValue,
+ 'aria-label': 'More apply options',
+ dropdown: {
+ placement: 'bottom-end',
+ overlay: applyActions.map((action) => (
+ <LemonButton
+ key={action.label}
+ fullWidth
+ size="small"
+ disabled={!selectValue}
+ onClick={() => selectValue && action.onClick(selectValue)}
+ >
+ {action.label}
+ </LemonButton>
+ )),
+ },
+ }
+ : undefined
+ }
>
Apply
</LemonButton>
@@ -274,6 +299,13 @@ export function LemonCalendarSelectInput(props: LemonCalendarSelectInputProps):
props.onChange?.(value)
setUncontrolledVisible(false)
}}
+ applyActions={props.applyActions?.map((action) => ({
+ ...action,
+ onClick: (date) => {
+ action.onClick(date)
+ setUncontrolledVisible(false)
+ },
+ }))}
onClose={() => {
setUncontrolledVisible(false)
props.onClose?.()
diff --git a/products/conversations/frontend/scenes/ticket/SupportTicketScene.tsx b/products/conversations/frontend/scenes/ticket/SupportTicketScene.tsx
index 17585beb0db3..831e0cc40ee6 100644
--- a/products/conversations/frontend/scenes/ticket/SupportTicketScene.tsx
+++ b/products/conversations/frontend/scenes/ticket/SupportTicketScene.tsx
@@ -485,6 +485,15 @@ export function SupportTicketScene({ ticketId }: { ticketId: string }): JSX.Elem
selectionPeriod="upcoming"
clearable
placeholder="Not snoozed"
+ applyActions={[
+ {
+ label: 'Apply and set to on hold',
+ onClick: (date) => {
+ setSnoozedUntil(date.startOf('minute').toISOString())
+ setStatus('on_hold')
+ },
+ },
+ ]}
buttonProps={{
size: 'small',
type: 'secondary',