Skip to content

Commit 1ca16c8

Browse files
tellahonpub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6wclaude
authored
fix(desktop): make header chrome zoom-correct and tidy split-pane (#941)
Signed-off-by: Taylor Ho <[email protected]> Co-authored-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Claude Fable 5 <[email protected]>
1 parent 8c83129 commit 1ca16c8

40 files changed

Lines changed: 1498 additions & 1038 deletions

‎desktop/src/app/AppShell.tsx‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import {
2121
useHideDmMutation,
2222
useOpenDmMutation,
2323
} from "@/features/channels/hooks";
24-
import { useMembershipNotifications } from "@/features/channels/useMembershipNotifications";
2524
import { useUnreadChannels } from "@/features/channels/useUnreadChannels";
25+
import { useMembershipNotifications } from "@/features/channels/useMembershipNotifications";
2626
import { getThreadReference } from "@/features/messages/lib/threading";
2727
import { useThreadFollows } from "@/features/messages/lib/useThreadFollows";
2828
import {
@@ -66,6 +66,8 @@ import { useDeferredStartup } from "@/shared/hooks/useDeferredStartup";
6666
import { joinChannel } from "@/shared/api/tauri";
6767
import type { Channel, RelayEvent, SearchHit } from "@/shared/api/types";
6868
import { ChannelNavigationProvider } from "@/shared/context/ChannelNavigationContext";
69+
import { MainInsetProvider } from "@/shared/layout/MainInsetContext";
70+
import { chromeCssVarDefaults } from "@/shared/layout/chromeLayout";
6971
import { hasPrimaryShortcutModifier } from "@/shared/lib/platform";
7072
import { useMessageDeepLinks } from "@/shared/useMessageDeepLinks";
7173
import { SidebarInset, SidebarProvider } from "@/shared/ui/sidebar";
@@ -182,6 +184,7 @@ export function AppShell() {
182184
React.useState<BrowseDialogType>(null);
183185
const [isNewDmOpen, setIsNewDmOpen] = React.useState(false);
184186
const [isCreateChannelOpen, setIsCreateChannelOpen] = React.useState(false);
187+
const mainInsetRef = React.useRef<HTMLElement>(null);
185188
const location = useLocation();
186189
const queryClient = useQueryClient();
187190
const {
@@ -863,9 +866,15 @@ export function AppShell() {
863866
onUnstarChannel={unstarChannel}
864867
/>
865868

866-
<SidebarInset className="min-h-0 min-w-0 overflow-hidden">
867-
<Outlet />
868-
</SidebarInset>
869+
<MainInsetProvider mainInsetRef={mainInsetRef}>
870+
<SidebarInset
871+
ref={mainInsetRef}
872+
className="min-h-0 min-w-0 overflow-hidden"
873+
style={chromeCssVarDefaults}
874+
>
875+
<Outlet />
876+
</SidebarInset>
877+
</MainInsetProvider>
869878
</>
870879
)}
871880

‎desktop/src/app/AppTopChrome.tsx‎

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { ChevronLeft, ChevronRight } from "lucide-react";
22

33
import { TopbarSearch } from "@/features/search/ui/TopbarSearch";
44
import type { Channel, SearchHit } from "@/shared/api/types";
5-
import { cn } from "@/shared/lib/cn";
65
import { Button } from "@/shared/ui/button";
76
import { SidebarTrigger, useSidebar } from "@/shared/ui/sidebar";
87

@@ -25,8 +24,11 @@ function GlobalTopDivider() {
2524
return (
2625
<div
2726
aria-hidden="true"
28-
className="pointer-events-none fixed right-0 top-10 z-40 h-px bg-border/35"
29-
style={{ left: state === "expanded" ? "var(--sidebar-width)" : 0 }}
27+
className="pointer-events-none fixed top-10 z-40 h-px bg-border/35"
28+
style={{
29+
left: state === "expanded" ? "var(--sidebar-width)" : 0,
30+
right: 0,
31+
}}
3032
/>
3133
);
3234
}
@@ -49,12 +51,13 @@ function CenterColumnTopbarSearch({
4951

5052
return (
5153
<div
52-
className={cn(
53-
"pointer-events-none fixed right-0 top-[7px] z-[45] flex justify-center px-24",
54-
!isResizing && "transition-[left] duration-200 ease-linear",
55-
)}
54+
className="pointer-events-none fixed top-[7px] z-45 flex justify-center px-24 transition-[left] duration-200 ease-linear data-[resizing=true]:transition-none"
5655
data-testid="topbar-search-column"
57-
style={{ left: state === "expanded" ? "var(--sidebar-width)" : 0 }}
56+
data-resizing={isResizing}
57+
style={{
58+
left: state === "expanded" ? "var(--sidebar-width)" : 0,
59+
right: 0,
60+
}}
5861
>
5962
<TopbarSearch
6063
channels={channels}
@@ -69,7 +72,7 @@ function CenterColumnTopbarSearch({
6972
}
7073

7174
const TOP_CHROME_ICON_BUTTON_CLASS =
72-
"size-6 rounded-[4px] p-1 text-muted-foreground/70 hover:bg-border/45 hover:text-foreground";
75+
"rounded-[4px] text-muted-foreground/70 hover:bg-border/45 hover:text-foreground";
7376

7477
export function AppTopChrome({
7578
canGoBack,
@@ -91,7 +94,7 @@ export function AppTopChrome({
9194
data-tauri-drag-region
9295
/>
9396
<GlobalTopDivider />
94-
<div className="fixed left-[80px] top-[9px] z-[45] flex items-center gap-0.5">
97+
<div className="fixed left-[80px] top-[9px] z-45 flex items-center gap-0.5">
9598
<SidebarTrigger className={TOP_CHROME_ICON_BUTTON_CLASS} />
9699
<Button
97100
aria-label="Go back"
@@ -102,7 +105,7 @@ export function AppTopChrome({
102105
size="icon"
103106
variant="ghost"
104107
>
105-
<ChevronLeft className="h-4 w-4" />
108+
<ChevronLeft />
106109
</Button>
107110
<Button
108111
aria-label="Go forward"
@@ -113,7 +116,7 @@ export function AppTopChrome({
113116
size="icon"
114117
variant="ghost"
115118
>
116-
<ChevronRight className="h-4 w-4" />
119+
<ChevronRight />
117120
</Button>
118121
</div>
119122
{searchHidden ? null : (

‎desktop/src/features/agent-memory/ui/MemorySection.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
import type { MemoryTreeNode } from "@/features/agent-memory/lib/buildMemoryGraph";
99
import type { EngramEntry } from "@/shared/api/tauriEngrams";
1010
import { cn } from "@/shared/lib/cn";
11-
import { Button } from "@/shared/ui/button";
11+
import { Button, type ButtonProps } from "@/shared/ui/button";
1212
import { Skeleton } from "@/shared/ui/skeleton";
1313
import { Tooltip, TooltipContent, TooltipTrigger } from "@/shared/ui/tooltip";
1414

@@ -58,10 +58,12 @@ export function MemoryRefreshButton({
5858
agentPubkey,
5959
className,
6060
iconClassName,
61+
variant = "ghost",
6162
}: {
6263
agentPubkey: string;
6364
className?: string;
6465
iconClassName?: string;
66+
variant?: ButtonProps["variant"];
6567
}): React.ReactElement | null {
6668
const isOwner = useIsManagedAgent(agentPubkey);
6769
const { query } = useAgentMemoryGraph(agentPubkey, {
@@ -79,7 +81,7 @@ export function MemoryRefreshButton({
7981
onClick={() => query.refetch()}
8082
size="icon"
8183
type="button"
82-
variant="ghost"
84+
variant={variant}
8385
>
8486
<RefreshCw
8587
className={cn(

0 commit comments

Comments
 (0)