Skip to content

Commit 29f6ccf

Browse files
authored
Style channel header navigation (#889)
1 parent 2ebe551 commit 29f6ccf

13 files changed

Lines changed: 137 additions & 54 deletions

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

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export function AgentSessionThreadPanel({
5555
const avatarUrl = profiles?.[agent.pubkey.toLowerCase()]?.avatarUrl ?? null;
5656
const isOverlay = useIsThreadPanelOverlay();
5757
const isFloatingOverlay = isOverlay && !isSinglePanelView;
58+
const usesChannelSplitChrome = !isOverlay && !isSinglePanelView;
5859
useEscapeKey(onClose, isOverlay || isSinglePanelView);
5960

6061
const { ref: scrollRef, onScroll } = useStickToBottom<HTMLDivElement>();
@@ -111,7 +112,10 @@ export function AgentSessionThreadPanel({
111112
{!isOverlay ? (
112113
<div
113114
aria-hidden="true"
114-
className="pointer-events-none absolute inset-x-0 top-0 z-40 h-[76px] bg-background/75 backdrop-blur-md before:absolute before:left-0 before:right-0 before:top-10 before:h-px before:bg-border/35 after:absolute after:bottom-0 after:-left-px after:top-10 after:w-px after:bg-border/80 supports-[backdrop-filter]:bg-background/65 dark:bg-background/45 dark:backdrop-blur-xl dark:supports-[backdrop-filter]:bg-background/35"
115+
className={cn(
116+
"pointer-events-none absolute inset-x-0 top-0 z-40 bg-background/75 backdrop-blur-md before:absolute before:left-0 before:right-0 before:top-10 before:h-px before:bg-border/35 after:absolute after:bottom-0 after:-left-px after:top-10 after:w-px after:bg-border/80 supports-[backdrop-filter]:bg-background/65 dark:bg-background/45 dark:backdrop-blur-xl dark:supports-[backdrop-filter]:bg-background/35",
117+
usesChannelSplitChrome ? "h-[92px]" : "h-[76px]",
118+
)}
115119
/>
116120
) : null}
117121

@@ -122,7 +126,7 @@ export function AgentSessionThreadPanel({
122126
? `relative ${PANEL_SINGLE_COLUMN_HEADER_LAYER_CLASS} -mb-[76px] min-h-[76px] shrink-0 gap-[10px] bg-background/80 pb-[4px] pl-[16px] pr-[8px] pt-[42px] backdrop-blur-md supports-[backdrop-filter]:bg-background/70 sm:pl-[24px] sm:pr-[12px] dark:bg-background/70 dark:backdrop-blur-xl dark:supports-[backdrop-filter]:bg-background/55`
123127
: isOverlay
124128
? "relative z-50 min-h-[44px] shrink-0 gap-3 bg-background/80 px-3 py-[6px] backdrop-blur-md supports-[backdrop-filter]:bg-background/70 dark:bg-background/70 dark:backdrop-blur-xl dark:supports-[backdrop-filter]:bg-background/55"
125-
: "absolute inset-x-0 top-[42px] z-50 min-h-[32px] gap-3 px-3 py-[4px]",
129+
: "absolute inset-x-0 top-[48px] z-50 h-[32px] gap-[10px] py-0 pl-[16px] pr-[8px] sm:pr-[12px]",
126130
)}
127131
data-tauri-drag-region
128132
>
@@ -139,7 +143,14 @@ export function AgentSessionThreadPanel({
139143
displayName={agent.name}
140144
size="xs"
141145
/>
142-
<h2 className="min-w-0 flex-1 translate-y-px truncate text-sm font-semibold leading-5 tracking-tight">
146+
<h2
147+
className={cn(
148+
"min-w-0 flex-1 translate-y-px truncate font-semibold tracking-tight",
149+
usesChannelSplitChrome
150+
? "text-base leading-6"
151+
: "text-sm leading-5",
152+
)}
153+
>
143154
{agent.name}
144155
</h2>
145156
</div>
@@ -186,14 +197,22 @@ export function AgentSessionThreadPanel({
186197
) : null}
187198
<Button
188199
aria-label="Close activity panel"
189-
className="h-6 w-6 text-foreground hover:bg-muted/60 hover:text-foreground"
200+
className={cn(
201+
usesChannelSplitChrome
202+
? "h-8 w-8 rounded-lg border border-border/40 text-muted-foreground hover:bg-muted/70 hover:text-foreground [&_svg]:size-5"
203+
: "h-6 w-6 text-foreground hover:bg-muted/60 hover:text-foreground",
204+
)}
190205
data-testid="agent-session-close"
191206
onClick={onClose}
192207
size="icon"
193208
type="button"
194209
variant="ghost"
195210
>
196-
<X className="h-3.5 w-3.5" />
211+
<X
212+
className={cn(
213+
usesChannelSplitChrome ? "size-5" : "h-3.5 w-3.5",
214+
)}
215+
/>
197216
</Button>
198217
</div>
199218
</div>
@@ -204,10 +223,13 @@ export function AgentSessionThreadPanel({
204223
onScroll={onScroll}
205224
className={cn(
206225
"min-h-0 flex-1 overflow-y-auto px-3 pb-4",
207-
// Match MessageThreadPanel: single-panel mode has a 76px header
208-
// (min-h-[76px] with -mb-[76px]), so the body must clear it. Only
209-
// the floating overlay (44px header) uses the smaller pt-4.
210-
isSinglePanelView ? "pt-[76px]" : isOverlay ? "pt-4" : "pt-[76px]",
226+
// Single-panel mode keeps the 76px local header; split panes sit
227+
// under the channel screen's 92px top chrome.
228+
usesChannelSplitChrome
229+
? "pt-[92px]"
230+
: isOverlay
231+
? "pt-4"
232+
: "pt-[76px]",
211233
)}
212234
>
213235
<ManagedAgentSessionPanel

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,38 +84,38 @@ export function ChannelMembersBar({
8484

8585
return (
8686
<React.Fragment>
87-
<div className="flex items-center gap-1">
87+
<div className="flex items-center gap-[6px]">
8888
<Button
8989
aria-label="Add agent"
90-
className="h-7 w-7 rounded-full"
90+
className="h-8 w-8 rounded-lg border border-border/40 text-muted-foreground hover:bg-muted/70 hover:text-foreground [&_svg]:size-5"
9191
data-testid="channel-add-bot-trigger"
9292
disabled={!canAddAgents}
9393
onClick={() => {
9494
setIsAddBotOpen(true);
9595
}}
9696
size="icon"
9797
type="button"
98-
variant="outline"
98+
variant="ghost"
9999
>
100-
<Plus className="h-3 w-3" />
100+
<Plus className="size-5" />
101101
</Button>
102102

103103
<Button
104104
aria-label={`View channel members (${memberCount})`}
105-
className="h-7 gap-1 rounded-full px-2"
105+
className="h-8 gap-1 rounded-lg border border-border/40 px-2.5 text-muted-foreground hover:bg-muted/70 hover:text-foreground [&_svg]:size-5"
106106
data-testid="channel-members-trigger"
107107
onClick={onToggleMembers}
108108
type="button"
109-
variant="outline"
109+
variant="ghost"
110110
>
111-
<Users className="h-3 w-3" />
111+
<Users className="size-5" />
112112
<span className="min-w-[1ch] text-[11px] font-medium tabular-nums">
113113
{memberCount}
114114
</span>
115115
</Button>
116116

117117
<HuddleIndicator
118-
className="h-7 w-7"
118+
className="h-8 w-8"
119119
channelId={channel.id}
120120
onStart={async () => {
121121
try {
@@ -132,14 +132,14 @@ export function ChannelMembersBar({
132132

133133
<Button
134134
aria-label="Manage channel"
135-
className="h-7 w-7 rounded-full"
135+
className="h-8 w-8 rounded-lg border border-border/40 text-muted-foreground hover:bg-muted/70 hover:text-foreground [&_svg]:size-5"
136136
data-testid="channel-management-trigger"
137137
onClick={onManageChannel}
138138
size="icon"
139139
type="button"
140-
variant="outline"
140+
variant="ghost"
141141
>
142-
<Settings2 className="h-3 w-3" />
142+
<Settings2 className="size-5" />
143143
</Button>
144144
</div>
145145

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ import { useChannelFind } from "@/features/search/useChannelFind";
4444
import { ViewLoadingFallback } from "@/shared/ui/ViewLoadingFallback";
4545
import { AgentSessionProvider } from "@/shared/context/AgentSessionContext";
4646
import { ProfilePanelProvider } from "@/shared/context/ProfilePanelContext";
47-
import { useElementWidthBreakpoint } from "@/shared/hooks/use-mobile";
4847
import {
48+
useElementWidthBreakpoint,
49+
useIsThreadPanelOverlay,
50+
} from "@/shared/hooks/use-mobile";
51+
import {
52+
THREAD_PANEL_MIN_WIDTH_PX,
4953
THREAD_PANEL_SINGLE_COLUMN_BREAKPOINT_PX,
5054
useThreadPanelWidth,
5155
} from "@/shared/hooks/useThreadPanelWidth";
@@ -87,6 +91,7 @@ export function ChannelScreen({
8791
widthPx: threadPanelWidthPx,
8892
} = useThreadPanelWidth();
8993
const [isMembersSidebarOpen, setIsMembersSidebarOpen] = React.useState(false);
94+
const isThreadPanelOverlay = useIsThreadPanelOverlay();
9095
const [channelContentRef, isNarrowPanelViewport] =
9196
useElementWidthBreakpoint<HTMLDivElement>(
9297
THREAD_PANEL_SINGLE_COLUMN_BREAKPOINT_PX,
@@ -435,6 +440,15 @@ export function ChannelScreen({
435440
Boolean(
436441
openThreadHeadMessage || openAgentSessionPubkey || profilePanelPubkey,
437442
);
443+
const hasSplitRightPanel =
444+
!isSinglePanelView &&
445+
!isThreadPanelOverlay &&
446+
Boolean(
447+
openThreadHeadMessage || openAgentSessionPubkey || profilePanelPubkey,
448+
);
449+
const headerActionsRightInset = hasSplitRightPanel
450+
? `min(${threadPanelWidthPx}px, calc(100% - ${THREAD_PANEL_MIN_WIDTH_PX}px))`
451+
: undefined;
438452

439453
return (
440454
<AgentSessionProvider onOpenAgentSession={handleOpenAgentSession}>
@@ -443,6 +457,7 @@ export function ChannelScreen({
443457
activeChannel={activeChannel}
444458
activeChannelEphemeralDisplay={activeChannelEphemeralDisplay}
445459
activeChannelTitle={activeChannelTitle}
460+
actionsRightInset={headerActionsRightInset}
446461
activeDmPresenceStatus={activeDmPresenceStatus}
447462
currentPubkey={currentPubkey}
448463
isJoining={joinChannelMutation.isPending}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type ChannelScreenHeaderProps = {
1414
activeChannel: Channel | null;
1515
activeChannelEphemeralDisplay: EphemeralChannelDisplay | null;
1616
activeChannelTitle: string;
17+
actionsRightInset?: string;
1718
activeDmPresenceStatus: PresenceStatus | null;
1819
currentPubkey?: string;
1920
isJoining?: boolean;
@@ -27,6 +28,7 @@ export function ChannelScreenHeader({
2728
activeChannel,
2829
activeChannelEphemeralDisplay,
2930
activeChannelTitle,
31+
actionsRightInset,
3032
activeDmPresenceStatus,
3133
currentPubkey,
3234
isJoining = false,
@@ -79,10 +81,10 @@ export function ChannelScreenHeader({
7981

8082
return (
8183
<ChatHeader
82-
actionsPlacement="top-right"
8384
belowSystemChrome
8485
density="compact"
8586
actions={actions}
87+
actionsRightInset={actionsRightInset}
8688
channelType={activeChannel?.channelType}
8789
description={getChannelDescription(activeChannel)}
8890
statusBadge={

‎desktop/src/features/chat/ui/ChatHeader.tsx‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { cn } from "@/shared/lib/cn";
1919
type ChatHeaderProps = {
2020
actions?: React.ReactNode;
2121
actionsPlacement?: "inline" | "top-right";
22+
actionsRightInset?: string;
2223
belowSystemChrome?: boolean;
2324
density?: "default" | "compact";
2425
title: string;
@@ -80,6 +81,7 @@ function ChannelIcon({
8081
export function ChatHeader({
8182
actions,
8283
actionsPlacement = "inline",
84+
actionsRightInset,
8385
belowSystemChrome = false,
8486
density = "default",
8587
title,
@@ -101,10 +103,8 @@ export function ChatHeader({
101103
const header = (
102104
<header
103105
className={cn(
104-
"relative z-30 flex min-w-0 shrink-0 cursor-default select-none items-center gap-[10px] bg-transparent pl-[16px] pr-[8px] transition-[margin,padding] duration-200 ease-linear sm:pl-[24px] sm:pr-[12px]",
105-
density === "compact"
106-
? "min-h-[32px] py-[4px]"
107-
: "min-h-[44px] py-[6px]",
106+
"pointer-events-auto relative z-30 flex min-w-0 shrink-0 cursor-default select-none items-center gap-[10px] bg-transparent pl-[16px] pr-[8px] transition-[margin,padding] duration-200 ease-linear sm:pl-[24px] sm:pr-[12px]",
107+
density === "compact" ? "h-[32px] py-0" : "min-h-[44px] py-[6px]",
108108
overlaysContent && !belowSystemChrome && "-mb-[44px]",
109109
)}
110110
data-testid="chat-header"
@@ -118,7 +118,7 @@ export function ChatHeader({
118118
visibility={visibility}
119119
/>
120120
<h1
121-
className="min-w-0 translate-y-px truncate text-sm font-semibold leading-5 tracking-tight"
121+
className="min-w-0 translate-y-px truncate text-base font-semibold leading-6 tracking-tight"
122122
data-testid="chat-title"
123123
title={trimmedDescription || undefined}
124124
>
@@ -137,7 +137,12 @@ export function ChatHeader({
137137
createPortal(topRightActions, document.body)
138138
)
139139
) : (
140-
<div className="flex shrink-0 items-center gap-1">
140+
<div
141+
className="flex shrink-0 items-center gap-1"
142+
style={
143+
actionsRightInset ? { marginRight: actionsRightInset } : undefined
144+
}
145+
>
141146
<UpdateIndicator />
142147
{actions ? <div className="shrink-0">{actions}</div> : null}
143148
</div>
@@ -150,7 +155,7 @@ export function ChatHeader({
150155
}
151156

152157
return (
153-
<div className="relative z-30 h-[76px] -mb-[76px] bg-background/80 pt-[42px] backdrop-blur-md supports-[backdrop-filter]:bg-background/70 dark:bg-background/70 dark:backdrop-blur-xl dark:supports-[backdrop-filter]:bg-background/55">
158+
<div className="pointer-events-none relative z-30 h-[92px] -mb-[92px] bg-background/80 pb-[9px] pt-[48px] backdrop-blur-md after:absolute after:inset-x-0 after:bottom-0 after:h-px after:bg-border/35 after:content-[''] supports-[backdrop-filter]:bg-background/70 dark:bg-background/70 dark:backdrop-blur-xl dark:supports-[backdrop-filter]:bg-background/55">
154159
{header}
155160
</div>
156161
);

‎desktop/src/features/huddle/components/HuddleIndicator.tsx‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,18 @@ export function HuddleIndicator({
230230
<>
231231
<Button
232232
aria-label="Start huddle"
233-
className={cn("h-7 w-7 rounded-full", className)}
233+
className={cn(
234+
"h-8 w-8 rounded-lg border border-border/40 text-muted-foreground hover:bg-muted/70 hover:text-foreground [&_svg]:size-5",
235+
className,
236+
)}
234237
data-testid="channel-start-huddle-trigger"
235238
disabled={startDisabled || isStarting}
236239
onClick={() => headphonesGate.gate(() => onStart())}
237240
size="icon"
238241
type="button"
239-
variant="outline"
242+
variant="ghost"
240243
>
241-
<Headphones className="h-3 w-3" />
244+
<Headphones className="size-5" />
242245
</Button>
243246
{gateDialog}
244247
</>
@@ -270,15 +273,18 @@ export function HuddleIndicator({
270273
<TooltipTrigger asChild>
271274
<Button
272275
aria-label={`Join active huddle (${participantCount} participant${participantCount !== 1 ? "s" : ""})`}
273-
className={cn("relative h-7 w-7 rounded-full", className)}
276+
className={cn(
277+
"relative h-8 w-8 rounded-lg border border-border/40 text-muted-foreground hover:bg-muted/70 hover:text-foreground [&_svg]:size-5",
278+
className,
279+
)}
274280
disabled={isJoining || isStarting}
275281
onClick={() => headphonesGate.gate(() => void doJoin())}
276282
size="icon"
277283
type="button"
278-
variant="outline"
284+
variant="ghost"
279285
>
280-
<Headphones className="h-3 w-3 text-muted-foreground" />
281-
<span className="absolute inset-0 animate-pulse rounded-full ring-2 ring-border/70" />
286+
<Headphones className="size-5 text-muted-foreground" />
287+
<span className="absolute inset-0 animate-pulse rounded-lg ring-2 ring-border/70" />
282288
{/* Participant count badge */}
283289
{participantCount > 0 && (
284290
<span className="absolute -right-1 -top-1 flex h-3.5 min-w-3.5 items-center justify-center rounded-full border border-border bg-background px-0.5 text-[9px] font-bold text-muted-foreground">

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ export function DayDivider({ label }: { label: string }) {
22
return (
33
<section
44
aria-label={label}
5-
className="sticky top-[76px] z-[5] flex justify-center py-1"
5+
className="sticky top-[92px] z-[5] flex justify-center py-1"
66
data-testid="message-timeline-day-divider"
77
data-day-label={label}
88
>
9-
<p className="shrink-0 rounded-lg border border-border/70 bg-background/95 px-2 py-1 text-[10px] font-medium tracking-[0.02em] text-muted-foreground/70 shadow-xs backdrop-blur-sm">
9+
<p className="relative z-10 shrink-0 rounded-lg border border-border/70 bg-background/95 px-2 py-1 text-[10px] font-medium tracking-[0.02em] text-muted-foreground/70 shadow-xs backdrop-blur-sm">
1010
{label}
1111
</p>
1212
</section>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "@/shared/ui/tooltip";
1212

1313
const REACTION_PILL_BASE_CLASSES =
1414
"inline-flex h-8 items-center rounded-full border text-xs font-medium leading-none transition-colors";
15-
const REACTION_GLYPH_CLASSES = "-translate-y-px h-3.5 w-3.5 text-sm";
15+
const REACTION_GLYPH_CLASSES = "h-3.5 w-3.5 translate-y-px text-sm";
1616
const REACTION_PILL_HOVER_CLASSES =
1717
"hover:bg-primary/10 hover:text-foreground focus-visible:bg-primary/10 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring";
1818

0 commit comments

Comments
 (0)