Skip to content

Commit b3be9ec

Browse files
fix(desktop): keep message actions hover-only (#844)
Co-authored-by: Cursor <[email protected]>
1 parent db46c42 commit b3be9ec

9 files changed

Lines changed: 4 additions & 33 deletions

File tree

‎desktop/src/features/channels/ui/ChannelPane.tsx‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ type ChannelPaneProps = {
9191
threadMessages: MainTimelineEntry[];
9292
threadPanelWidthPx: number;
9393
threadTypingPubkeys: string[];
94-
threadReplyTargetId: string | null;
9594
threadReplyTargetMessage: TimelineMessage | null;
9695
threadScrollTargetId: string | null;
9796
targetMessageId: string | null;
@@ -160,7 +159,6 @@ export const ChannelPane = React.memo(function ChannelPane({
160159
threadPanelWidthPx,
161160
threadScrollTargetId,
162161
threadTypingPubkeys,
163-
threadReplyTargetId,
164162
threadReplyTargetMessage,
165163
typingPubkeys,
166164
}: ChannelPaneProps) {
@@ -307,7 +305,6 @@ export const ChannelPane = React.memo(function ChannelPane({
307305
) : null}
308306
<MessageTimeline
309307
channelId={activeChannel?.id}
310-
activeReplyTargetId={openThreadHeadId}
311308
scrollContainerRef={timelineScrollRef}
312309
currentPubkey={currentPubkey}
313310
fetchOlder={fetchOlder}
@@ -456,7 +453,6 @@ export const ChannelPane = React.memo(function ChannelPane({
456453
onToggleReaction={onToggleReaction}
457454
onUnfollowThread={onUnfollowThread}
458455
profiles={profiles}
459-
replyTargetId={threadReplyTargetId}
460456
replyTargetMessage={threadReplyTargetMessage}
461457
scrollTargetId={threadScrollTargetId}
462458
canResetWidth={canResetThreadPanelWidth}

‎desktop/src/features/channels/ui/ChannelScreen.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,6 @@ export function ChannelScreen({
551551
threadMessages={threadMessages}
552552
threadPanelWidthPx={threadPanelWidthPx}
553553
threadTypingPubkeys={threadTypingPubkeys}
554-
threadReplyTargetId={threadReplyTargetId}
555554
threadReplyTargetMessage={threadReplyTargetMessage}
556555
threadScrollTargetId={threadScrollTargetId}
557556
isJoining={joinChannelMutation.isPending}

‎desktop/src/features/home/ui/InboxDetailPane.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ export function InboxDetailPane({
324324
<div className="mx-6 my-3 border-t border-border/60" />
325325
) : null}
326326
<InboxMessageRow
327-
activeReplyTargetId={replyTargetId}
328327
canReply={canReply}
329328
channelId={item.item.channelId}
330329
isFocusHighlightVisible={isFocusHighlightVisible}

‎desktop/src/features/home/ui/InboxMessageRow.tsx‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ function toTimelineMessage(message: InboxDisplayMessage): TimelineMessage {
2727
}
2828

2929
type InboxMessageRowProps = {
30-
activeReplyTargetId: string | null;
3130
canReply: boolean;
3231
/** Channel UUID for "Copy link" — passed straight through to MessageActionBar. */
3332
channelId?: string | null;
@@ -42,7 +41,6 @@ type InboxMessageRowProps = {
4241
};
4342

4443
export function InboxMessageRow({
45-
activeReplyTargetId,
4644
canReply,
4745
channelId = null,
4846
isFocusHighlightVisible,
@@ -89,7 +87,6 @@ export function InboxMessageRow({
8987
{canReply || canToggleReactions ? (
9088
<div className="absolute right-2 top-1 z-10">
9189
<MessageActionBar
92-
activeReplyTargetId={activeReplyTargetId}
9390
channelId={channelId}
9491
message={timelineMessage}
9592
onReactionSelect={

‎desktop/src/features/messages/ui/MessageActionBar.tsx‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ function MoreActionsMenu({
257257
// ---------------------------------------------------------------------------
258258

259259
export function MessageActionBar({
260-
activeReplyTargetId = null,
261260
channelId,
262261
message,
263262
onDelete,
@@ -272,7 +271,6 @@ export function MessageActionBar({
272271
reactionPending = false,
273272
isFollowingThread,
274273
}: {
275-
activeReplyTargetId?: string | null;
276274
/** Channel UUID — required for the "Copy link" action; when omitted the
277275
* action is hidden (callers like the home inbox that lack the context). */
278276
channelId?: string | null;
@@ -306,7 +304,6 @@ export function MessageActionBar({
306304
return null;
307305
}
308306

309-
const isReplyingToMessage = activeReplyTargetId === message.id;
310307
const selectedReactionCount = reactions.filter(
311308
(reaction) => reaction.reactedByCurrentUser,
312309
).length;
@@ -318,7 +315,7 @@ export function MessageActionBar({
318315
"opacity-100 sm:pointer-events-none sm:opacity-0",
319316
"sm:group-hover/message:pointer-events-auto sm:group-hover/message:opacity-100",
320317
"sm:group-focus-within/message:pointer-events-auto sm:group-focus-within/message:opacity-100",
321-
isReplyingToMessage || isReactionPickerOpen || isDropdownOpen
318+
isReactionPickerOpen || isDropdownOpen
322319
? "sm:pointer-events-auto sm:opacity-100"
323320
: "",
324321
)}
@@ -390,22 +387,20 @@ export function MessageActionBar({
390387
<Tooltip>
391388
<TooltipTrigger asChild>
392389
<Button
393-
aria-label={isReplyingToMessage ? "Cancel reply" : "Reply"}
390+
aria-label="Reply"
394391
className="h-6 w-6 rounded-full p-0"
395392
data-testid={`reply-message-${message.id}`}
396393
onClick={() => {
397394
onReply?.(message);
398395
}}
399396
size="sm"
400397
type="button"
401-
variant={isReplyingToMessage ? "secondary" : "ghost"}
398+
variant="ghost"
402399
>
403400
<CornerUpLeft className="h-3 w-3" />
404401
</Button>
405402
</TooltipTrigger>
406-
<TooltipContent>
407-
{isReplyingToMessage ? "Cancel reply" : "Reply"}
408-
</TooltipContent>
403+
<TooltipContent>Reply</TooltipContent>
409404
</Tooltip>
410405
) : null}
411406

‎desktop/src/features/messages/ui/MessageRow.tsx‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const NESTED_REPLY_OFFSET_PX = 28;
2828

2929
export const MessageRow = React.memo(
3030
function MessageRow({
31-
activeReplyTargetId = null,
3231
channelId = null,
3332
highlighted = false,
3433
isFollowingThread,
@@ -44,7 +43,6 @@ export const MessageRow = React.memo(
4443
profiles,
4544
searchQuery,
4645
}: {
47-
activeReplyTargetId?: string | null;
4846
channelId?: string | null;
4947
highlighted?: boolean;
5048
isFollowingThread?: boolean;
@@ -212,7 +210,6 @@ export const MessageRow = React.memo(
212210
const actionBarNode = (
213211
<div className="absolute right-2 top-1 z-10">
214212
<MessageActionBar
215-
activeReplyTargetId={activeReplyTargetId}
216213
channelId={channelId}
217214
isFollowingThread={isFollowingThread}
218215
message={message}
@@ -451,7 +448,6 @@ export const MessageRow = React.memo(
451448
prev.message.role === next.message.role &&
452449
prev.message.personaDisplayName === next.message.personaDisplayName &&
453450
prev.highlighted === next.highlighted &&
454-
prev.activeReplyTargetId === next.activeReplyTargetId &&
455451
prev.isFollowingThread === next.isFollowingThread &&
456452
prev.layoutVariant === next.layoutVariant &&
457453
prev.profiles === next.profiles &&

‎desktop/src/features/messages/ui/MessageThreadPanel.tsx‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ type MessageThreadPanelProps = {
6363
remove: boolean,
6464
) => Promise<void>;
6565
profiles?: UserProfileLookup;
66-
replyTargetId: string | null;
6766
replyTargetMessage: TimelineMessage | null;
6867
scrollTargetId: string | null;
6968
threadHead: TimelineMessage | null;
@@ -116,7 +115,6 @@ export function MessageThreadPanel({
116115
onToggleReaction,
117116
onUnfollowThread,
118117
profiles,
119-
replyTargetId,
120118
replyTargetMessage,
121119
scrollTargetId,
122120
threadHead,
@@ -275,7 +273,6 @@ export function MessageThreadPanel({
275273
<div className="px-3 pb-1 pt-0" data-testid="message-thread-head">
276274
<div className="rounded-2xl">
277275
<MessageRow
278-
activeReplyTargetId={replyTargetId}
279276
channelId={channelId}
280277
isFollowingThread={isFollowingThread}
281278
layoutVariant="thread-reply"
@@ -316,7 +313,6 @@ export function MessageThreadPanel({
316313
key={entry.message.id}
317314
>
318315
<MessageRow
319-
activeReplyTargetId={replyTargetId}
320316
channelId={channelId}
321317
layoutVariant="thread-reply"
322318
message={entry.message}

‎desktop/src/features/messages/ui/MessageTimeline.tsx‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ type MessageTimelineProps = {
1818
isLoading?: boolean;
1919
emptyTitle?: string;
2020
emptyDescription?: string;
21-
activeReplyTargetId?: string | null;
2221
currentPubkey?: string;
2322
fetchOlder?: () => Promise<void>;
2423
hasOlderMessages?: boolean;
@@ -58,7 +57,6 @@ export const MessageTimeline = React.memo(function MessageTimeline({
5857
isLoading = false,
5958
emptyTitle = "No messages yet",
6059
emptyDescription = "Send the first message to start the thread.",
61-
activeReplyTargetId = null,
6260
currentPubkey,
6361
fetchOlder,
6462
hasOlderMessages = true,
@@ -192,7 +190,6 @@ export const MessageTimeline = React.memo(function MessageTimeline({
192190

193191
{!isLoading && messages.length > 0 ? (
194192
<TimelineMessageList
195-
activeReplyTargetId={activeReplyTargetId}
196193
channelId={channelId}
197194
currentPubkey={currentPubkey}
198195
followThreadById={followThreadById}

‎desktop/src/features/messages/ui/TimelineMessageList.tsx‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { MessageThreadSummaryRow } from "./MessageThreadSummaryRow";
1515
import { SystemMessageRow } from "./SystemMessageRow";
1616

1717
type TimelineMessageListProps = {
18-
activeReplyTargetId?: string | null;
1918
channelId?: string | null;
2019
currentPubkey?: string;
2120
followThreadById?: (rootId: string) => void;
@@ -45,7 +44,6 @@ type TimelineMessageListProps = {
4544
};
4645

4746
export const TimelineMessageList = React.memo(function TimelineMessageList({
48-
activeReplyTargetId = null,
4947
channelId,
5048
currentPubkey,
5149
followThreadById,
@@ -116,7 +114,6 @@ export const TimelineMessageList = React.memo(function TimelineMessageList({
116114
)}
117115
>
118116
<MessageRow
119-
activeReplyTargetId={activeReplyTargetId}
120117
channelId={channelId}
121118
highlighted={false}
122119
isFollowingThread={
@@ -165,7 +162,6 @@ export const TimelineMessageList = React.memo(function TimelineMessageList({
165162
currentDayGroup?.elements.push(
166163
<div key={message.id} className="flex flex-col gap-1">
167164
<MessageRow
168-
activeReplyTargetId={activeReplyTargetId}
169165
channelId={channelId}
170166
highlighted={message.id === highlightedMessageId || isSearchActive}
171167
message={message}

0 commit comments

Comments
 (0)