From 2a40105f169bd1c6e13ea519bfffe4f9939a98e6 Mon Sep 17 00:00:00 2001 From: Thomas Petersen Date: Wed, 13 May 2026 18:28:05 -0400 Subject: [PATCH] fix(desktop): simplify inbox mention conversation view Co-authored-by: Cursor --- desktop/src/app/routes/index.tsx | 5 - desktop/src/features/home/ui/HomeScreen.tsx | 3 - desktop/src/features/home/ui/HomeView.tsx | 3 - .../src/features/home/ui/InboxDetailPane.tsx | 194 ++++++++---------- 4 files changed, 85 insertions(+), 120 deletions(-) diff --git a/desktop/src/app/routes/index.tsx b/desktop/src/app/routes/index.tsx index 753d876076..21942ba15c 100644 --- a/desktop/src/app/routes/index.tsx +++ b/desktop/src/app/routes/index.tsx @@ -1,6 +1,5 @@ import { createFileRoute } from "@tanstack/react-router"; -import { useAppNavigation } from "@/app/navigation/useAppNavigation"; import { useChannelsQuery } from "@/features/channels/hooks"; import { useIdentityQuery } from "@/shared/api/hooks"; import { HomeScreen } from "@/features/home/ui/HomeScreen"; @@ -10,7 +9,6 @@ export const Route = createFileRoute("/")({ }); function HomeRouteComponent() { - const { goChannel } = useAppNavigation(); const channelsQuery = useChannelsQuery(); const identityQuery = useIdentityQuery(); const channels = channelsQuery.data ?? []; @@ -20,9 +18,6 @@ function HomeRouteComponent() { { - void goChannel(channelId); - }} /> ); } diff --git a/desktop/src/features/home/ui/HomeScreen.tsx b/desktop/src/features/home/ui/HomeScreen.tsx index 3093a04810..57a0e16080 100644 --- a/desktop/src/features/home/ui/HomeScreen.tsx +++ b/desktop/src/features/home/ui/HomeScreen.tsx @@ -5,13 +5,11 @@ import { HomeView } from "@/features/home/ui/HomeView"; type HomeScreenProps = { availableChannelIds: ReadonlySet; currentPubkey?: string; - onOpenChannel: (channelId: string) => void; }; export function HomeScreen({ availableChannelIds, currentPubkey, - onOpenChannel, }: HomeScreenProps) { const homeFeedQuery = useHomeFeedQuery(); @@ -35,7 +33,6 @@ export function HomeScreen({ } feed={homeFeedQuery.data} isLoading={homeFeedQuery.isLoading} - onOpenChannel={onOpenChannel} onRefresh={() => { void homeFeedQuery.refetch(); }} diff --git a/desktop/src/features/home/ui/HomeView.tsx b/desktop/src/features/home/ui/HomeView.tsx index f6de6dfa2a..d1d5abfcd4 100644 --- a/desktop/src/features/home/ui/HomeView.tsx +++ b/desktop/src/features/home/ui/HomeView.tsx @@ -104,7 +104,6 @@ type HomeViewProps = { errorMessage?: string; currentPubkey?: string; availableChannelIds: ReadonlySet; - onOpenChannel: (channelId: string) => void; onRefresh: () => void; }; @@ -114,7 +113,6 @@ export function HomeView({ errorMessage, currentPubkey, availableChannelIds, - onOpenChannel, onRefresh, }: HomeViewProps) { const [filter, setFilter] = React.useState("all"); @@ -371,7 +369,6 @@ export function HomeView({ setIsDeletingMessage(false); }); }} - onOpenChannel={onOpenChannel} onSendReply={async ({ content, mediaTags, diff --git a/desktop/src/features/home/ui/InboxDetailPane.tsx b/desktop/src/features/home/ui/InboxDetailPane.tsx index cb02be3b90..b0fa94b11b 100644 --- a/desktop/src/features/home/ui/InboxDetailPane.tsx +++ b/desktop/src/features/home/ui/InboxDetailPane.tsx @@ -1,11 +1,8 @@ import { - ArrowUpRight, CheckCheck, - CircleDot, Mail, MailOpen, MoreHorizontal, - Reply, Trash2, } from "lucide-react"; import * as React from "react"; @@ -48,7 +45,6 @@ type InboxDetailPaneProps = { messages?: InboxContextMessage[]; replies?: InboxReply[]; onDelete: () => void; - onOpenChannel: (channelId: string) => void; onSendReply: (input: { content: string; mediaTags?: string[][]; @@ -93,13 +89,14 @@ export function InboxDetailPane({ messages = [], replies = [], onDelete, - onOpenChannel, onSendReply, onToggleDone, onToggleReaction, }: InboxDetailPaneProps) { const detailPaneRef = React.useRef(null); const [replyTargetId, setReplyTargetId] = React.useState(null); + const [isFocusHighlightVisible, setIsFocusHighlightVisible] = + React.useState(true); const selectedItemId = item?.id ?? null; const focusComposer = React.useCallback(() => { @@ -117,6 +114,18 @@ export function InboxDetailPane({ setReplyTargetId(null); }, [selectedItemId]); + React.useEffect(() => { + void selectedItemId; + setIsFocusHighlightVisible(true); + const timeoutId = window.setTimeout(() => { + setIsFocusHighlightVisible(false); + }, 1_200); + + return () => { + window.clearTimeout(timeoutId); + }; + }, [selectedItemId]); + if (!item) { return (
message.isSelected); const pendingReplyMessages: InboxDisplayMessage[] = replies.map((reply) => ({ ...reply, @@ -160,7 +168,6 @@ export function InboxDetailPane({ }, ...pendingReplyMessages, ]; - const hasConversationContext = displayMessages.length > 1; const replyTarget = displayMessages.find((message) => message.id === replyTargetId) ?? null; const composerParentEventId = replyTarget?.id ?? item.id; @@ -186,129 +193,98 @@ export function InboxDetailPane({ data-testid="home-inbox-detail" ref={detailPaneRef} > -
-
-
- -
-
-

- {item.senderLabel} -

- - {item.categoryLabel} - - {item.channelLabel ? ( - - #{item.channelLabel} + {!canOpenChannel ? ( +
+
+
+ +
+
+

+ {item.senderLabel} +

+ + {item.categoryLabel} - ) : null} -
+ {item.channelLabel ? ( + + #{item.channelLabel} + + ) : null} +
-
- {item.fullTimestampLabel} - {canOpenChannel ? : null} - {canOpenChannel ? ( - Linked to an active channel - ) : ( +
+ {item.fullTimestampLabel} Inbox only - )} +
-
-
- -
- {canReply ? ( +
+ +
{ - setReplyTargetId(null); - focusComposer(); - }} - icon={} + label={isDone ? "Mark unread" : "Mark done"} + onClick={onToggleDone} + icon={ + isDone ? ( + + ) : ( + + ) + } />
- ) : null} -
- {canOpenChannel && channelId ? ( - onOpenChannel(channelId)} - icon={} + {canDelete ? ( + ) : null} - - ) : ( - - ) - } - />
- {canDelete ? ( - - ) : null} -
-
+ +
-
+ ) : null}
-
- {hasConversationContext - ? "Conversation context" - : item.categoryLabel} - {isThreadContextLoading ? ( - - Loading context... - - ) : null} -
- {displayMessages.map((message) => ( -
-
- {message.depth > 0 ? ( -