diff --git a/desktop/src/app/routes/index.tsx b/desktop/src/app/routes/index.tsx index 21942ba15c..342fe4af4d 100644 --- a/desktop/src/app/routes/index.tsx +++ b/desktop/src/app/routes/index.tsx @@ -1,5 +1,6 @@ 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"; @@ -9,6 +10,7 @@ export const Route = createFileRoute("/")({ }); function HomeRouteComponent() { + const { goChannel } = useAppNavigation(); const channelsQuery = useChannelsQuery(); const identityQuery = useIdentityQuery(); const channels = channelsQuery.data ?? []; @@ -18,6 +20,9 @@ function HomeRouteComponent() { { + void goChannel(channelId, { messageId }); + }} /> ); } diff --git a/desktop/src/features/home/ui/HomeScreen.tsx b/desktop/src/features/home/ui/HomeScreen.tsx index b9d5f22cff..5534271cc6 100644 --- a/desktop/src/features/home/ui/HomeScreen.tsx +++ b/desktop/src/features/home/ui/HomeScreen.tsx @@ -5,11 +5,13 @@ import { HomeView } from "@/features/home/ui/HomeView"; type HomeScreenProps = { availableChannelIds: ReadonlySet; currentPubkey?: string; + onOpenContext: (channelId: string, messageId: string) => void; }; export function HomeScreen({ availableChannelIds, currentPubkey, + onOpenContext, }: HomeScreenProps) { const homeFeedQuery = useHomeFeedQuery(); @@ -33,6 +35,7 @@ export function HomeScreen({ } feed={homeFeedQuery.data} isLoading={homeFeedQuery.isLoading} + onOpenContext={onOpenContext} onRefresh={() => { void homeFeedQuery.refetch(); }} diff --git a/desktop/src/features/home/ui/HomeView.tsx b/desktop/src/features/home/ui/HomeView.tsx index cadb6f2bfb..67141da1e3 100644 --- a/desktop/src/features/home/ui/HomeView.tsx +++ b/desktop/src/features/home/ui/HomeView.tsx @@ -104,6 +104,7 @@ type HomeViewProps = { errorMessage?: string; currentPubkey?: string; availableChannelIds: ReadonlySet; + onOpenContext: (channelId: string, messageId: string) => void; onRefresh: () => void; }; @@ -113,6 +114,7 @@ export function HomeView({ errorMessage, currentPubkey, availableChannelIds, + onOpenContext, onRefresh, }: HomeViewProps) { const [filter, setFilter] = React.useState("all"); @@ -355,6 +357,7 @@ export function HomeView({ item={selectedItem} messages={contextMessages} replies={selectedItemReplies} + contextChannelName={selectedChannel?.name ?? null} onDelete={() => { if (!selectedItem || !canDelete) { return; @@ -369,6 +372,7 @@ export function HomeView({ setIsDeletingMessage(false); }); }} + onOpenContext={onOpenContext} onSendReply={async ({ content, mediaTags, diff --git a/desktop/src/features/home/ui/InboxDetailPane.tsx b/desktop/src/features/home/ui/InboxDetailPane.tsx index ca76f71165..f6b399e6cd 100644 --- a/desktop/src/features/home/ui/InboxDetailPane.tsx +++ b/desktop/src/features/home/ui/InboxDetailPane.tsx @@ -44,7 +44,9 @@ type InboxDetailPaneProps = { item: InboxItem | null; messages?: InboxContextMessage[]; replies?: InboxReply[]; + contextChannelName?: string | null; onDelete: () => void; + onOpenContext?: (channelId: string, messageId: string) => void; onSendReply: (input: { content: string; mediaTags?: string[][]; @@ -88,7 +90,9 @@ export function InboxDetailPane({ item, messages = [], replies = [], + contextChannelName = null, onDelete, + onOpenContext, onSendReply, onToggleDone, onToggleReaction, @@ -179,6 +183,11 @@ export function InboxDetailPane({ id: replyTarget.id, } : null; + const channelContextName = contextChannelName ?? item.channelLabel; + const contextLabel = channelContextName + ? `#${channelContextName}` + : item.categoryLabel; + const contextChannelId = item.item.channelId; const handleSelectReplyTarget = (message: InboxDisplayMessage) => { setReplyTargetId((currentReplyTargetId) => @@ -193,76 +202,60 @@ export function InboxDetailPane({ data-testid="home-inbox-detail" ref={detailPaneRef} > - {!canOpenChannel ? ( -
-
-
- -
-
-

- {item.senderLabel} -

- - {item.categoryLabel} - - {item.channelLabel ? ( - - #{item.channelLabel} - - ) : null} -
- -
- {item.fullTimestampLabel} - Inbox only -
-
+
+
+
+
+ {canOpenChannel && contextChannelId && onOpenContext ? ( + + ) : ( +

+ {contextLabel} +

+ )}
-
- -
-
- - ) : ( - - ) - } - /> -
- {canDelete ? ( - - ) : null} -
-
+
+ {item.fullTimestampLabel}
+ +
+ +
+
+ + ) : ( + + ) + } + /> +
+ {canDelete ? ( + + ) : null} +
+
+
- ) : null} +
-
+
{isThreadContextLoading ? (
diff --git a/desktop/src/features/home/ui/InboxListPane.tsx b/desktop/src/features/home/ui/InboxListPane.tsx index 7ffac03957..8347ca5bb7 100644 --- a/desktop/src/features/home/ui/InboxListPane.tsx +++ b/desktop/src/features/home/ui/InboxListPane.tsx @@ -29,8 +29,8 @@ export function InboxListPane({ selectedId, }: InboxListPaneProps) { return ( -
-
+
+
{FILTER_OPTIONS.map((option) => (