Skip to content

Commit a1ef380

Browse files
Fix diff panel titlebar padding
1 parent 2b95458 commit a1ef380

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎apps/web/src/components/ChatView.tsx‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,15 @@ type ChatViewProps =
313313
environmentId: EnvironmentId;
314314
threadId: ThreadId;
315315
onDiffPanelOpen?: () => void;
316+
reserveTitleBarControlInset?: boolean;
316317
routeKind: "server";
317318
draftId?: never;
318319
}
319320
| {
320321
environmentId: EnvironmentId;
321322
threadId: ThreadId;
322323
onDiffPanelOpen?: () => void;
324+
reserveTitleBarControlInset?: boolean;
323325
routeKind: "draft";
324326
draftId: DraftId;
325327
};
@@ -573,7 +575,13 @@ const PersistentThreadTerminalDrawer = memo(function PersistentThreadTerminalDra
573575
});
574576

575577
export default function ChatView(props: ChatViewProps) {
576-
const { environmentId, threadId, routeKind, onDiffPanelOpen } = props;
578+
const {
579+
environmentId,
580+
threadId,
581+
routeKind,
582+
onDiffPanelOpen,
583+
reserveTitleBarControlInset = true,
584+
} = props;
577585
const draftId = routeKind === "draft" ? props.draftId : null;
578586
const routeThreadRef = useMemo(
579587
() => scopeThreadRef(environmentId, threadId),
@@ -3295,7 +3303,11 @@ export default function ChatView(props: ChatViewProps) {
32953303
className={cn(
32963304
"border-b border-border px-3 sm:px-5",
32973305
isElectron
3298-
? "drag-region flex h-[52px] items-center wco:h-[env(titlebar-area-height)] wco:pr-[calc(100vw-env(titlebar-area-width)-env(titlebar-area-x)+1em)]"
3306+
? cn(
3307+
"drag-region flex h-[52px] items-center wco:h-[env(titlebar-area-height)]",
3308+
reserveTitleBarControlInset &&
3309+
"wco:pr-[calc(100vw-env(titlebar-area-width)-env(titlebar-area-x)+1em)]",
3310+
)
32993311
: "py-2 sm:py-3",
33003312
)}
33013313
>

‎apps/web/src/index.css‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@import "tailwindcss";
22

33
@custom-variant dark (&:is(.dark, .dark *));
4+
/* Window Controls Overlay: active when Electron exposes native titlebar control geometry. */
45
@custom-variant wco (&:is(.wco, .wco *));
56

67
@theme inline {

‎apps/web/src/routes/_chat.$environmentId.$threadId.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ function ChatThreadRouteView() {
269269
environmentId={threadRef.environmentId}
270270
threadId={threadRef.threadId}
271271
onDiffPanelOpen={markDiffOpened}
272+
reserveTitleBarControlInset={!diffOpen}
272273
routeKind="server"
273274
/>
274275
</SidebarInset>

0 commit comments

Comments
 (0)