Skip to content

Commit bc23620

Browse files
Fix desktop glass chrome and inbox previews (#793)
Co-authored-by: Cursor <[email protected]>
1 parent 9b9cf46 commit bc23620

10 files changed

Lines changed: 146 additions & 93 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ export function AgentSessionThreadPanel({
9393
{!isOverlay ? (
9494
<div
9595
aria-hidden="true"
96-
className="pointer-events-none absolute inset-x-0 top-0 z-40 h-[76px] bg-background/45 backdrop-blur-xl after:absolute after:bottom-0 after:left-0 after:top-10 after:w-px after:bg-border/80 supports-[backdrop-filter]:bg-background/35"
96+
className="pointer-events-none absolute inset-x-0 top-0 z-40 h-[76px] bg-background/75 backdrop-blur-md after:absolute after:bottom-0 after:left-0 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"
9797
/>
9898
) : null}
9999

100100
<div
101101
className={cn(
102102
"z-50 flex cursor-default select-none items-center gap-3 px-4",
103103
isOverlay
104-
? "relative min-h-[44px] shrink-0 border-b border-border/70 bg-background/70 py-2.5 backdrop-blur-xl supports-[backdrop-filter]:bg-background/55"
104+
? "relative min-h-[44px] shrink-0 border-b border-border/70 bg-background/80 py-2.5 backdrop-blur-md supports-[backdrop-filter]:bg-background/70 dark:bg-background/70 dark:backdrop-blur-xl dark:supports-[backdrop-filter]:bg-background/55"
105105
: "absolute inset-x-0 top-11 min-h-[32px] py-[4px]",
106106
)}
107107
data-tauri-drag-region

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export function ChatHeader({
150150
}
151151

152152
return (
153-
<div className="relative z-30 h-[76px] -mb-[76px] bg-background/70 pt-[42px] backdrop-blur-xl supports-[backdrop-filter]:bg-background/55">
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">
154154
{header}
155155
</div>
156156
);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export function InboxDetailPane({
214214
<div className="relative min-h-0 flex-1 overflow-hidden">
215215
<div
216216
aria-hidden="true"
217-
className="pointer-events-none absolute inset-x-0 top-0 z-40 h-[76px] bg-background/45 backdrop-blur-xl supports-[backdrop-filter]:bg-background/35"
217+
className="pointer-events-none absolute inset-x-0 top-0 z-40 h-[76px] bg-background/75 backdrop-blur-md supports-[backdrop-filter]:bg-background/65 dark:bg-background/45 dark:backdrop-blur-xl dark:supports-[backdrop-filter]:bg-background/35"
218218
/>
219219
<div className="absolute inset-x-0 top-[38px] z-50 flex min-h-[32px] items-center justify-between gap-3 py-[4px] pl-6 pr-3">
220220
<div className="min-w-0">

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
} from "@/features/home/lib/inbox";
88
import { cn } from "@/shared/lib/cn";
99
import { Button } from "@/shared/ui/button";
10+
import { Markdown } from "@/shared/ui/markdown";
1011
import {
1112
DropdownMenu,
1213
DropdownMenuContent,
@@ -47,7 +48,7 @@ export function InboxListPane({
4748
<section className="relative flex min-h-0 min-w-0 flex-col overflow-hidden bg-background/60">
4849
<div
4950
aria-hidden="true"
50-
className="pointer-events-none absolute inset-x-0 top-0 z-40 h-[76px] bg-background/45 backdrop-blur-xl supports-[backdrop-filter]:bg-background/35"
51+
className="pointer-events-none absolute inset-x-0 top-0 z-40 h-[76px] bg-background/75 backdrop-blur-md supports-[backdrop-filter]:bg-background/65 dark:bg-background/45 dark:backdrop-blur-xl dark:supports-[backdrop-filter]:bg-background/35"
5152
/>
5253
<div className="absolute inset-x-0 top-[42px] z-50 min-h-[32px] px-5 py-[4px]">
5354
<div className="flex min-w-0 items-center justify-between gap-3">
@@ -159,16 +160,22 @@ export function InboxListPane({
159160
</span>
160161
</div>
161162

162-
<p
163+
<div
163164
className={cn(
164-
"mt-0.5 line-clamp-2 text-sm leading-5",
165+
"mt-0.5 line-clamp-2 text-sm leading-5 [&_*]:inline [&_a]:font-medium [&_a]:text-current [&_br]:hidden [&_p]:inline",
165166
isDone
166167
? "font-normal text-muted-foreground"
167168
: "font-semibold text-foreground",
168169
)}
169170
>
170-
{item.preview}
171-
</p>
171+
<Markdown
172+
className="inline max-w-full text-inherit"
173+
content={item.preview}
174+
interactive={false}
175+
mentionNames={item.mentionNames}
176+
tight
177+
/>
178+
</div>
172179

173180
<div className="mt-1 flex flex-wrap items-center gap-2 text-xs text-muted-foreground">
174181
<span

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ export function MessageComposer({
654654
/>
655655
<div className="relative flex w-full flex-col gap-3">
656656
<form
657-
className="relative isolate rounded-2xl border border-border/50 bg-background/70 px-3 pb-2 pt-3 shadow-[0_4px_24px_rgba(0,0,0,0.08)] backdrop-blur-xl supports-[backdrop-filter]:bg-background/55 dark:shadow-[0_4px_24px_rgba(0,0,0,0.35)] sm:px-4"
657+
className="relative isolate rounded-2xl border border-border/50 bg-background/80 px-3 pb-2 pt-3 shadow-[0_4px_24px_rgba(0,0,0,0.08)] backdrop-blur-md supports-[backdrop-filter]:bg-background/70 dark:bg-background/70 dark:backdrop-blur-xl dark:shadow-[0_4px_24px_rgba(0,0,0,0.35)] dark:supports-[backdrop-filter]:bg-background/55 sm:px-4"
658658
data-testid="message-composer"
659659
onDragEnter={media.handleDragEnter}
660660
onDragLeave={media.handleDragLeave}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export function MessageThreadPanel({
198198
className={cn(
199199
"z-50 flex cursor-default select-none items-center gap-3 px-3",
200200
isOverlay
201-
? "relative min-h-[44px] shrink-0 bg-background/70 py-[6px] backdrop-blur-xl supports-[backdrop-filter]:bg-background/55"
201+
? "relative min-h-[44px] shrink-0 bg-background/80 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"
202202
: "absolute inset-x-0 top-11 min-h-[32px] py-[4px]",
203203
)}
204204
data-tauri-drag-region

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ export const MessageTimeline = React.memo(function MessageTimeline({
149149
onScroll={syncScrollState}
150150
ref={scrollContainerRef}
151151
>
152-
<div className="flex w-full flex-col gap-2 pt-12" ref={contentRef}>
152+
<div
153+
className="flex w-full flex-col gap-2 pt-[76px]"
154+
ref={contentRef}
155+
>
153156
<div ref={topSentinelRef} aria-hidden className="h-px" />
154157

155158
{isFetchingOlder ? (

‎desktop/src/features/sidebar/ui/AppSidebar.tsx‎

Lines changed: 78 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ export function AppSidebar({
600600
</SidebarMenu>
601601
</SidebarHeader>
602602

603-
<div className="relative flex min-h-0 flex-1 flex-col">
603+
<div className="relative flex min-h-0 flex-1 flex-col overflow-hidden">
604604
{unreadAboveCount > 0 ? (
605605
<MoreUnreadButton
606606
count={unreadAboveCount}
@@ -610,7 +610,7 @@ export function AppSidebar({
610610
testId="sidebar-more-unread-above"
611611
/>
612612
) : null}
613-
<SidebarContent ref={scrollRef}>
613+
<SidebarContent className="pb-32" ref={scrollRef}>
614614
{isLoading ? (
615615
<SidebarGroup>
616616
<SidebarGroupLabel>Channels</SidebarGroupLabel>
@@ -713,95 +713,96 @@ export function AppSidebar({
713713

714714
{unreadBelowCount > 0 ? (
715715
<MoreUnreadButton
716+
bottomClassName="bottom-28"
716717
count={unreadBelowCount}
717718
icon={<ArrowDown />}
718719
onClick={scrollToNextBelow}
719720
position="bottom"
720721
testId="sidebar-more-unread-below"
721722
/>
722723
) : null}
723-
</div>
724724

725-
<SidebarFooter>
726-
<SidebarMenu>
727-
<SidebarMenuItem>
728-
<div
729-
className="rounded-xl px-2 py-2 transition-colors hover:bg-sidebar-accent/70 focus-within:bg-sidebar-accent/70"
730-
data-testid="sidebar-profile-card"
731-
>
732-
<div className="flex min-w-0 items-center gap-3">
733-
<div className="relative shrink-0">
734-
<ProfileAvatar
735-
avatarUrl={profile?.avatarUrl ?? null}
736-
className="h-10 w-10 rounded-2xl text-sm"
737-
iconClassName="h-5 w-5"
738-
label={resolvedDisplayName}
739-
testId="sidebar-profile-avatar"
740-
/>
741-
<span
742-
aria-label={getPresenceLabel(selfPresenceStatus)}
743-
className="absolute -bottom-0.5 -right-0.5 flex h-4 w-4 items-center justify-center rounded-full bg-sidebar"
744-
data-testid="self-presence-badge"
745-
role="img"
746-
>
747-
<PresenceDot
748-
className="h-2.5 w-2.5"
749-
status={selfPresenceStatus}
725+
<SidebarFooter className="absolute inset-x-0 bottom-0 z-30 bg-sidebar/55 shadow-[0_-16px_40px_hsl(var(--sidebar)/0.55)] backdrop-blur-xl supports-[backdrop-filter]:bg-sidebar/45 dark:bg-sidebar/45 dark:shadow-[0_-16px_44px_rgba(0,0,0,0.42)] dark:supports-[backdrop-filter]:bg-sidebar/35">
726+
<SidebarMenu>
727+
<SidebarMenuItem>
728+
<div
729+
className="rounded-xl px-2 py-2 transition-colors hover:bg-sidebar-accent/35 focus-within:bg-sidebar-accent/35 dark:hover:bg-sidebar-accent/25 dark:focus-within:bg-sidebar-accent/25"
730+
data-testid="sidebar-profile-card"
731+
>
732+
<div className="flex min-w-0 items-center gap-3">
733+
<div className="relative shrink-0">
734+
<ProfileAvatar
735+
avatarUrl={profile?.avatarUrl ?? null}
736+
className="h-10 w-10 rounded-2xl text-sm"
737+
iconClassName="h-5 w-5"
738+
label={resolvedDisplayName}
739+
testId="sidebar-profile-avatar"
750740
/>
751-
</span>
752-
</div>
753-
<div className="min-w-0 flex-1">
754-
<ProfilePopover
755-
open={profilePopoverOpen}
756-
onOpenChange={setProfilePopoverOpen}
757-
displayName={resolvedDisplayName}
758-
nip05={profile?.nip05Handle}
759-
avatarUrl={profile?.avatarUrl ?? null}
760-
currentStatus={selfPresenceStatus}
761-
isStatusPending={isPresencePending}
762-
userStatusText={selfUserStatus?.text}
763-
userStatusEmoji={selfUserStatus?.emoji}
764-
onSetStatus={onSetPresenceStatus ?? (() => {})}
765-
onSetUserStatus={onSetUserStatus}
766-
onClearUserStatus={onClearUserStatus}
767-
onOpenSettings={onSelectSettings}
768-
>
769-
<button
770-
className="block w-full min-w-0 text-left text-sidebar-foreground"
771-
data-testid="open-settings"
772-
type="button"
741+
<span
742+
aria-label={getPresenceLabel(selfPresenceStatus)}
743+
className="absolute -bottom-0.5 -right-0.5 flex h-4 w-4 items-center justify-center rounded-full bg-sidebar"
744+
data-testid="self-presence-badge"
745+
role="img"
773746
>
774-
<p
775-
className="truncate text-sm font-semibold text-current"
776-
data-testid="sidebar-profile-name"
747+
<PresenceDot
748+
className="h-2.5 w-2.5"
749+
status={selfPresenceStatus}
750+
/>
751+
</span>
752+
</div>
753+
<div className="min-w-0 flex-1">
754+
<ProfilePopover
755+
open={profilePopoverOpen}
756+
onOpenChange={setProfilePopoverOpen}
757+
displayName={resolvedDisplayName}
758+
nip05={profile?.nip05Handle}
759+
avatarUrl={profile?.avatarUrl ?? null}
760+
currentStatus={selfPresenceStatus}
761+
isStatusPending={isPresencePending}
762+
userStatusText={selfUserStatus?.text}
763+
userStatusEmoji={selfUserStatus?.emoji}
764+
onSetStatus={onSetPresenceStatus ?? (() => {})}
765+
onSetUserStatus={onSetUserStatus}
766+
onClearUserStatus={onClearUserStatus}
767+
onOpenSettings={onSelectSettings}
768+
>
769+
<button
770+
className="block w-full min-w-0 text-left text-sidebar-foreground"
771+
data-testid="open-settings"
772+
type="button"
777773
>
778-
{resolvedDisplayName}
774+
<p
775+
className="truncate text-sm font-semibold text-current"
776+
data-testid="sidebar-profile-name"
777+
>
778+
{resolvedDisplayName}
779+
</p>
780+
</button>
781+
</ProfilePopover>
782+
<WorkspaceSwitcher
783+
activeWorkspace={activeWorkspace}
784+
onAddWorkspace={onOpenAddWorkspace}
785+
onRemoveWorkspace={onRemoveWorkspace}
786+
onSwitchWorkspace={onSwitchWorkspace}
787+
onUpdateWorkspace={onUpdateWorkspace}
788+
variant="profile"
789+
workspaces={workspaces}
790+
/>
791+
{selfUserStatus?.text || selfUserStatus?.emoji ? (
792+
<p className="mt-0.5 truncate text-xs text-sidebar-foreground/50">
793+
{selfUserStatus.emoji ? (
794+
<span className="mr-1">{selfUserStatus.emoji}</span>
795+
) : null}
796+
{selfUserStatus.text}
779797
</p>
780-
</button>
781-
</ProfilePopover>
782-
<WorkspaceSwitcher
783-
activeWorkspace={activeWorkspace}
784-
onAddWorkspace={onOpenAddWorkspace}
785-
onRemoveWorkspace={onRemoveWorkspace}
786-
onSwitchWorkspace={onSwitchWorkspace}
787-
onUpdateWorkspace={onUpdateWorkspace}
788-
variant="profile"
789-
workspaces={workspaces}
790-
/>
791-
{selfUserStatus?.text || selfUserStatus?.emoji ? (
792-
<p className="mt-0.5 truncate text-xs text-sidebar-foreground/50">
793-
{selfUserStatus.emoji ? (
794-
<span className="mr-1">{selfUserStatus.emoji}</span>
795-
) : null}
796-
{selfUserStatus.text}
797-
</p>
798-
) : null}
798+
) : null}
799+
</div>
799800
</div>
800801
</div>
801-
</div>
802-
</SidebarMenuItem>
803-
</SidebarMenu>
804-
</SidebarFooter>
802+
</SidebarMenuItem>
803+
</SidebarMenu>
804+
</SidebarFooter>
805+
</div>
805806

806807
<CreateChannelDialog
807808
channelKind={createDialogKind}

‎desktop/src/features/sidebar/ui/MoreUnreadButton.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ const MORE_UNREAD_BUTTON_CLASS =
66
"h-7 min-h-7 gap-1.5 rounded-full border-0 bg-primary px-2.5 text-[11px] font-medium text-primary-foreground shadow-md hover:bg-primary/90 [&_svg]:size-3.5";
77

88
export function MoreUnreadButton({
9+
bottomClassName = "bottom-0",
910
count,
1011
icon,
1112
onClick,
1213
position,
1314
testId,
1415
}: {
16+
bottomClassName?: string;
1517
count: number;
1618
icon: React.ReactNode;
1719
onClick: () => void;
@@ -20,7 +22,7 @@ export function MoreUnreadButton({
2022
}) {
2123
return (
2224
<div
23-
className={`pointer-events-none absolute inset-x-0 z-10 flex justify-center py-1 ${position === "top" ? "top-0" : "bottom-0"}`}
25+
className={`pointer-events-none absolute inset-x-0 z-10 flex justify-center py-1 ${position === "top" ? "top-0" : bottomClassName}`}
2426
>
2527
<Button
2628
className={`pointer-events-auto ${MORE_UNREAD_BUTTON_CLASS}`}

0 commit comments

Comments
 (0)