diff --git a/desktop/src/features/home/ui/HomeView.tsx b/desktop/src/features/home/ui/HomeView.tsx index fd5085bb31..a1361200f0 100644 --- a/desktop/src/features/home/ui/HomeView.tsx +++ b/desktop/src/features/home/ui/HomeView.tsx @@ -41,6 +41,7 @@ import { countDueReminders, useRemindersQuery, } from "@/features/reminders/hooks"; +import { useRemindLater } from "@/features/reminders/ui/RemindMeLaterProvider"; import { deleteMessage, sendChannelMessage } from "@/shared/api/tauri"; import type { HomeFeedResponse } from "@/shared/api/types"; import { KIND_REACTION } from "@/shared/constants/kinds"; @@ -108,6 +109,7 @@ export function HomeView({ ); const [isDeletingMessage, setIsDeletingMessage] = React.useState(false); const [isSendingReply, setIsSendingReply] = React.useState(false); + const { openReminder, activeReminderEventIds } = useRemindLater(); const [localRepliesByItemId, setLocalRepliesByItemId] = React.useState< Record >({}); @@ -407,11 +409,29 @@ export function HomeView({ > {showListPane ? ( { + const channelId = item.item.channelId; + if (!channelId) { + return; + } + + onOpenContext(channelId, item.id); + }} + onRemindLater={(item) => { + openReminder({ + eventId: item.id, + channelId: item.item.channelId ?? "", + preview: item.preview.slice(0, 100), + authorPubkey: item.item.pubkey, + }); + }} onSelect={(itemId) => { handleUserSelectItem(itemId); markItemRead(itemId); diff --git a/desktop/src/features/home/ui/InboxListPane.tsx b/desktop/src/features/home/ui/InboxListPane.tsx index c4fa6a1dfc..205e8ad13c 100644 --- a/desktop/src/features/home/ui/InboxListPane.tsx +++ b/desktop/src/features/home/ui/InboxListPane.tsx @@ -1,4 +1,4 @@ -import { ChevronDown, Mail } from "lucide-react"; +import { Clock, ExternalLink, Mail, MailOpen, ChevronDown } from "lucide-react"; import * as React from "react"; import { @@ -12,6 +12,7 @@ import { TopChromeInsetHeader } from "@/shared/layout/TopChromeInsetHeader"; import { cn } from "@/shared/lib/cn"; import { Button } from "@/shared/ui/button"; import { Markdown } from "@/shared/ui/markdown"; +import { Tooltip, TooltipContent, TooltipTrigger } from "@/shared/ui/tooltip"; import { DropdownMenu, DropdownMenuContent, @@ -36,11 +37,15 @@ type InboxListPaneProps = { filter: InboxFilter; items: InboxItem[]; onFilterChange: (filter: InboxFilter) => void; + onMarkUnread: (itemId: string) => void; + onOpenDirect: (item: InboxItem) => void; + onRemindLater: (item: InboxItem) => void; onSelect: (itemId: string) => void; selectedId: string | null; showRightDivider?: boolean; dueReminderCount: number; reminderPubkey?: string; + activeReminderEventIds?: ReadonlySet; }; export function InboxListPane({ @@ -48,11 +53,15 @@ export function InboxListPane({ filter, items, onFilterChange, + onMarkUnread, + onOpenDirect, + onRemindLater, onSelect, selectedId, showRightDivider = false, dueReminderCount, reminderPubkey, + activeReminderEventIds, }: InboxListPaneProps) { const activeFilter = FILTER_OPTIONS.find((option) => option.value === filter); const isReminders = filter === "reminders"; @@ -61,80 +70,116 @@ export function InboxListPane({ const renderItem = (item: InboxItem) => { const isSelected = item.id === selectedId; const isDone = doneSet.has(item.id); + const hasActiveReminder = activeReminderEventIds?.has(item.id) ?? false; + const hasChannelTarget = Boolean(item.item.channelId); const typeLabel = formatInboxTypeLabel(item); return ( - + +
+ onMarkUnread(item.id)} + > + + + onOpenDirect(item)} + > + + + onRemindLater(item)} + > + +
- + ); }; @@ -248,3 +293,44 @@ export function InboxListPane({ ); } + +function InboxRowActionButton({ + active = false, + children, + disabled = false, + label, + onClick, +}: { + active?: boolean; + children: React.ReactNode; + disabled?: boolean; + label: string; + onClick: () => void; +}) { + return ( + + + + + {label} + + ); +}