Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

style(channels): channel threading redesign (#5952)

Seamus485282bf8322
diff --git a/apps/web/src/components/ui/index.ts b/apps/web/src/components/ui/index.ts
index 7583602375..6354d89aef 100644
--- a/apps/web/src/components/ui/index.ts
+++ b/apps/web/src/components/ui/index.ts
@@ -1,6 +1,3 @@
-/* components */
-
-/* types */
export type {
AvatarGroupProps,
AvatarGroupSize,
@@ -104,7 +101,6 @@ export type { ToggleSwitchProps } from './components/ToggleSwitch';
export { ToggleSwitch } from './components/ToggleSwitch';
export { Tooltip } from './components/Tooltip';
-/* utils */
export { cn } from './utils/classname';
export type { CtrlJKMenuNavigationOptions } from './utils/menuKeyboardNavigation';
export {
diff --git a/apps/web/src/features/block-pr/component/GithubMessageView.tsx b/apps/web/src/features/block-pr/component/GithubMessageView.tsx
index 92592ea725..1171ae44a4 100644
--- a/apps/web/src/features/block-pr/component/GithubMessageView.tsx
+++ b/apps/web/src/features/block-pr/component/GithubMessageView.tsx
@@ -1,7 +1,7 @@
import { Message } from '@channel/Message/Message';
import type { MessageData } from '@channel/Message/types';
import { Thread } from '@channel/Thread/Thread';
-import { ThreadRail } from '@channel/Thread/ThreadRail';
+import { ThreadReplyRail } from '@channel/Thread/ThreadReplyRail';
import MacroLogo from '@icon/macro-logo.svg';
import type { GithubPullRequestComment } from '@service-storage/generated/schemas';
import type { ApiChannelMessage } from '@service-storage/generated/schemas/apiChannelMessage';
@@ -237,7 +237,7 @@ export function GithubMessageView(props: {
<Key each={replies()} by="id">
{(reply) => (
<div class="relative">
- <ThreadRail />
+ <ThreadReplyRail />
<GithubCommentMessage comment={reply()} isReply />
</div>
)}
diff --git a/apps/web/src/features/channel/Channel/Channel.tsx b/apps/web/src/features/channel/Channel/Channel.tsx
index d1d63f4c47..5612e8ca7b 100644
--- a/apps/web/src/features/channel/Channel/Channel.tsx
+++ b/apps/web/src/features/channel/Channel/Channel.tsx
@@ -350,7 +350,12 @@ export function Channel(props: ChannelProps) {
activityTracker.isNewMessage,
// Once there are no older pages left to fetch, the oldest loaded message
// (index 0) is the true first message in the channel.
- !messagesQuery.hasNextPage
+ !messagesQuery.hasNextPage,
+ // A reply being composed opens the thread before any reply exists; the
+ // rail must already reach it. Signal reads keep this memo live.
+ (message) =>
+ threadManager.getOrCreateThreadState(message.id).isReplying() ||
+ unifiedInput.replyTarget()?.threadId === message.id
)
);
diff --git a/apps/web/src/features/channel/Channel/ChannelDropZone.tsx b/apps/web/src/features/channel/Channel/ChannelDropZone.tsx
index 526a515979..2e0edd5112 100644
--- a/apps/web/src/features/channel/Channel/ChannelDropZone.tsx
+++ b/apps/web/src/features/channel/Channel/ChannelDropZone.tsx
@@ -15,7 +15,7 @@ export function ChannelDropZone(props: ChannelDropZoneProps) {
return (
<div
- class="relative h-full flex flex-col"
+ class="relative h-full flex flex-col mobile:px-0 mobile:pb-0"
use:fileFolderDrop={{
onDrop: (files, folders) => {
handleFileFolderDrop(files, folders, (entries) => {
diff --git a/apps/web/src/features/channel/Channel/ThreadList.tsx b/apps/web/src/features/channel/Channel/ThreadList.tsx
index e922d75102..e7fd18cee2 100644
--- a/apps/web/src/features/channel/Channel/ThreadList.tsx
+++ b/apps/web/src/features/channel/Channel/ThreadList.tsx
@@ -692,7 +692,7 @@ export function ThreadList(props: ThreadListProps) {
data-channel-id={props.channelId}
data-channel-scroll-inset-start={insets().start}
data-channel-scroll-inset-end={insets().end}
- class="scrollbar-hidden"
+ class="scrollbar-hidden px-2"
{...scrollIntent.handlers}
style={{
width: '100%',
diff --git a/apps/web/src/features/channel/Channel/message-list-meta.ts b/apps/web/src/features/channel/Channel/message-list-meta.ts
index d15a1e6785..92775bbee0 100644
--- a/apps/web/src/features/channel/Channel/message-list-meta.ts
+++ b/apps/web/src/features/channel/Channel/message-list-meta.ts
@@ -5,7 +5,12 @@ import { shouldGroupWithPreviousMessage } from './message-grouping-meta';
export function buildChannelMessageListMeta(
messages: ApiChannelMessage[],
isNewMessageFn: (message: ApiChannelMessage) => boolean,
- reachedStart: boolean
+ reachedStart: boolean,
+ /**
+ * A thread is visually open for this message even without replies (e.g. a
+ * reply is being composed), so the rail must reach it.
+ */
+ isThreadOpen?: (message: ApiChannelMessage) => boolean
): Record<string, ChannelMessageListMeta> {
const metaByMessageId: Record<string, ChannelMessageListMeta> = {};
let previousTopLevelCreatedAt: string | undefined;
@@ -36,5 +41,18 @@ export function buildChannelMessageListMeta(
previousMessage = message;
}
+ // Backward pass: a row carries the rail through it when a later member of
+ // its sender run owns a thread (the rail runs from the run's header avatar
+ // down to that fork point).
+ for (let i = messages.length - 2; i >= 0; i--) {
+ const next = messages[i + 1]!;
+ const nextMeta = metaByMessageId[next.id]!;
+ if (!nextMeta.isGroupedWithPrevious) continue;
+ metaByMessageId[messages[i]!.id]!.threadRailBelow =
+ (next.thread?.reply_count ?? 0) > 0 ||
+ isThreadOpen?.(next) === true ||
+ nextMeta.threadRailBelow === true;
+ }
+
return metaByMessageId;
}
diff --git a/apps/web/src/features/channel/Channel/tests/message-list-meta.test.ts b/apps/web/src/features/channel/Channel/tests/message-list-meta.test.ts
index e1de9f7758..dca0c8dc00 100644
--- a/apps/web/src/features/channel/Channel/tests/message-list-meta.test.ts
+++ b/apps/web/src/features/channel/Channel/tests/message-list-meta.test.ts
@@ -84,6 +84,32 @@ describe('buildChannelMessageListMeta', () => {
expect(meta.m3.isGroupedWithPrevious).toBe(true);
});
+ it('marks rows above a grouped thread fork with threadRailBelow', () => {
+ const messages = [
+ createMessage('m1', '2026-02-20T09:00:00.000Z'),
+ createMessage('m2', '2026-02-20T09:01:00.000Z'),
+ {
+ ...createMessage('m3', '2026-02-20T09:02:00.000Z'),
+ thread: {
+ preview: [],
+ reply_count: 2,
+ latest_reply_at: '2026-02-20T09:03:00.000Z',
+ },
+ },
+ createMessage('m4', '2026-02-20T10:30:00.000Z'),
+ ];
+
+ const meta = buildChannelMessageListMeta(messages, () => false, true);
+
+ // m3 is grouped into the run but owns a thread: the rail passes down
+ // through m1 (run header) and m2 to reach it.
+ expect(meta.m3.isGroupedWithPrevious).toBe(true);
+ expect(meta.m1.threadRailBelow).toBe(true);
+ expect(meta.m2.threadRailBelow).toBe(true);
+ expect(meta.m3.threadRailBelow).toBeFalsy();
+ expect(meta.m4.threadRailBelow).toBeFalsy();
+ });
+
it('does not group agent messages triggered by different users, despite a shared bot sender_id', () => {
const botId = 'bot|00000000-0000-0000-0000-000000000000';
const agentSender = (triggeredBy: string): ApiMessageSender => ({
diff --git a/apps/web/src/features/channel/Input/Footer.tsx b/apps/web/src/features/channel/Input/Footer.tsx
index 1c2cd38d9d..caf5a57cf6 100644
--- a/apps/web/src/features/channel/Input/Footer.tsx
+++ b/apps/web/src/features/channel/Input/Footer.tsx
@@ -7,7 +7,7 @@ export function Footer(props: JSX.HTMLAttributes<HTMLDivElement>) {
return (
<div
class={cn(
- 'flex flex-row w-full h-8 justify-between items-center p-2 mb-2 space-x-2',
+ 'flex flex-row w-full h-8 justify-between items-center gap-2 p-2 mb-2',
local.class
)}
data-input-footer
diff --git a/apps/web/src/features/channel/Message/ActionMenu.tsx b/apps/web/src/features/channel/Message/ActionMenu.tsx
index fc8dde35b2..c02692b970 100644
--- a/apps/web/src/features/channel/Message/ActionMenu.tsx
+++ b/apps/web/src/features/channel/Message/ActionMenu.tsx
@@ -25,6 +25,7 @@ import {
import { EmojiReactionPopover } from './EmojiReactionPopover';
import { HoverActions } from './HoverActions';
import { renderIcon } from './render-icon';
+import { Timestamp } from './Timestamp';
import type { MessageActionEvent, MessageActionHandler } from './types';
const QUICK_REACTION_EMOJIS = ['❤️', '👍', '😂'] as const;
@@ -50,6 +51,11 @@ type ActionItem = {
type ActionMenuProps = {
class?: string;
+ /**
+ * Lead the toolbar with the message's timestamp. Used by grouped rows,
+ * which have no header timestamp of their own.
+ */
+ showTimestamp?: boolean;
};
function ActionButton(props: {
@@ -117,28 +123,28 @@ function ActionMenuContent(props: ActionMenuProps) {
label: 'Reply',
icon: ReplyIcon,
onClick: actions?.onReply,
- iconClass: 'size-3.5',
+ iconClass: 'size-4',
},
{
id: 'copy-link',
label: 'Copy Link',
icon: LinkIcon,
onClick: actions?.onCopyLink,
- iconClass: 'size-3.5',
+ iconClass: 'size-4',
},
{
id: 'copy-message-text',
label: 'Copy Text',
icon: CopyIcon,
onClick: actions?.onCopyMessageText,
- iconClass: 'size-3.5',
+ iconClass: 'size-4',
},
{
id: 'edit',
label: 'Edit',
icon: EditIcon,
onClick: actions?.onEdit,
- iconClass: 'size-3.5',
+ iconClass: 'size-4',
},
{
id: 'delete',
@@ -147,7 +153,7 @@ function ActionMenuContent(props: ActionMenuProps) {
onClick: actions?.onDelete,
destructive: true,
class: 'text-failure-ink',
- iconClass: 'size-3.5',
+ iconClass: 'size-4',
},
];
@@ -157,12 +163,22 @@ function ActionMenuContent(props: ActionMenuProps) {
return (
<Show when={hasReactAction() || visibleActions.length > 0}>
- <HoverActions class={props.class} persistentVisible={emojiMenuOpen()}>
+ <HoverActions
+ class={props.class}
+ persistentVisible={emojiMenuOpen()}
+ // Grouped rows (the ones carrying the toolbar timestamp) have text at
+ // the very top; float the toolbar fully above so it never covers it.
+ position={props.showTimestamp ? 'above' : 'straddle'}
+ >
<Layer depth={2}>
<div
- class="flex flex-row bg-surface border border-edge p-1 shadow items-center rounded-md"
+ class="flex flex-row bg-surface ring-1 ring-ink/10 p-1 shadow-md items-center rounded-lg"
onClick={(e) => e.stopPropagation()}
>
+ <Show when={props.showTimestamp}>
+ <Timestamp format="time" class="px-1.5 whitespace-nowrap" />
+ <div class="w-px self-stretch bg-ink/10 mx-1" />
+ </Show>
<Show when={hasReactAction()}>
<For each={QUICK_REACTION_EMOJIS}>
{(emoji) => (
@@ -190,7 +206,7 @@ function ActionMenuContent(props: ActionMenuProps) {
onEmojiSelect={(emoji) => {
handleReaction(emoji);
}}
- trigger={renderIcon(AddEmojiIcon, 'size-3.5')}
+ trigger={renderIcon(AddEmojiIcon, 'size-4')}
triggerProps={{
title: 'More reactions',
'aria-label': 'More reactions',
@@ -200,7 +216,7 @@ function ActionMenuContent(props: ActionMenuProps) {
}}
/>
<Show when={visibleActions.length > 0}>
- <div class="w-px self-stretch bg-edge-muted mx-1" />
+ <div class="w-px self-stretch bg-ink/10 mx-1" />
</Show>
</Show>
@@ -215,7 +231,7 @@ function ActionMenuContent(props: ActionMenuProps) {
)}
</For>
<Show when={visibleCompose.length > 0 && visibleOther.length > 0}>
- <div class="w-px self-stretch bg-edge-muted mx-1" />
+ <div class="w-px self-stretch bg-ink/10 mx-1" />
</Show>
<For each={visibleOther}>
{(action) => (
diff --git a/apps/web/src/features/channel/Message/AgentBadge.tsx b/apps/web/src/features/channel/Message/AgentBadge.tsx
index 04e6e329de..0d6baf32ee 100644
--- a/apps/web/src/features/channel/Message/AgentBadge.tsx
+++ b/apps/web/src/features/channel/Message/AgentBadge.tsx
@@ -19,7 +19,7 @@ export function AgentBadge(props: AgentBadgeProps) {
<Show when={isAgent()}>
<span
class={cn(
- 'inline-flex shrink-0 items-center rounded-sm bg-hover px-2 py-0.5',
+ 'inline-flex shrink-0 items-center rounded-full bg-hover px-1.5 py-0.5',
'text-xs font-medium leading-none text-ink-muted',
props.class
)}
diff --git a/apps/web/src/features/channel/Message/ChannelCreatedIndicator.tsx b/apps/web/src/features/channel/Message/ChannelCreatedIndicator.tsx
index 3ad2f705d3..2ea7740f19 100644
--- a/apps/web/src/features/channel/Message/ChannelCreatedIndicator.tsx
+++ b/apps/web/src/features/channel/Message/ChannelCreatedIndicator.tsx
@@ -27,16 +27,6 @@ export function ChannelCreatedIndicator(props: ChannelCreatedIndicatorProps) {
<Show when={shouldRender() && channel()}>
{(c) => (
<div class="relative w-full pr-2 pl-(--message-padding-x) pt-4 pb-2">
- {/* Rail connector: runs from the circle's center down to the bottom
- edge so it meets the thread rail on the message below. Sits behind
- the avatar (which has a solid bg), so it only shows below it. */}
- <div
- class="pointer-events-none absolute bottom-0 -z-1 border-l-1 border-rail"
- style={{
- left: 'var(--left-of-connector)',
- top: 'calc(1rem + var(--user-icon-width) / 2)',
- }}
- />
<div
class="grid min-w-0 items-center gap-x-2"
style={{
@@ -52,7 +42,7 @@ export function ChannelCreatedIndicator(props: ChannelCreatedIndicatorProps) {
<span class="text-sm text-ink">
Channel <span class="font-semibold">{c().name}</span> created
</span>
- <span class="text-xs text-ink-placeholder">
+ <span class="text-xs text-ink-extra-muted">
{formatDate(c().created_at, { showTime: true })}
</span>
</div>
diff --git a/apps/web/src/features/channel/Message/ChannelMessage.tsx b/apps/web/src/features/channel/Message/ChannelMessage.tsx
index ed9ccd47c0..3c6f1c2f85 100644
--- a/apps/web/src/features/channel/Message/ChannelMessage.tsx
+++ b/apps/web/src/features/channel/Message/ChannelMessage.tsx
@@ -1,9 +1,7 @@
import { useMessageActionDrawer } from '@channel/Mobile/message-action-drawer-context';
import { touchHandler } from '@core/directive/touchHandler';
-import { isTouchDevice } from '@core/mobile/isTouchDevice';
import type { IUser } from '@core/user/types';
import TrashIcon from '@icon/square-trash.svg';
-import { cn } from '@ui';
import { type Accessor, type JSX, Match, Show, Switch } from 'solid-js';
import type { MessageEditor } from '../Channel/create-message-editor';
import { MessageEditorContent } from '../Channel/InlineMessageEditor';
@@ -59,7 +57,7 @@ function MessageContentSlot(props: {
/>
)}
</Match>
- <Match when={true}>
+ <Match when={message().content.trim() !== ''}>
<Message.Content class={props.class} />
</Match>
</Switch>
@@ -77,32 +75,15 @@ function MessageFooter(props: { messageEditor?: MessageEditor }) {
);
}
-function MessageActionsSlot(props: { messageEditor?: MessageEditor }) {
- const message = useMessage();
-
- return (
- <Show when={!isEditingMessage(props.messageEditor, message().id)}>
- <Message.ActionMenu />
- </Show>
- );
-}
-
-function _GroupedMeta(props: { messageEditor?: MessageEditor }) {
+function MessageActionsSlot(props: {
+ messageEditor?: MessageEditor;
+ showTimestamp?: boolean;
+}) {
const message = useMessage();
return (
<Show when={!isEditingMessage(props.messageEditor, message().id)}>
- <div
- class={cn(
- 'absolute right-4 -top-9 z-10',
- 'items-center gap-2 shrink-0 bg-surface p-1',
- 'hidden group-hover/message:flex',
- isTouchDevice() && 'hidden'
- )}
- >
- <Message.EditedIndicator />
- <Message.Timestamp compact format="time" />
- </div>
+ <Message.ActionMenu showTimestamp={props.showTimestamp} />
</Show>
);
}
@@ -115,7 +96,10 @@ function DeletedMessageLayout() {
<TrashIcon class="size-5" aria-hidden="true" />
</div>
</Message.Slot>
- <Message.Slot placement="content" class="ph-no-capture">
+ <Message.Slot
+ placement="content"
+ class="ph-no-capture flex min-h-(--user-icon-width) items-center"
+ >
<p class="text-sm text-ink-muted italic">This message was deleted.</p>
</Message.Slot>
</Message.Layout>
@@ -133,14 +117,11 @@ function RegularMessageLayout(props: {
<Message.SenderIcon />
</Message.Slot>
<Message.Slot placement="header" class="flex flex-col gap-0.5 min-w-0">
- <div class="flex items-center gap-1 min-w-0">
+ <div class="flex items-baseline gap-1 min-w-0">
<Message.SenderName />
<Message.AgentBadge />
- <Message.EditedIndicator />
- {/* On message hover, timestamp floats above actions. */}
- <div class="grow shrink-0 min-w-0 flex justify-end group-hover/message:absolute group-hover/message:right-1 group-hover/message:-top-9 group-hover/message:p-1 group-hover/message:bg-surface group-hover/message:rounded-md">
- <Message.Timestamp class="ml-auto shrink-0" format="dateAndTime" />
- </div>
+ <Message.Timestamp class="shrink-0" format="time" />
+ <Message.EditedIndicator class="shrink-0" />
</div>
<Message.FromPill />
</Message.Slot>
@@ -169,19 +150,17 @@ function GroupedMessageLayout(props: {
}) {
return (
<Message.Layout>
- <Message.Slot placement="icon">
- <Message.SenderIcon hidden />
- </Message.Slot>
+ {/* No icon placeholder: the grid template already reserves the gutter
+ column, and an invisible 36px icon would stretch the row, leaving
+ more space below the text than above it. */}
<Message.Slot placement="content">
- <div class={cn('ph-no-capture flex gap-3 min-w-0 items-start')}>
+ <div class="ph-no-capture flex gap-3 min-w-0 items-start">
<MessageContentSlot
channelId={props.channelId}
messageEditor={props.messageEditor}
participants={props.participants}
class="min-w-0 flex-1"
/>
- {/* TODO (seamus): hiding the grouped meta for now */}
- {/*<GroupedMeta messageEditor={props.messageEditor} />*/}
</div>
</Message.Slot>
<Message.Slot
@@ -190,7 +169,8 @@ function GroupedMessageLayout(props: {
>
<MessageFooter messageEditor={props.messageEditor} />
</Message.Slot>
- <MessageActionsSlot messageEditor={props.messageEditor} />
+ {/* Grouped rows have no header timestamp; the hover toolbar carries it. */}
+ <MessageActionsSlot messageEditor={props.messageEditor} showTimestamp />
</Message.Layout>
);
}
diff --git a/apps/web/src/features/channel/Message/DateDivider.tsx b/apps/web/src/features/channel/Message/DateDivider.tsx
index 738c1e16db..5e37b9d1b8 100644
--- a/apps/web/src/features/channel/Message/DateDivider.tsx
+++ b/apps/web/src/features/channel/Message/DateDivider.tsx
@@ -24,11 +24,7 @@ export function DateDivider(props: DateDividerProps) {
return (
<Show when={shouldRender()}>
- <MessageFlag
- text={formatRelativeDate(props.createdAt)}
- highlightAbove={props.listMeta?.isNewMessage}
- highlightBelow={props.listMeta?.isNewMessage}
- />
+ <MessageFlag text={formatRelativeDate(props.createdAt)} />
</Show>
);
}
diff --git a/apps/web/src/features/channel/Message/EditedIndicator.tsx b/apps/web/src/features/channel/Message/EditedIndicator.tsx
index 3e5ed0dd5d..693006d892 100644
--- a/apps/web/src/features/channel/Message/EditedIndicator.tsx
+++ b/apps/web/src/features/channel/Message/EditedIndicator.tsx
@@ -16,7 +16,7 @@ export function EditedIndicator(props: EditedIndicatorProps) {
<Show
when={message().edited_at != null && !isBotSenderId(message().sender_id)}
>
- <span class={cn('text-xs text-ink-placeholder', props.class)}>
+ <span class={cn('text-xs text-ink-extra-muted', props.class)}>
(edited)
</span>
</Show>
diff --git a/apps/web/src/features/channel/Message/HoverActions.tsx b/apps/web/src/features/channel/Message/HoverActions.tsx
index e13b979624..3da00b4aee 100644
--- a/apps/web/src/features/channel/Message/HoverActions.tsx
+++ b/apps/web/src/features/channel/Message/HoverActions.tsx
@@ -6,13 +6,21 @@ type HoverActionsProps = {
class?: string;
children: JSX.Element;
persistentVisible?: boolean;
+ /**
+ * 'straddle' (default) centers the toolbar on the row's top edge — fine
+ * for header rows, whose right side is empty. 'above' places it fully
+ * above the row so it never covers the row's own content — needed for
+ * grouped rows, where text starts at the very top.
+ */
+ position?: 'straddle' | 'above';
};
export function HoverActions(props: HoverActionsProps) {
return (
<div
class={cn(
- 'absolute right-4 top-0 -translate-y-1/2 z-10',
+ 'absolute right-4 z-10',
+ props.position === 'above' ? 'bottom-full' : 'top-0 -translate-y-1/2',
props.persistentVisible
? ''
: 'hidden group-hover/message:block group-focus-within/message:block',
diff --git a/apps/web/src/features/channel/Message/Layout.tsx b/apps/web/src/features/channel/Message/Layout.tsx
index fffbf4b18c..143d73e131 100644
--- a/apps/web/src/features/channel/Message/Layout.tsx
+++ b/apps/web/src/features/channel/Message/Layout.tsx
@@ -11,7 +11,7 @@ export function Layout(props: JSX.HTMLAttributes<HTMLDivElement>) {
{...rest}
>
<div
- class="grid min-w-0 items-start gap-x-2"
+ class="grid gap-y-1 min-w-0 items-start gap-x-2"
style={{
'grid-template-columns': 'var(--user-icon-width) minmax(0, 1fr)',
'grid-template-areas': '"icon header" "icon content" "icon footer"',
diff --git a/apps/web/src/features/channel/Message/MessageFlag.tsx b/apps/web/src/features/channel/Message/MessageFlag.tsx
index c74834fe94..dcb270bca1 100644
--- a/apps/web/src/features/channel/Message/MessageFlag.tsx
+++ b/apps/web/src/features/channel/Message/MessageFlag.tsx
@@ -2,51 +2,43 @@ import { cn } from '@ui';
type MessageFlagProps = {
text: string;
- highlightAbove?: boolean;
- highlightBelow?: boolean;
+ /** Accent treatment for the unread ("New") marker. */
+ highlight?: boolean;
class?: string;
};
+/**
+ * Horizontal list divider with a centered label pill — used for day
+ * boundaries and the unread marker. The hairline's left end lines up with
+ * the thread rail column.
+ */
export function MessageFlag(props: MessageFlagProps) {
return (
<div
class={cn(
- 'flex flex-row items-stretch h-20 justify-start ml-(--left-of-connector)',
+ 'relative flex h-14 mobile:h-16 items-center justify-center px-2',
props.class
)}
>
- <div class="flex flex-col items-center justify-center">
- <div
- class={cn(
- 'border-l-1 border-rail min-h-1/2',
- props.highlightAbove && 'border-accent'
- )}
- />
- <div
- class={cn(
- 'border-l-1 border-rail min-h-1/2',
- props.highlightBelow && 'border-accent'
- )}
- />
- </div>
- <div class="flex items-center flex-1 py-2">
- <div
- class={cn(
- 'border-b-1 border-rail w-5',
- props.highlightBelow && 'border-accent'
- )}
- />
- <span
- class={cn(
- 'text-xs px-3 ring-1 py-1 rounded-sm',
- props.highlightBelow
- ? 'text-accent ring-accent'
- : 'text-ink-extra-muted ring-rail'
- )}
- >
- {props.text}
- </span>
- </div>
+ {/* One hairline at an integer y-offset (flex-centering a 1px line in a
+ 56px row lands on a half pixel and renders soft/fat). Border-drawn
+ like the rail so both strokes share one paint path. The label's
+ background masks its middle. */}
+ <div
+ class={cn(
+ 'absolute top-7 mobile:top-8 h-0 border-t inset-x-0',
+ props.highlight ? 'border-accent/40' : 'border-rail'
+ )}
+ />
+ {/* Plain label; its surface background carves the gap in the line. */}
+ <span
+ class={cn(
+ 'relative text-xs font-medium px-2.5 bg-surface',
+ props.highlight ? 'text-accent' : 'text-ink-muted'
+ )}
+ >
+ {props.text}
+ </span>
</div>
);
}
diff --git a/apps/web/src/features/channel/Message/NewDivider.tsx b/apps/web/src/features/channel/Message/NewDivider.tsx
index 2f7570d746..bf409a98d6 100644
--- a/apps/web/src/features/channel/Message/NewDivider.tsx
+++ b/apps/web/src/features/channel/Message/NewDivider.tsx
@@ -14,8 +14,13 @@ export function NewDivider(props: NewDividerProps) {
return (
<Show when={isVisible()}>
- <button type="button" class="w-full text-left" onClick={props.onDismiss}>
- <MessageFlag text="New" highlightBelow />
+ <button
+ type="button"
+ class="w-full text-left"
+ title="Mark as read"
+ onClick={props.onDismiss}
+ >
+ <MessageFlag text="New" highlight />
</button>
</Show>
);
diff --git a/apps/web/src/features/channel/Message/ReactionChip.tsx b/apps/web/src/features/channel/Message/ReactionChip.tsx
index 7c2fb98dba..fbbbf4b215 100644
--- a/apps/web/src/features/channel/Message/ReactionChip.tsx
+++ b/apps/web/src/features/channel/Message/ReactionChip.tsx
@@ -90,12 +90,11 @@ export function ReactionChip(props: ReactionChipProps) {
size="sm"
variant="base"
class={cn(
- 'flex flex-row items-center h-7 min-w-7 gap-2 rounded-sm',
+ 'flex flex-row items-center h-7 min-w-7 gap-1 rounded-full',
{
- 'border-edge-muted hover:bg-hover hover:scale-105':
- props.interactive,
- 'border-edge-muted': !props.selected && !props.interactive,
- 'text-accent border-accent hover:bg-accent-hover':
+ 'border-rail hover:bg-hover': props.interactive,
+ 'border-rail': !props.selected && !props.interactive,
+ 'text-accent border-accent bg-accent-bg hover:bg-accent-hover':
props.selected,
'pointer-events-auto': !props.interactive,
}
@@ -108,7 +107,7 @@ export function ReactionChip(props: ReactionChipProps) {
>
<span class="text-lg leading-0">{props.emoji}</span>
<Show when={props.count > 1}>
- <span class="text-xs">{props.count}</span>
+ <span class="text-xs tabular-nums">{props.count}</span>
</Show>
</Button>
</HoverCard>
diff --git a/apps/web/src/features/channel/Message/Reactions.tsx b/apps/web/src/features/channel/Message/Reactions.tsx
index 198e39541a..5369c19085 100644
--- a/apps/web/src/features/channel/Message/Reactions.tsx
+++ b/apps/web/src/features/channel/Message/Reactions.tsx
@@ -70,6 +70,7 @@ export function Reactions(props: ReactionsProps) {
size: 'icon-sm',
tooltip: 'Add reaction',
variant: 'base',
+ class: 'rounded-full h-7 min-w-7 border-rail',
'aria-label': 'Add reaction',
onClick: (e: MouseEvent) => e.stopPropagation(),
}}
diff --git a/apps/web/src/features/channel/Message/Root.tsx b/apps/web/src/features/channel/Message/Root.tsx
index f690f9fcf8..5edbd83c39 100644
--- a/apps/web/src/features/channel/Message/Root.tsx
+++ b/apps/web/src/features/channel/Message/Root.tsx
@@ -112,7 +112,6 @@ export function Root(props: RootProps) {
}}
{...rest}
>
- <div class="absolute h-full w-1 left-0 top-0 bg-accent opacity-0 message-accent-bar" />
<MessageProvider value={() => local.message}>
<MessageActionsProvider value={local.actions}>
<MessageActionMenuVisibilityProvider value={actionMenuVisibility}>
diff --git a/apps/web/src/features/channel/Message/Timestamp.tsx b/apps/web/src/features/channel/Message/Timestamp.tsx
index 0bc5c5304c..e9c425dfdd 100644
--- a/apps/web/src/features/channel/Message/Timestamp.tsx
+++ b/apps/web/src/features/channel/Message/Timestamp.tsx
@@ -16,10 +16,16 @@ export function Timestamp(props: TimestampProps) {
return (
<span
class={cn(
- 'text-xs text-ink-placeholder',
+ 'text-xs text-ink-extra-muted tabular-nums',
props.compact && 'leading-none',
props.class
)}
+ // The time-only format reveals the full date on hover.
+ title={
+ props.format === 'time'
+ ? formatDate(message().created_at, { showTime: true })
+ : undefined
+ }
>
<Switch>
<Match when={props.format === 'time'}>
diff --git a/apps/web/src/features/channel/Message/list-meta.ts b/apps/web/src/features/channel/Message/list-meta.ts
index 0e0629cb51..c77dccaf67 100644
--- a/apps/web/src/features/channel/Message/list-meta.ts
+++ b/apps/web/src/features/channel/Message/list-meta.ts
@@ -4,6 +4,11 @@ export type ChannelMessageListMeta = {
isFirstNewMessage: boolean;
previousTopLevelCreatedAt?: string;
isGroupedWithPrevious?: boolean;
+ /**
+ * A later message in this row's sender run owns a thread, so the thread
+ * rail passes down through this row to reach it.
+ */
+ threadRailBelow?: boolean;
/**
* True once the oldest page has loaded, so `index === 0` is the true first
* message in the channel rather than just the oldest currently-loaded one.
diff --git a/apps/web/src/features/channel/StandaloneThread/ParentMessage.tsx b/apps/web/src/features/channel/StandaloneThread/ParentMessage.tsx
index 7dad7e6ff4..0c33ad3591 100644
--- a/apps/web/src/features/channel/StandaloneThread/ParentMessage.tsx
+++ b/apps/web/src/features/channel/StandaloneThread/ParentMessage.tsx
@@ -32,14 +32,11 @@ export function ParentMessage(props: ParentMessageProps) {
placement="header"
class="flex flex-col gap-0.5 min-w-0"
>
- <div class="flex items-center gap-1 min-w-0">
+ <div class="flex items-baseline gap-1.5 min-w-0">
<Message.SenderName />
<Message.AgentBadge />
- <Message.EditedIndicator />
- <Message.Timestamp
- class="ml-auto shrink-0"
- format="dateAndTime"
- />
+ <Message.Timestamp class="shrink-0" format="dateAndTime" />
+ <Message.EditedIndicator class="shrink-0" />
</div>
<Message.FromPill />
</Message.Slot>
diff --git a/apps/web/src/features/channel/StandaloneThread/Replies.tsx b/apps/web/src/features/channel/StandaloneThread/Replies.tsx
index c5a34139aa..c95128e9d5 100644
--- a/apps/web/src/features/channel/StandaloneThread/Replies.tsx
+++ b/apps/web/src/features/channel/StandaloneThread/Replies.tsx
@@ -2,7 +2,7 @@ import { createMemo, For, Show } from 'solid-js';
import { Message, type MessageActions, type MessageData } from '../Message';
import { Thread } from '../Thread';
import { buildThreadReplyListMeta } from '../Thread/reply-list-meta';
-import { ThreadRail } from '../Thread/ThreadRail';
+import { ThreadReplyRail } from '../Thread/ThreadReplyRail';
import {
DEFAULT_VISIBLE_REPLY_COUNT,
getCollapsedRepliesCount,
@@ -70,7 +70,7 @@ export function Replies(props: RepliesProps) {
props.getMessageActions?.(replyMessage());
return (
<div class="relative">
- <ThreadRail />
+ <ThreadReplyRail grouped={meta()?.isGroupedWithPrevious} />
<Message.Root
message={replyMessage()}
actions={replyActions()}
@@ -98,14 +98,14 @@ export function Replies(props: RepliesProps) {
placement="header"
class="flex flex-col gap-0.5 min-w-0"
>
- <div class="flex items-center gap-1 min-w-0">
+ <div class="flex items-baseline gap-1.5 min-w-0">
<Message.SenderName />
<Message.AgentBadge />
- <Message.EditedIndicator />
<Message.Timestamp
- class="ml-auto shrink-0"
+ class="shrink-0"
format="dateAndTime"
/>
+ <Message.EditedIndicator class="shrink-0" />
</div>
<Message.FromPill />
</Message.Slot>
diff --git a/apps/web/src/features/channel/Thread/ChannelThread.tsx b/apps/web/src/features/channel/Thread/ChannelThread.tsx
index 1253209600..89b62ce96c 100644
--- a/apps/web/src/features/channel/Thread/ChannelThread.tsx
+++ b/apps/web/src/features/channel/Thread/ChannelThread.tsx
@@ -5,6 +5,7 @@ import { getDisplayName, tryMacroId } from '@core/user';
import { MarkMessageNotifications } from '@notifications/components/MarkMessageNotifications';
import { useThreadRepliesQuery } from '@queries/channel/thread-replies';
import type { ApiThreadReply } from '@service-storage/generated/schemas/apiThreadReply';
+import { cn } from '@ui';
import {
createEffect,
createSignal,
@@ -24,6 +25,7 @@ import { Thread } from './Thread';
import type { ThreadReplyListHandle } from './ThreadReplyList';
import { ThreadTypingIndicator } from './ThreadTypingIndicator';
import type { ThreadProps } from './types';
+import { channelReplyInputOffsetX } from './utils/thread-rail-geometry';
import {
DEFAULT_VISIBLE_REPLY_COUNT,
getCollapsedRepliesCount,
@@ -38,6 +40,9 @@ export function ChannelThread(props: ThreadProps) {
const displayName = () => getDisplayName(macroId());
const thread = () => props.data().thread;
const hasReplies = () => thread().reply_count > 0;
+ const threadHasNewMessages = () =>
+ props.listMeta?.isNewMessage === true ||
+ activeReplies().some((reply) => props.isNewMessage?.(reply) === true);
const fetchRepliesEnabled = createThreadRepliesFetchGate({
threadId: () => props.data().id,
replyCount: () => thread().reply_count,
@@ -176,16 +181,6 @@ export function ChannelThread(props: ThreadProps) {
setIsReplying: (v) => props.setIsReplying(v),
});
- // NOTE: Intentionally reads from `thread().preview` instead of `activeReplies()`.
- // `activeReplies()` can access `repliesQuery.data` which triggers Suspense.
- // Preview data is always available synchronously and is sufficient here
- // since this only controls the reply rail connector color.
- const firstReplyIsNewMessage = () => {
- const preview = thread().preview ?? [];
- const first = preview[0];
- return first ? props.isNewMessage?.(first) : false;
- };
-
const collapsedRepliesCount = () =>
getCollapsedRepliesCount(thread().reply_count, DEFAULT_VISIBLE_REPLY_COUNT);
const collapsedRepliesContainsNewMessages = () =>
@@ -299,38 +294,73 @@ export function ChannelThread(props: ThreadProps) {
onDismissNewMessages={props.threadActions?.onDismissNewMessages}
>
<div class="flex flex-col w-full">
- <MarkMessageNotifications
- messageId={props.data().id}
- channelId={props.channelId()}
- >
- <DebugSuspense name="ChannelThread.message">
- <ChannelMessage
- channelId={props.channelId()}
- message={props.data()}
- actions={props.getMessageActions?.(props.data())}
- listMeta={props.listMeta}
- messageEditor={props.messageEditor}
- participants={props.participants}
- onClick={selectThreadMessage}
- selected={isSelected() && !isThreadFocused()}
- targeted={
- // The unified input's reply is bound to this root, or
- // channel navigation landed on it.
- unifiedReplyBinding()?.boundToRoot || isRootNavTargeted()
- }
- />
- </DebugSuspense>
- </MarkMessageNotifications>
+ {/* Rail segment along the root message: from the avatar's center
+ (masked by the avatar's fill until its lower edge) to the
+ message's bottom, where the reply-branch elbow takes over. A
+ grouped root has no avatar — its segment enters from the row
+ top (fed by the run's pass-through rails) and a fork node on
+ the spine marks which message the thread replies to. Plain
+ messages carry no rail. */}
+ <div class="relative">
+ <Thread.RootRail
+ visible={hasReplies() || isReplyingToThread()}
+ grouped={props.listMeta?.isGroupedWithPrevious}
+ newMessage={threadHasNewMessages()}
+ />
+ <MarkMessageNotifications
+ messageId={props.data().id}
+ channelId={props.channelId()}
+ >
+ <DebugSuspense name="ChannelThread.message">
+ <ChannelMessage
+ channelId={props.channelId()}
+ message={props.data()}
+ actions={props.getMessageActions?.(props.data())}
+ listMeta={props.listMeta}
+ messageEditor={props.messageEditor}
+ participants={props.participants}
+ onClick={selectThreadMessage}
+ selected={isSelected() && !isThreadFocused()}
+ targeted={
+ // The unified input's reply is bound to this root, or
+ // channel navigation landed on it.
+ unifiedReplyBinding()?.boundToRoot || isRootNavTargeted()
+ }
+ />
+ </DebugSuspense>
+ </MarkMessageNotifications>
+ </div>
<Show
when={hasReplies() || (props.isReplying() && !isUnifiedInputMode())}
>
<div class="relative w-full">
- <DebugSuspense name="ChannelThread.reply-rail">
- <Thread.ReplyRailDecorations
- isReplying={isReplyingToThread}
- firstThreadReplyNewMessage={firstReplyIsNewMessage()}
+ {/* Spine bridge: spans the replies container's top padding,
+ connecting the root segment to the reply rows' own spine
+ segments below. */}
+ <div
+ class={cn(
+ 'pointer-events-none absolute top-0 -z-1 channel-rail-left border-rail left-(--left-of-channel-rail) h-(--thread-padding-y)',
+ threadHasNewMessages() && 'border-accent'
+ )}
+ />
+ {/* Terminal branch: the spine's final curve into the footer
+ button's left edge. Its vertical part starts exactly at the
+ last reply row's bottom (button h-8 + mb-2 + container pb). */}
+ <Show
+ when={shouldShowCollapsedIndicator() || shouldShowReplyButton()}
+ >
+ <div
+ class={cn(
+ 'pointer-events-none absolute -z-1 channel-rail-left channel-rail-bottom border-rail rounded-bl-[14px] left-(--left-of-channel-rail) h-8',
+ threadHasNewMessages() && 'border-accent'
+ )}
+ style={{
+ bottom: 'calc(var(--thread-padding-y) + 1.5rem)',
+ width:
+ 'calc(var(--thread-shift) - var(--user-icon-width) / 2 - var(--channel-rail-clearance))',
+ }}
/>
- </DebugSuspense>
+ </Show>
<DebugSuspense name="ChannelThread.replies">
<Thread.RepliesContainer>
<DebugSuspense name="ChannelThread.ReplyList">
@@ -342,6 +372,7 @@ export function ChannelThread(props: ThreadProps) {
messageEditor={props.messageEditor}
participants={props.participants}
isNewMessage={props.isNewMessage}
+ hasNewMessages={threadHasNewMessages()}
onReady={setReplyListHandle}
positionTarget={props.targetNavigation?.positionTarget}
selectedReplyId={replySelection.selectedId}
@@ -360,8 +391,29 @@ export function ChannelThread(props: ThreadProps) {
attachReplyInputRef(el);
replyInputContainerRef = el;
}}
- class="ph-no-capture"
+ class="ph-no-capture relative"
>
+ {/* The first reply has an author avatar before its
+ composer, so this branch turns at the avatar's
+ center. Once replies exist, it instead joins the
+ composer at its vertical center. */}
+ <div
+ class={cn(
+ 'pointer-events-none absolute top-0 -z-1 channel-rail-left channel-rail-bottom border-rail rounded-bl-[14px]',
+ threadHasNewMessages() && 'border-accent'
+ )}
+ style={{
+ left: 'calc(var(--user-icon-width) / 2 + var(--message-padding-x) - var(--thread-shift) - var(--channel-rail-width) / 2)',
+ width:
+ 'calc(var(--thread-shift) - var(--user-icon-width) / 2 - var(--channel-rail-clearance))',
+ ...(hasReplies()
+ ? { bottom: '50%' }
+ : {
+ height:
+ 'calc(var(--message-padding-x) + var(--user-icon-width) / 2)',
+ }),
+ }}
+ />
<Show when={!hasReplies()}>
<Thread.ReplyAuthor
userId={replyUserId()}
@@ -369,6 +421,8 @@ export function ChannelThread(props: ThreadProps) {
/>
</Show>
<Thread.ReplyInput
+ connector={false}
+ offsetX={channelReplyInputOffsetX}
channelId={props.channelId()}
messageId={props.data().id}
replyInputState={props.replyInputState}
diff --git a/apps/web/src/features/channel/Thread/Thread.ts b/apps/web/src/features/channel/Thread/Thread.ts
index 79dafab7fc..61ef153741 100644
--- a/apps/web/src/features/channel/Thread/Thread.ts
+++ b/apps/web/src/features/channel/Thread/Thread.ts
@@ -6,8 +6,11 @@ import { ThreadReplyButton } from './ThreadReplyButton';
import { ThreadReplyInput } from './ThreadReplyInput';
import { ThreadReplyInputConnector } from './ThreadReplyInputConnector';
import { ThreadReplyList } from './ThreadReplyList';
+import { ThreadReplyRail } from './ThreadReplyRail';
import { ThreadReplyRailDecorations } from './ThreadReplyRailDecorations';
+import { ThreadRootRail } from './ThreadRootRail';
import { ThreadRow } from './ThreadRow';
+import { ThreadTerminalRail } from './ThreadTerminalRail';
export const Thread = {
Row: ThreadRow,
@@ -15,6 +18,9 @@ export const Thread = {
RepliesContainer: ThreadRepliesContainer,
ReplyButton: ThreadReplyButton,
ReplyList: ThreadReplyList,
+ ReplyRail: ThreadReplyRail,
+ RootRail: ThreadRootRail,
+ TerminalRail: ThreadTerminalRail,
CollapsedIndicator: ThreadCollapsedIndicator,
ReplyInputConnector: ThreadReplyInputConnector,
ReplyAuthor: ThreadReplyAuthor,
diff --git a/apps/web/src/features/channel/Thread/ThreadActionsFooter.tsx b/apps/web/src/features/channel/Thread/ThreadActionsFooter.tsx
index f9bb470710..e433bfc564 100644
--- a/apps/web/src/features/channel/Thread/ThreadActionsFooter.tsx
+++ b/apps/web/src/features/channel/Thread/ThreadActionsFooter.tsx
@@ -6,7 +6,7 @@ type ThreadActionsFooterProps = {
export function ThreadActionsFooter(props: ThreadActionsFooterProps) {
return (
- <div class="relative z-10 w-fit ml-(--message-padding-x)">
+ <div class="relative z-10 w-fit mt-2 ml-(--message-padding-x)">
{props.children}
</div>
);
diff --git a/apps/web/src/features/channel/Thread/ThreadCollapsedIndicator.tsx b/apps/web/src/features/channel/Thread/ThreadCollapsedIndicator.tsx
index 4bd3c1c134..c736cc6369 100644
--- a/apps/web/src/features/channel/Thread/ThreadCollapsedIndicator.tsx
+++ b/apps/web/src/features/channel/Thread/ThreadCollapsedIndicator.tsx
@@ -2,15 +2,7 @@ import { UserIcon } from '@core/component/UserIcon';
import { formatRelativeDate } from '@core/util/time';
import CaretRight from '@phosphor/caret-right.svg';
import { cn } from '@ui';
-import {
- createSignal,
- For,
- type JSX,
- Match,
- Show,
- Switch,
- splitProps,
-} from 'solid-js';
+import { For, type JSX, Show, splitProps } from 'solid-js';
import { getThreadReplyCountLabel } from './utils/thread-reply-indicator-helpers';
type ThreadCollapsedIndicatorProps =
@@ -31,7 +23,6 @@ export function ThreadCollapsedIndicator(props: ThreadCollapsedIndicatorProps) {
'latestReplyAt',
'hasNewMessages',
]);
- const [hover, setHover] = createSignal(false);
const visibleParticipants = () =>
local.participants.slice(0, MAX_VISIBLE_PARTICIPANTS);
const hiddenParticipants = () =>
@@ -40,63 +31,54 @@ export function ThreadCollapsedIndicator(props: ThreadCollapsedIndicatorProps) {
return (
<button
type="button"
+ title="Expand thread"
class={cn(
- 'flex flex-row gap-2 items-center text-xs w-fit h-(--user-icon-width) touch:min-h-(--user-icon-width) ring-1 bg-surface hover:bg-hover hover-transition-bg pr-2 pl-1 mb-2 select-none outline-none focus:bg-active rounded-sm',
- local.hasNewMessages ? 'ring-accent' : 'ring-rail',
+ 'flex items-center gap-2 text-xs w-fit h-8 touch:min-h-(--user-icon-width) border bg-surface hover:bg-hover py-1 pr-2 pl-1.5 mb-2 select-none outline-none focus-visible:bg-active rounded-full',
+ local.hasNewMessages ? 'border-accent/40' : 'border-rail',
local.class
)}
- onMouseEnter={() => {
- setHover(true);
- }}
- onMouseLeave={() => {
- setHover(false);
- }}
{...rest}
>
- <div class="flex flex-row items-center gap-2 px-1">
- <Show when={local.participants.length > 0}>
- <div class="flex flex-row items-center">
- <For each={visibleParticipants()}>
- {(userId, index) => (
- <div
- class={cn(
- 'size-4.5 *:size-full *:rounded-full',
- index() > 0 ? '-ml-1' : ''
- )}
- >
- <UserIcon
- id={userId}
- size="fill"
- suppressClick
- showTooltip={false}
- />
- </div>
- )}
- </For>
- <Show when={hiddenParticipants() > 0}>
- <p class="ml-1 text-xxs text-ink-muted">
- +{hiddenParticipants()}
- </p>
- </Show>
- </div>
- </Show>
- <p class="text-accent font-medium whitespace-nowrap">
- {getThreadReplyCountLabel(local.collapsedRepliesCount)}
- </p>
- <div class="hidden @min-[40rem]:block min-w-[15ch]">
- <Switch>
- <Match when={hover()}>
- <p class="text-ink-muted whitespace-nowrap">Expand thread</p>
- </Match>
- <Match when={!!local.latestReplyAt && !hover()}>
- <p class="text-ink-muted whitespace-nowrap">
- Last reply {formatRelativeDate(local.latestReplyAt!)}
- </p>
- </Match>
- </Switch>
+ <Show when={local.participants.length > 0}>
+ <div class="flex items-center">
+ <For each={visibleParticipants()}>
+ {(userId, index) => (
+ <div
+ class={cn(
+ 'size-4.5 rounded-full ring-2 ring-surface *:size-full *:rounded-full',
+ index() > 0 && '-ml-1'
+ )}
+ >
+ <UserIcon
+ id={userId}
+ size="fill"
+ suppressClick
+ showTooltip={false}
+ />
+ </div>
+ )}
+ </For>
+ <Show when={hiddenParticipants() > 0}>
+ <span class="ml-1 text-xxs text-ink-muted tabular-nums">
+ +{hiddenParticipants()}
+ </span>
+ </Show>
</div>
- </div>
- <CaretRight class={cn('size-4', hover() ? '' : 'invisible')} />
+ </Show>
+ <Show when={local.hasNewMessages}>
+ <span class="size-1.5 shrink-0 rounded-full bg-accent" />
+ </Show>
+ <span class="text-accent font-medium whitespace-nowrap">
+ {getThreadReplyCountLabel(local.collapsedRepliesCount)}
+ </span>
+ <Show when={local.latestReplyAt}>
+ {(latestReplyAt) => (
+ <span class="text-ink-muted whitespace-nowrap @max-[40rem]:hidden">
+ Last reply {formatRelativeDate(latestReplyAt())}
+ </span>
+ )}
+ </Show>
+ <CaretRight class="size-3.5 shrink-0 text-ink-muted" />
</button>
);
}
diff --git a/apps/web/src/features/channel/Thread/ThreadRail.tsx b/apps/web/src/features/channel/Thread/ThreadRail.tsx
index f31da4c652..3aed8d3656 100644
--- a/apps/web/src/features/channel/Thread/ThreadRail.tsx
+++ b/apps/web/src/features/channel/Thread/ThreadRail.tsx
@@ -8,11 +8,11 @@ export function ThreadRail(props: ThreadRailProps) {
return (
<div
class={cn(
- 'pointer-events-none absolute top-0 bottom-0 border-l-1 border-rail -z-1',
+ 'pointer-events-none absolute top-0 bottom-0 channel-rail-left border-rail -z-1',
props.newMessage && 'border-accent'
)}
style={{
- left: 'var(--left-of-connector)',
+ left: 'var(--left-of-channel-rail)',
}}
/>
);
diff --git a/apps/web/src/features/channel/Thread/ThreadReplyButton.tsx b/apps/web/src/features/channel/Thread/ThreadReplyButton.tsx
index 2c0e73933a..4c720bc77f 100644
--- a/apps/web/src/features/channel/Thread/ThreadReplyButton.tsx
+++ b/apps/web/src/features/channel/Thread/ThreadReplyButton.tsx
@@ -14,7 +14,7 @@ export function ThreadReplyButton(props: ThreadReplyButtonProps) {
<button
type="button"
class={cn(
- 'w-min rounded-sm icon-plus mb-2 ring-1 ring-rail bg-surface hover:bg-hover hover-transition-bg flex flex-row justify-center items-center size-(--user-icon-width) touch:min-h-(--user-icon-width) touch:min-w-(--user-icon-width) text-ink-muted',
+ 'w-min rounded-full icon-plus mb-2 border border-rail bg-surface hover:bg-hover flex flex-row justify-center items-center size-8 touch:min-h-(--user-icon-width) touch:min-w-(--user-icon-width) text-ink-muted hover:text-ink',
local.class
)}
ref={(el) => {
@@ -23,7 +23,7 @@ export function ThreadReplyButton(props: ThreadReplyButtonProps) {
}}
{...rest}
>
- <IconPlus class="size-1/2" />
+ <IconPlus class="size-4" />
</button>
);
}
diff --git a/apps/web/src/features/channel/Thread/ThreadReplyInput.tsx b/apps/web/src/features/channel/Thread/ThreadReplyInput.tsx
index 3a833bf7f3..a0f62d6446 100644
--- a/apps/web/src/features/channel/Thread/ThreadReplyInput.tsx
+++ b/apps/web/src/features/channel/Thread/ThreadReplyInput.tsx
@@ -1,4 +1,10 @@
-import { type Accessor, createSignal, onCleanup, type Setter } from 'solid-js';
+import {
+ type Accessor,
+ createSignal,
+ onCleanup,
+ type Setter,
+ Show,
+} from 'solid-js';
import { createEntityDropZone } from '../Channel/create-entity-drop-zone';
import type { InputHandle, InputSnapshot } from '../Input';
import type { FocusRequest } from './focus-request';
@@ -16,6 +22,13 @@ type ThreadReplyInputProps = {
setReplyInputEl?: Setter<HTMLElement | undefined>;
setReplyInputHandle?: Setter<InputHandle | undefined>;
focusRequest?: FocusRequest;
+ /**
+ * Render the rail connector chrome. On by default for inner-rail consumers
+ * (standalone threads, discussions); channels have no inner rail.
+ */
+ connector?: boolean;
+ /** Optional layout-specific horizontal anchor for the composer. */
+ offsetX?: string;
};
/**
@@ -43,11 +56,13 @@ export function ThreadReplyInput(props: ThreadReplyInputProps) {
return (
<div
class="relative pt-2"
- style={{ 'margin-left': replyInputOffsetX }}
+ style={{ 'margin-left': props.offsetX ?? replyInputOffsetX }}
ref={(el) => props.setReplyInputEl?.(el)}
data-reply-input
>
- <ThreadReplyInputConnector />
+ <Show when={props.connector !== false}>
+ <ThreadReplyInputConnector />
+ </Show>
{(() => {
const droppable = entityDropZone.droppable;
false && droppable;
diff --git a/apps/web/src/features/channel/Thread/ThreadReplyInputConnector.tsx b/apps/web/src/features/channel/Thread/ThreadReplyInputConnector.tsx
index 55ea5bdb73..04863462d0 100644
--- a/apps/web/src/features/channel/Thread/ThreadReplyInputConnector.tsx
+++ b/apps/web/src/features/channel/Thread/ThreadReplyInputConnector.tsx
@@ -1,45 +1,28 @@
/**
- * Connector from the inner vertical rail to the reply input area.
- * Renders a short vertical rail segment + a curved diagonal connector,
- * matching the block-channel Message component's thread-append connector.
+ * Connector from either the reply's inner rail or the parent thread spine to
+ * the reply input area. Border-drawn so it shares the straight rail segments'
+ * width.
*
- * Must be rendered inside a `position: relative` wrapper whose left edge
- * is at `icon-width/2` to the right of the inner rail.
+ * Render inside the composer wrapper; `rail` determines the source column.
*/
-export function ThreadReplyInputConnector() {
+export function ThreadReplyInputConnector(props: {
+ /** Channel-like threads keep the composer attached to the parent spine. */
+ rail?: 'inner' | 'thread';
+}) {
+ const isThreadRail = () => props.rail === 'thread';
+
return (
- <>
- {/* Short vertical rail segment from wrapper top to connector start */}
- <div
- class="absolute border-l-1 border-rail top-0"
- style={{
- left: 'calc((var(--user-icon-width) / 2) * -1)',
- height:
- 'calc(50% - (var(--user-icon-width) / 2 + 1px) / 24 * 18 + 1px)',
- }}
- />
- {/* Curved connector from rail to vertical center of the input area */}
- <div
- class="absolute text-rail -z-1"
- style={{
- left: 'calc((var(--user-icon-width) / 2) * -1)',
- bottom: '50%',
- width: 'calc(var(--user-icon-width) / 2 + 1px)',
- }}
- >
- <svg
- xmlns="http://www.w3.org/2000/svg"
- fill="none"
- viewBox="0 0 24 18"
- width="100%"
- >
- <path
- stroke="currentColor"
- vector-effect="non-scaling-stroke"
- d="M23 17 4 6.0303C2.5 5.1643.5 4 .5.5"
- />
- </svg>
- </div>
- </>
+ <div
+ class="pointer-events-none absolute top-0 -z-1 channel-rail-left channel-rail-bottom border-rail rounded-bl-[14px]"
+ style={{
+ left: isThreadRail()
+ ? 'calc(var(--user-icon-width) / 2 - var(--thread-shift) - var(--channel-rail-width) / 2)'
+ : 'calc((var(--user-icon-width) / 2) * -1)',
+ width: isThreadRail()
+ ? 'calc(var(--thread-shift) - var(--user-icon-width) / 2 - var(--channel-rail-clearance))'
+ : 'calc(var(--user-icon-width) / 2 + var(--channel-rail-width))',
+ bottom: '50%',
+ }}
+ />
);
}
diff --git a/apps/web/src/features/channel/Thread/ThreadReplyList.tsx b/apps/web/src/features/channel/Thread/ThreadReplyList.tsx
index dff7da3b72..b79fd6876b 100644
--- a/apps/web/src/features/channel/Thread/ThreadReplyList.tsx
+++ b/apps/web/src/features/channel/Thread/ThreadReplyList.tsx
@@ -11,7 +11,7 @@ import {
} from '../Message';
import { createTargetReplyScroller } from './create-target-reply-scroller';
import { buildThreadReplyListMeta } from './reply-list-meta';
-import { ThreadRail } from './ThreadRail';
+import { ThreadReplyRail } from './ThreadReplyRail';
export type ThreadReplyListHandle = {
scrollToIndex: (index: number, onSettled: () => void) => boolean;
@@ -26,6 +26,8 @@ export function ThreadReplyList(props: {
messageEditor?: MessageEditor;
participants?: Accessor<IUser[]>;
isNewMessage?: (message: NewMessageCheckable) => boolean;
+ /** The thread rail is one path, so all of its pieces share this state. */
+ hasNewMessages?: boolean;
onReady?: (handle: ThreadReplyListHandle) => void;
positionTarget?: (
threadRow: HTMLElement,
@@ -75,8 +77,9 @@ export function ThreadReplyList(props: {
}}
class="relative"
>
- <ThreadRail
- newMessage={listMetaByReplyId()[reply.id].isNewMessage}
+ <ThreadReplyRail
+ grouped={listMetaByReplyId()[reply.id].isGroupedWithPrevious}
+ newMessage={props.hasNewMessages}
/>
<MarkMessageNotifications
messageId={reply.id}
diff --git a/apps/web/src/features/channel/Thread/ThreadReplyRail.tsx b/apps/web/src/features/channel/Thread/ThreadReplyRail.tsx
new file mode 100644
index 0000000000..50b136caa1
--- /dev/null
+++ b/apps/web/src/features/channel/Thread/ThreadReplyRail.tsx
@@ -0,0 +1,42 @@
+import { cn } from '@ui';
+import { Show } from 'solid-js';
+
+type ThreadReplyRailProps = {
+ /** Grouped replies continue the spine without another avatar branch. */
+ grouped?: boolean;
+ /** An unread thread paints its complete rail path with the accent. */
+ newMessage?: boolean;
+};
+
+/**
+ * The rail geometry for one reply row. The spine remains on the parent
+ * message's avatar column; an ungrouped reply branches from it and stops
+ * short of the reply avatar.
+ */
+export function ThreadReplyRail(props: ThreadReplyRailProps) {
+ const railClass = () =>
+ cn(
+ 'pointer-events-none absolute -z-1 channel-rail-left border-rail',
+ props.newMessage && 'border-accent'
+ );
+ const railLeft =
+ 'calc(var(--user-icon-width) / 2 + var(--message-padding-x) - var(--thread-shift) - var(--channel-rail-width) / 2)';
+
+ return (
+ <>
+ <div class={cn(railClass(), 'inset-y-0')} style={{ left: railLeft }} />
+ <Show when={!props.grouped}>
+ <div
+ class={cn(railClass(), 'top-0 channel-rail-bottom rounded-bl-[14px]')}
+ style={{
+ left: railLeft,
+ width:
+ 'calc(var(--thread-shift) - var(--user-icon-width) / 2 - var(--channel-rail-clearance))',
+ height:
+ 'calc(var(--regular-message-padding-t) + var(--user-icon-width) / 2)',
+ }}
+ />
+ </Show>
+ </>
+ );
+}
diff --git a/apps/web/src/features/channel/Thread/ThreadReplyRailDecorations.tsx b/apps/web/src/features/channel/Thread/ThreadReplyRailDecorations.tsx
index 4a715a9895..c375a3282b 100644
--- a/apps/web/src/features/channel/Thread/ThreadReplyRailDecorations.tsx
+++ b/apps/web/src/features/channel/Thread/ThreadReplyRailDecorations.tsx
@@ -10,28 +10,22 @@ type ThreadReplyRailProps = {
export function ThreadReplyRailDecorations(props: ThreadReplyRailProps) {
return (
<>
- <div class="pointer-events-none absolute" style={threadConnectorStyle}>
- <div
- class={cn(
- 'absolute text-rail -z-1 w-full h-full',
- props.firstThreadReplyNewMessage && 'text-accent'
- )}
- >
- <svg
- xmlns="http://www.w3.org/2000/svg"
- fill="none"
- viewBox="0 0 24 18"
- width="100%"
- >
- <path
- stroke="currentColor"
- vector-effect="non-scaling-stroke"
- d="M23 17 4 6.0303C2.5 5.1643.5 4 .5.5"
- />
- </svg>
- </div>
- </div>
- {/* THIS IS A HACKY ELEMENT POSITIONED TO BLOCK THE STUB END OF THE RAIL THAT POKE UP ABOVE THE USER ICON */}
+ {/* Branch elbow: continues the root message's rail segment and stops
+ short of the first reply's avatar by the shared rail clearance. */}
+ <div
+ class={cn(
+ 'pointer-events-none absolute top-0 -z-1 channel-rail-left channel-rail-bottom border-rail rounded-bl-[14px]',
+ props.firstThreadReplyNewMessage && 'border-accent'
+ )}
+ style={{
+ left: threadConnectorStyle.left,
+ width: threadConnectorStyle.width,
+ height:
+ 'calc(var(--thread-padding-y) + var(--regular-message-padding-t) + var(--user-icon-width) / 2)',
+ }}
+ />
+ {/* Blocks the stub of the first reply's inner rail that pokes up above
+ its avatar. */}
<div class="pointer-events-none absolute bg-surface left-[calc(var(--left-of-connector)+var(--thread-shift))] top-(--regular-message-padding-t) min-h-(--message-padding-x) min-w-4 -translate-x-1/2 z-0" />
</>
);
diff --git a/apps/web/src/features/channel/Thread/ThreadRootRail.tsx b/apps/web/src/features/channel/Thread/ThreadRootRail.tsx
new file mode 100644
index 0000000000..5e83d028ce
--- /dev/null
+++ b/apps/web/src/features/channel/Thread/ThreadRootRail.tsx
@@ -0,0 +1,39 @@
+import { cn } from '@ui';
+import { Show } from 'solid-js';
+
+type ThreadRootRailProps = {
+ grouped?: boolean;
+ visible?: boolean;
+ newMessage?: boolean;
+};
+
+/**
+ * The parent-message segment of a channel-like thread, including the filled
+ * fork node used when a grouped message becomes a thread root.
+ */
+export function ThreadRootRail(props: ThreadRootRailProps) {
+ return (
+ <Show when={props.visible}>
+ <div
+ class={cn(
+ 'pointer-events-none absolute channel-rail-left border-rail -z-1 left-(--left-of-channel-rail) bottom-0',
+ props.newMessage && 'border-accent'
+ )}
+ style={{
+ top: props.grouped
+ ? '0'
+ : 'calc(var(--regular-message-padding-t) + var(--user-icon-width) + var(--channel-rail-clearance))',
+ }}
+ />
+ <Show when={props.grouped}>
+ <div
+ class={cn(
+ 'pointer-events-none absolute top-2 size-1.5 rounded-full ring-1 ring-surface left-(--channel-rail-center) -translate-x-1/2',
+ props.newMessage ? 'bg-accent' : 'bg-rail'
+ )}
+ data-thread-fork-node
+ />
+ </Show>
+ </Show>
+ );
+}
diff --git a/apps/web/src/features/channel/Thread/ThreadRow.tsx b/apps/web/src/features/channel/Thread/ThreadRow.tsx
index 1d3a344aa6..850e3205d7 100644
--- a/apps/web/src/features/channel/Thread/ThreadRow.tsx
+++ b/apps/web/src/features/channel/Thread/ThreadRow.tsx
@@ -6,7 +6,6 @@ import {
DateDivider,
NewDivider,
} from '../Message';
-import { ThreadRail } from './ThreadRail';
type ThreadRowProps = ParentProps & {
ref?: (element: HTMLDivElement) => void;
@@ -14,6 +13,8 @@ type ThreadRowProps = ParentProps & {
channelId?: string;
message: ApiChannelMessage;
listMeta?: ChannelMessageListMeta;
+ /** Discussions reuse the channel thread geometry without channel dividers. */
+ showDividers?: boolean;
onDismissNewMessages?: () => void;
};
@@ -29,20 +30,35 @@ export function ThreadRow(props: ThreadRowProps) {
data-channel-thread-row
class="w-full flex justify-center"
>
- <div class="macro-message-width w-full relative">
- <Show when={channelCreatedId()}>
- {(id) => <ChannelCreatedIndicator channelId={id()} />}
+ <div class="macro-message-width relative">
+ <Show when={props.showDividers !== false}>
+ <Show when={channelCreatedId()}>
+ {(id) => <ChannelCreatedIndicator channelId={id()} />}
+ </Show>
+ <NewDivider
+ listMeta={props.listMeta}
+ onDismiss={props.onDismissNewMessages}
+ />
+ <DateDivider
+ createdAt={props.message.created_at}
+ listMeta={props.listMeta}
+ />
</Show>
- <NewDivider
- listMeta={props.listMeta}
- onDismiss={props.onDismissNewMessages}
- />
- <DateDivider
- createdAt={props.message.created_at}
- listMeta={props.listMeta}
- />
<div class="relative isolate">
- <ThreadRail newMessage={props.listMeta?.isNewMessage} />
+ {/* Pass-through rail: a later message in this sender run owns a
+ thread; the spine runs through this row to reach it — from the
+ avatar's center on the run's header, edge-to-edge on grouped
+ rows. */}
+ <Show when={props.listMeta?.threadRailBelow}>
+ <div
+ class="pointer-events-none absolute -z-1 channel-rail-left border-rail left-(--left-of-channel-rail) bottom-0"
+ style={{
+ top: props.listMeta?.isGroupedWithPrevious
+ ? '0'
+ : 'calc(var(--regular-message-padding-t) + var(--user-icon-width) + var(--channel-rail-clearance))',
+ }}
+ />
+ </Show>
{props.children}
</div>
</div>
diff --git a/apps/web/src/features/channel/Thread/ThreadTerminalRail.tsx b/apps/web/src/features/channel/Thread/ThreadTerminalRail.tsx
new file mode 100644
index 0000000000..04ec4f40dd
--- /dev/null
+++ b/apps/web/src/features/channel/Thread/ThreadTerminalRail.tsx
@@ -0,0 +1,22 @@
+import { cn } from '@ui';
+
+type ThreadTerminalRailProps = {
+ newMessage?: boolean;
+};
+
+/** Curves the parent spine toward the reply action without touching it. */
+export function ThreadTerminalRail(props: ThreadTerminalRailProps) {
+ return (
+ <div
+ class={cn(
+ 'pointer-events-none absolute -z-1 channel-rail-left channel-rail-bottom border-rail rounded-bl-[14px] left-(--left-of-channel-rail) h-8',
+ props.newMessage && 'border-accent'
+ )}
+ style={{
+ bottom: 'calc(var(--thread-padding-y) + 1.5rem)',
+ width:
+ 'calc(var(--thread-shift) - var(--user-icon-width) / 2 - var(--channel-rail-clearance))',
+ }}
+ />
+ );
+}
diff --git a/apps/web/src/features/channel/Thread/ThreadTypingIndicator.tsx b/apps/web/src/features/channel/Thread/ThreadTypingIndicator.tsx
index eda17137d9..e3837cbcdd 100644
--- a/apps/web/src/features/channel/Thread/ThreadTypingIndicator.tsx
+++ b/apps/web/src/features/channel/Thread/ThreadTypingIndicator.tsx
@@ -21,7 +21,7 @@ export function ThreadTypingIndicator(props: ThreadTypingIndicatorProps) {
const isActive = () => typingUsers().length > 0;
return (
- <div class="flex flex-row items-stretch justify-start ml-(--left-of-connector) min-h-7">
+ <div class="flex flex-row items-stretch justify-start ml-[calc(var(--message-padding-x)+var(--user-icon-width)+--spacing(2))] min-h-7">
<Show when={isActive()}>
<ThreadTypingIndicatorContent text={typingText()} />
</Show>
@@ -38,18 +38,12 @@ function ThreadTypingIndicatorContent(
) {
return (
<div class="flex items-center text-ink-extra-muted">
- <ThreadTypingIndicatorConnector />
- <div class="size-0 bg-rail rounded-sm" />
- <span class="text-xs ml-2">{props.text}</span>
+ <span class="text-xs">{props.text}</span>
<ThreadTypingIndicatorDots />
</div>
);
}
-function ThreadTypingIndicatorConnector() {
- return <div class="w-7 border-b-1 border-rail" />;
-}
-
function ThreadTypingIndicatorDots() {
return (
<span class="flex">
diff --git a/apps/web/src/features/channel/Thread/utils/thread-rail-geometry.ts b/apps/web/src/features/channel/Thread/utils/thread-rail-geometry.ts
index d0a4d254e5..04f594b029 100644
--- a/apps/web/src/features/channel/Thread/utils/thread-rail-geometry.ts
+++ b/apps/web/src/features/channel/Thread/utils/thread-rail-geometry.ts
@@ -8,15 +8,19 @@ export const innerRailTop =
'calc(var(--regular-message-padding-t) + var(--thread-padding-y))';
export const threadConnectorStyle = {
- left: 'var(--left-of-connector)',
+ left: 'var(--left-of-channel-rail)',
top: 'calc(var(--regular-message-padding-t) + var(--thread-padding-y))',
- width: 'calc(var(--thread-shift) - var(--user-icon-width) / 2 + .5rem)',
+ width:
+ 'calc(var(--thread-shift) - var(--user-icon-width) / 2 - var(--channel-rail-clearance))',
} as const;
-/** Left offset for the reply-input wrapper, placing it icon-width/2 right of the inner rail. */
+/** Default composer alignment for standalone thread renderers. */
export const replyInputOffsetX =
'calc(var(--user-icon-width) + var(--message-padding-x))';
+/** Channel composers replace the reply action, so they share its anchor. */
+export const channelReplyInputOffsetX = 'var(--message-padding-x)';
+
export function getInnerRailBottom(isReplying: boolean): string {
if (!isReplying) return 'calc(var(--user-icon-width) / 2 + 0.5rem)';
// When replying, the rail stops above the reply-input connector
diff --git a/apps/web/src/index.css b/apps/web/src/index.css
index 51e2fe96b6..ee1837b5bc 100644
--- a/apps/web/src/index.css
+++ b/apps/web/src/index.css
@@ -89,11 +89,15 @@
/* chat vars */
--left-of-connector: calc(var(--message-padding-x) + var(--user-icon-width) * 0.5);
--left-of-user-icon: calc(var(--left-of-connector) - var(--user-icon-width) * 0.5);
- --regular-message-padding-t: .5rem;
+ --regular-message-padding-t: .625rem;
--message-padding-x: .5rem;
--thread-padding-y: .5rem;
- --user-icon-width: 36px;
+ --user-icon-width: 32px;
--thread-shift: 32px;
+ --channel-rail-width: 1px;
+ --channel-rail-clearance: .5rem;
+ --left-of-channel-rail: calc(var(--left-of-connector) - var(--channel-rail-width) / 2);
+ --channel-rail-center: calc(var(--left-of-channel-rail) + var(--channel-rail-width) / 2);
/* accent - active, hover states, high chroma */
--a0: oklch(var(--a0l) var(--a0c) var(--a0h));
@@ -897,18 +901,28 @@ a {
max-width: 100%;
width: 100%;
@media (min-width: 640px) {
- max-width: 800px;
+ max-width: 920px;
min-width: 250px;
}
}
+@utility channel-rail-left {
+ border-left-style: solid;
+ border-left-width: var(--channel-rail-width);
+}
+
+@utility channel-rail-bottom {
+ border-bottom-style: solid;
+ border-bottom-width: var(--channel-rail-width);
+}
+
@utility macro-message-padding {
- @container (width < 816px) { padding-inline: calc(var(--spacing) * 4); }
+ @container (width < 936px) { padding-inline: calc(var(--spacing) * 4); }
@container (width < 640px) { padding-inline: calc(var(--spacing) * 2); }
}
@utility macro-message-margin {
- @container (width < 816px) { margin-inline: calc(var(--spacing) * 4); }
+ @container (width < 936px) { margin-inline: calc(var(--spacing) * 4); }
@container (width < 640px) { margin-inline: calc(var(--spacing) * 2); }
}
@@ -960,20 +974,33 @@ a {
opacity: 0 !important;
}
+/* Tighter channel message rhythm: the base markdown theme's first/last
+ paragraph margins (6px) read airy in a chat list. 2px puts grouped lines
+ 4px apart while inter-paragraph spacing inside a message is unchanged. */
+.channel-markdown > .md-p:first-child { margin-top: --spacing(0.5); }
+.channel-markdown > .md-p:last-child { margin-bottom: --spacing(0.5); }
+
/* Channel message hover + selection-cursor highlight */
/* Suppressed on touch devices */
/* Background-only — borders/rings are reserved for structural UI edges. */
-[data-message][data-selected],
-html:not([data-touch-device="true"]) [data-message]:hover{
- @apply bg-ink/5 rounded-sm;
+/* Hover reads as the lighter neutral tint; the selection cursor reads as the
+ heavier neutral tint so the two states are visually distinct. Hover is
+ suppressed on the selected message so its selection tint always shows
+ through. */
+html:not([data-touch-device="true"]) [data-message]:not([data-selected]):hover {
+ @apply bg-hover rounded-md;
+}
+
+[data-message][data-selected] {
+ @apply bg-active rounded-md;
}
[data-message][data-targeted] {
- @apply bg-accent/30 rounded-sm;
+ @apply bg-accent/30 rounded-md;
}
[data-message][data-selected][data-targeted],
html:not([data-touch-device="true"]) [data-message][data-targeted]:hover{
- @apply bg-accent/40 rounded-sm;
+ @apply bg-accent/40 rounded-md;
}
/* A released target fades its accent out instead of cutting off. Duration
@@ -983,7 +1010,7 @@ html:not([data-touch-device="true"]) [data-message][data-targeted]:hover{
}
/* A selected message keeps its selection after release, so its fade starts
- from the selected accent and lands on the selection gray. */
+ from the targeted accent and lands on the selection tint. */
[data-message][data-selected][data-targeted-fading] {
animation-name: targeted-message-accent-fade-out-selected;
}
@@ -1005,7 +1032,7 @@ html:not([data-touch-device="true"]) [data-message][data-targeted]:hover{
border-radius: var(--radius-sm);
}
to {
- background-color: oklch(from var(--color-ink) l c h / 5%);
+ background-color: var(--color-active);
border-radius: var(--radius-sm);
}
}
diff --git a/apps/web/src/lib/core/comments/discussion/Discussion.tsx b/apps/web/src/lib/core/comments/discussion/Discussion.tsx
index e0cdadd3f6..73b8f4157e 100644
--- a/apps/web/src/lib/core/comments/discussion/Discussion.tsx
+++ b/apps/web/src/lib/core/comments/discussion/Discussion.tsx
@@ -1,17 +1,27 @@
+import { buildChannelMessageListMeta } from '@channel/Channel/message-list-meta';
import type { InputSnapshot } from '@channel/Input/types';
+import type { ChannelMessageListMeta } from '@channel/Message/list-meta';
import { Message } from '@channel/Message/Message';
import type { MessageActions } from '@channel/Message/types';
+import { buildThreadReplyListMeta } from '@channel/Thread/reply-list-meta';
import { Thread } from '@channel/Thread/Thread';
-import { ThreadRail } from '@channel/Thread/ThreadRail';
import { ThreadReplyInputConnector } from '@channel/Thread/ThreadReplyInputConnector';
-import { replyInputOffsetX } from '@channel/Thread/utils/thread-rail-geometry';
+import { ThreadReplyRail } from '@channel/Thread/ThreadReplyRail';
+import { channelReplyInputOffsetX } from '@channel/Thread/utils/thread-rail-geometry';
import { StaticMarkdownContext } from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';
import { toast } from '@core/component/Toast/Toast';
import { getDisplayName, tryMacroId } from '@core/user';
import CaretDown from '@phosphor/caret-down.svg';
import CaretRight from '@phosphor/caret-right.svg';
-import { Key } from '@solid-primitives/keyed';
-import { createEffect, createSignal, onCleanup, onMount, Show } from 'solid-js';
+import {
+ createEffect,
+ createMemo,
+ createSignal,
+ For,
+ onCleanup,
+ onMount,
+ Show,
+} from 'solid-js';
import { useDiscussion } from './context';
import { DiscussionInput } from './DiscussionInput';
import {
@@ -93,6 +103,19 @@ export function Discussion() {
let newThreadInputHandle: { clear: () => void } | undefined;
+ const rootMetaById = createMemo(() => {
+ const messages = source.threads().flatMap((thread) => {
+ const root = thread.comments[0];
+ if (!root) return [];
+ const message = discussionCommentToApiChannelMessage(root);
+ message.thread.reply_count = thread.comments.length - 1;
+ return [message];
+ });
+ const metaById = buildChannelMessageListMeta(messages, () => false, true);
+
+ return metaById;
+ });
+
const handleCreateThread = async (snapshot: InputSnapshot) => {
const text = snapshot.value.trim();
if (!text) return;
@@ -123,19 +146,25 @@ export function Discussion() {
<StaticMarkdownContext>
<div class="py-2 text-xs">
<div>
- <Key each={source.threads()} by="id">
- {(thread) => (
- <DiscussionThreadView
- thread={thread()}
- onCommentMount={registerMountedComment}
- onCommentCleanup={unregisterMountedComment}
- />
- )}
- </Key>
+ <For each={source.threads()}>
+ {(thread) => {
+ const root = () => thread.comments[0];
+ const listMeta = () =>
+ root() ? rootMetaById()[root()!.id] : undefined;
+ return (
+ <DiscussionThreadView
+ thread={thread}
+ listMeta={listMeta()}
+ onCommentMount={registerMountedComment}
+ onCommentCleanup={unregisterMountedComment}
+ />
+ );
+ }}
+ </For>
</div>
<Show when={source.canEdit()}>
- <div>
+ <div class="mt-4">
<DiscussionInput
input={{ mode: 'channel', placeholder: 'Leave a comment...' }}
onSend={handleCreateThread}
@@ -155,6 +184,7 @@ export function Discussion() {
export function DiscussionThreadView(props: {
thread: ViewThread;
+ listMeta?: ChannelMessageListMeta;
onCommentMount?: (commentId: string, element: HTMLElement) => void;
onCommentCleanup?: (commentId: string, element: HTMLElement) => void;
}) {
@@ -170,6 +200,11 @@ export function DiscussionThreadView(props: {
const root = () => comments()[0];
const replies = () => comments().slice(1);
const hasReplies = () => replies().length > 0;
+ const replyMetaById = createMemo(() =>
+ buildThreadReplyListMeta(
+ replies().map(discussionCommentToApiChannelMessage)
+ )
+ );
const threadId = () => props.thread.id;
const replyUserId = () => source.currentUserId() ?? root()?.authorId ?? '';
@@ -246,17 +281,28 @@ export function DiscussionThreadView(props: {
discussionCommentToApiChannelMessage(rootComment());
return (
<div class="flex flex-col w-full gap-0">
- <Thread.Row message={rootMessageData()}>
- <DiscussionMessageView
- comment={rootComment()}
- actions={makeActions(rootComment(), true)}
- editingId={editingId()}
- onEditSave={(snapshot) => handleEdit(rootComment(), snapshot)}
- onEditCancel={() => setEditingId(null)}
- isHighlighted={source.targetCommentId() === rootComment().id}
- onMount={props.onCommentMount}
- onCleanup={props.onCommentCleanup}
- />
+ <Thread.Row
+ message={rootMessageData()}
+ listMeta={props.listMeta}
+ showDividers={false}
+ >
+ <div class="relative">
+ <Thread.RootRail
+ visible={hasReplies() || isReplying()}
+ grouped={props.listMeta?.isGroupedWithPrevious}
+ />
+ <DiscussionMessageView
+ comment={rootComment()}
+ grouped={props.listMeta?.isGroupedWithPrevious}
+ actions={makeActions(rootComment(), true)}
+ editingId={editingId()}
+ onEditSave={(snapshot) => handleEdit(rootComment(), snapshot)}
+ onEditCancel={() => setEditingId(null)}
+ isHighlighted={source.targetCommentId() === rootComment().id}
+ onMount={props.onCommentMount}
+ onCleanup={props.onCommentCleanup}
+ />
+ </div>
<Show when={hasReplies() || isReplying()}>
<div class="relative w-full">
@@ -265,27 +311,33 @@ export function DiscussionThreadView(props: {
firstThreadReplyNewMessage={false}
/>
<Thread.RepliesContainer>
- <Key each={replies()} by="id">
- {(reply) => (
- <div class="relative">
- <ThreadRail />
- <DiscussionMessageView
- comment={reply()}
- actions={makeActions(reply(), false)}
- editingId={editingId()}
- onEditSave={(snapshot) =>
- handleEdit(reply(), snapshot)
- }
- onEditCancel={() => setEditingId(null)}
- isHighlighted={
- source.targetCommentId() === reply().id
- }
- onMount={props.onCommentMount}
- onCleanup={props.onCommentCleanup}
- />
- </div>
- )}
- </Key>
+ <For each={replies()}>
+ {(reply) => {
+ const meta = () => replyMetaById()[reply.id];
+ return (
+ <div class="relative">
+ <ThreadReplyRail
+ grouped={meta()?.isGroupedWithPrevious}
+ />
+ <DiscussionMessageView
+ comment={reply}
+ grouped={meta()?.isGroupedWithPrevious}
+ actions={makeActions(reply, false)}
+ editingId={editingId()}
+ onEditSave={(snapshot) =>
+ handleEdit(reply, snapshot)
+ }
+ onEditCancel={() => setEditingId(null)}
+ isHighlighted={
+ source.targetCommentId() === reply.id
+ }
+ onMount={props.onCommentMount}
+ onCleanup={props.onCommentCleanup}
+ />
+ </div>
+ );
+ }}
+ </For>
<Show when={isReplying() && canEdit()}>
<div class="ph-no-capture">
@@ -298,9 +350,11 @@ export function DiscussionThreadView(props: {
<div
ref={replyInputContainerRef}
class="relative pt-2"
- style={{ 'margin-left': replyInputOffsetX }}
+ style={{ 'margin-left': channelReplyInputOffsetX }}
>
- <ThreadReplyInputConnector />
+ <Show when={hasReplies()}>
+ <ThreadReplyInputConnector rail="thread" />
+ </Show>
<DiscussionInput
input={{ mode: 'reply', placeholder: 'Reply...' }}
onSend={handleReply}
@@ -329,6 +383,9 @@ export function DiscussionThreadView(props: {
</Thread.ActionsFooter>
</Show>
</Thread.RepliesContainer>
+ <Show when={!isReplying() && canEdit() && hasReplies()}>
+ <Thread.TerminalRail />
+ </Show>
</div>
</Show>
</Thread.Row>
@@ -346,6 +403,7 @@ function DiscussionMessageView(props: {
onEditSave: (snapshot: InputSnapshot) => void;
onEditCancel: () => void;
isHighlighted?: boolean;
+ grouped?: boolean;
onMount?: (commentId: string, element: HTMLElement) => void;
onCleanup?: (commentId: string, element: HTMLElement) => void;
}) {
@@ -365,51 +423,47 @@ function DiscussionMessageView(props: {
return (
<div ref={containerRef}>
- <Show
- when={!isEditing()}
- fallback={
- <DiscussionInput
- input={{
- mode: 'reply',
- placeholder: 'Edit comment...',
- value: props.comment.text,
- }}
- onSend={props.onEditSave}
- onClose={() => {
- props.onEditCancel();
- }}
- />
- }
+ <Message.Root
+ message={messageData()}
+ actions={props.actions}
+ selected={props.isHighlighted}
>
- <Message.Root
- message={messageData()}
- actions={props.actions}
- selected={props.isHighlighted}
+ <Message.Layout
+ class={props.grouped ? undefined : 'pt-(--regular-message-padding-t)'}
>
- <Message.Layout class="pt-(--regular-message-padding-t)">
- <Message.Slot placement="icon">
- <Message.SenderIcon />
- </Message.Slot>
+ <Message.Slot placement="icon">
+ <Message.SenderIcon hidden={props.grouped} />
+ </Message.Slot>
+ <Show when={!props.grouped}>
<Message.Slot
placement="header"
- class="flex items-center gap-1 min-w-0 w-full"
+ class="flex items-baseline gap-1 min-w-0"
>
<Message.SenderName />
- <Message.EditedIndicator />
- <div class="grow shrink-0 min-w-0 flex justify-end group-hover/message:absolute group-hover/message:right-1 group-hover/message:-top-9 group-hover/message:p-1">
- <Message.Timestamp
- class="ml-auto shrink-0"
- format="dateAndTime"
- />
- </div>
- </Message.Slot>
- <Message.Slot placement="content" class="ph-no-capture">
- <Message.Content />
+ <Message.Timestamp class="shrink-0" format="dateAndTime" />
+ <Message.EditedIndicator class="shrink-0" />
</Message.Slot>
+ </Show>
+ <Message.Slot placement="content" class="ph-no-capture">
+ <Show when={isEditing()} fallback={<Message.Content />}>
+ <DiscussionInput
+ input={{
+ mode: 'reply',
+ placeholder: 'Edit comment...',
+ value: props.comment.text,
+ }}
+ onSend={props.onEditSave}
+ onClose={() => {
+ props.onEditCancel();
+ }}
+ />
+ </Show>
+ </Message.Slot>
+ <Show when={!isEditing()}>
<Message.ActionMenu />
- </Message.Layout>
- </Message.Root>
- </Show>
+ </Show>
+ </Message.Layout>
+ </Message.Root>
</div>
);
}
diff --git a/apps/web/src/lib/core/constant/featureFlags.ts b/apps/web/src/lib/core/constant/featureFlags.ts
index d0bbde1a7d..f3d84b09a7 100644
--- a/apps/web/src/lib/core/constant/featureFlags.ts
+++ b/apps/web/src/lib/core/constant/featureFlags.ts
@@ -432,7 +432,7 @@ export const USE_MACRO_PR_SUMMARY_BLOCK = resolveFeatureFlag(
);
// skips over posthog and sets the ENABLE_CALLS feature to true if we are in dev mode
-const ENABLE_CALLS_OVERRIDE = DEV_MODE_ENV ? true : true;
+const ENABLE_CALLS_OVERRIDE = true;
export function ENABLE_CALLS(): boolean {
if (ENABLE_CALLS_OVERRIDE !== undefined) {
diff --git a/apps/web/src/lib/core/linked-conversation/LinkedConversation.tsx b/apps/web/src/lib/core/linked-conversation/LinkedConversation.tsx
index 8b348aba21..ac0f235698 100644
--- a/apps/web/src/lib/core/linked-conversation/LinkedConversation.tsx
+++ b/apps/web/src/lib/core/linked-conversation/LinkedConversation.tsx
@@ -6,6 +6,7 @@ import { Message } from '@channel/Message/Message';
import type { MessageData } from '@channel/Message/types';
import { Thread } from '@channel/Thread/Thread';
import { ThreadRail } from '@channel/Thread/ThreadRail';
+import { ThreadReplyRail } from '@channel/Thread/ThreadReplyRail';
import {
DEFAULT_VISIBLE_REPLY_COUNT,
getCollapsedRepliesCount,
@@ -80,7 +81,7 @@ export function LinkedConversation(props: LinkedConversationProps) {
<For each={displayReplies()}>
{(reply) => (
<div class="relative">
- <ThreadRail />
+ <ThreadReplyRail grouped={isGroupedById()[reply.id]} />
<ConversationMessage
message={reply}
grouped={isGroupedById()[reply.id]}