From 1ca16c898c7ccd5c9a4f78768e697b411367c975 Mon Sep 17 00:00:00 2001 From: Taylor Ho Date: Thu, 11 Jun 2026 07:27:23 -0700 Subject: [PATCH] fix(desktop): make header chrome zoom-correct and tidy split-pane (#941) Signed-off-by: Taylor Ho Co-authored-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Claude Fable 5 --- desktop/src/app/AppShell.tsx | 17 +- desktop/src/app/AppTopChrome.tsx | 27 +- .../agent-memory/ui/MemorySection.tsx | 6 +- .../channels/ui/AgentSessionThreadPanel.tsx | 264 +++++----- .../channels/ui/ChannelMembersBar.tsx | 23 +- .../src/features/channels/ui/ChannelPane.tsx | 244 +++++---- .../features/channels/ui/ChannelScreen.tsx | 88 ++-- .../channels/ui/ChannelScreenHeader.tsx | 7 +- .../channels/ui/RightAuxiliaryPane.tsx | 58 +++ desktop/src/features/chat/ui/ChatHeader.tsx | 76 ++- .../features/forum/ui/ForumThreadPanel.tsx | 5 +- desktop/src/features/forum/ui/ForumView.tsx | 4 +- desktop/src/features/home/ui/FeedSection.tsx | 4 +- .../features/home/ui/HomeChannelActions.tsx | 34 -- desktop/src/features/home/ui/HomeView.tsx | 17 +- .../src/features/home/ui/InboxDetailPane.tsx | 171 ++++--- .../src/features/home/ui/InboxListPane.tsx | 87 ++-- .../huddle/components/HuddleIndicator.tsx | 18 +- .../messages/ui/ComposerEmojiPicker.tsx | 2 +- .../messages/ui/MessageComposerToolbar.tsx | 55 +- .../messages/ui/MessageThreadPanel.tsx | 471 +++++++++--------- .../features/messages/ui/MessageTimeline.tsx | 4 +- .../messages/ui/useComposerHeightPadding.ts | 16 +- .../features/profile/ui/UserProfilePanel.tsx | 287 +++++------ .../src/features/settings/UpdateIndicator.tsx | 16 +- .../shared/layout/AuxiliaryPanelHeader.tsx | 69 +++ .../src/shared/layout/MainInsetContext.tsx | 27 + .../shared/layout/TopChromeInsetHeader.tsx | 30 ++ desktop/src/shared/layout/chromeLayout.ts | 56 +++ .../shared/layout/observeElementBlockSize.ts | 31 ++ .../shared/layout/useMeasuredCssVariable.ts | 65 +++ desktop/src/shared/ui/TopChromeBackdrop.tsx | 10 +- desktop/src/shared/ui/ViewLoadingFallback.tsx | 75 +-- desktop/src/shared/ui/button.tsx | 11 +- desktop/src/shared/ui/input.tsx | 2 +- desktop/src/shared/ui/sidebar.tsx | 4 +- desktop/src/shared/ui/textarea.tsx | 2 +- desktop/src/shared/ui/toggle.tsx | 5 +- desktop/tests/e2e/messaging.spec.ts | 4 +- desktop/tests/helpers/zoom-shot.mjs | 144 ++++++ 40 files changed, 1498 insertions(+), 1038 deletions(-) create mode 100644 desktop/src/features/channels/ui/RightAuxiliaryPane.tsx delete mode 100644 desktop/src/features/home/ui/HomeChannelActions.tsx create mode 100644 desktop/src/shared/layout/AuxiliaryPanelHeader.tsx create mode 100644 desktop/src/shared/layout/MainInsetContext.tsx create mode 100644 desktop/src/shared/layout/TopChromeInsetHeader.tsx create mode 100644 desktop/src/shared/layout/chromeLayout.ts create mode 100644 desktop/src/shared/layout/observeElementBlockSize.ts create mode 100644 desktop/src/shared/layout/useMeasuredCssVariable.ts create mode 100644 desktop/tests/helpers/zoom-shot.mjs diff --git a/desktop/src/app/AppShell.tsx b/desktop/src/app/AppShell.tsx index 72936d401b..c3e043056d 100644 --- a/desktop/src/app/AppShell.tsx +++ b/desktop/src/app/AppShell.tsx @@ -21,8 +21,8 @@ import { useHideDmMutation, useOpenDmMutation, } from "@/features/channels/hooks"; -import { useMembershipNotifications } from "@/features/channels/useMembershipNotifications"; import { useUnreadChannels } from "@/features/channels/useUnreadChannels"; +import { useMembershipNotifications } from "@/features/channels/useMembershipNotifications"; import { getThreadReference } from "@/features/messages/lib/threading"; import { useThreadFollows } from "@/features/messages/lib/useThreadFollows"; import { @@ -66,6 +66,8 @@ import { useDeferredStartup } from "@/shared/hooks/useDeferredStartup"; import { joinChannel } from "@/shared/api/tauri"; import type { Channel, RelayEvent, SearchHit } from "@/shared/api/types"; import { ChannelNavigationProvider } from "@/shared/context/ChannelNavigationContext"; +import { MainInsetProvider } from "@/shared/layout/MainInsetContext"; +import { chromeCssVarDefaults } from "@/shared/layout/chromeLayout"; import { hasPrimaryShortcutModifier } from "@/shared/lib/platform"; import { useMessageDeepLinks } from "@/shared/useMessageDeepLinks"; import { SidebarInset, SidebarProvider } from "@/shared/ui/sidebar"; @@ -182,6 +184,7 @@ export function AppShell() { React.useState(null); const [isNewDmOpen, setIsNewDmOpen] = React.useState(false); const [isCreateChannelOpen, setIsCreateChannelOpen] = React.useState(false); + const mainInsetRef = React.useRef(null); const location = useLocation(); const queryClient = useQueryClient(); const { @@ -863,9 +866,15 @@ export function AppShell() { onUnstarChannel={unstarChannel} /> - - - + + + + + )} diff --git a/desktop/src/app/AppTopChrome.tsx b/desktop/src/app/AppTopChrome.tsx index bfdeb7d8a8..bfe27655ff 100644 --- a/desktop/src/app/AppTopChrome.tsx +++ b/desktop/src/app/AppTopChrome.tsx @@ -2,7 +2,6 @@ import { ChevronLeft, ChevronRight } from "lucide-react"; import { TopbarSearch } from "@/features/search/ui/TopbarSearch"; import type { Channel, SearchHit } from "@/shared/api/types"; -import { cn } from "@/shared/lib/cn"; import { Button } from "@/shared/ui/button"; import { SidebarTrigger, useSidebar } from "@/shared/ui/sidebar"; @@ -25,8 +24,11 @@ function GlobalTopDivider() { return (