Skip to content
TypeScript

fix(web): keep the terminal toggle clear of the last header action (#13426)

Igor Makowski20012ebd80b0
diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx
index db13c8f21c8..a32c1473cda 100644
--- a/apps/web/src/components/ChatView.tsx
+++ b/apps/web/src/components/ChatView.tsx
@@ -9516,7 +9516,12 @@ export default function ChatView(props: ChatViewProps) {
"flex shrink-0",
panelAnimationsActive &&
"motion-safe:transition-opacity motion-safe:duration-(--panel-animation-duration) motion-safe:ease-out",
- rightPanelOpen ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0",
+ // Closed, the control leaves the flex flow so the cluster is only as wide as the two
+ // toggles the header reserves room for; anchored to the cluster's left edge, it fades
+ // out where it stood rather than over the terminal toggle.
+ rightPanelOpen
+ ? "pointer-events-auto opacity-100"
+ : "pointer-events-none absolute right-full mr-1 opacity-0",
)}
inert={!rightPanelOpen}
>
diff --git a/apps/web/src/components/chat/ChatHeader.tsx b/apps/web/src/components/chat/ChatHeader.tsx
index bbe014ddbd0..92f615538f2 100644
--- a/apps/web/src/components/chat/ChatHeader.tsx
+++ b/apps/web/src/components/chat/ChatHeader.tsx
@@ -492,9 +492,11 @@ export const ChatHeader = memo(function ChatHeader({
data-chat-header-actions
className={cn(
"flex shrink-0 items-center justify-end gap-2 @3xl/header-actions:gap-3",
- // Reserve two panel toggles plus their 4px gaps and 1px edge inset.
- // The page header adds 8px more right padding at sm.
- rightPanelOpen ? "pr-0" : "pr-18.25 sm:pr-14.25",
+ // Reserve two panel toggles (32px, 28px at sm) with their 4px gap and 1px edge inset,
+ // plus the same gap the actions keep between themselves (gap-2, gap-3 at @3xl) so the
+ // terminal toggle does not sit against the last action. The page header adds 8px more
+ // right padding at sm.
+ rightPanelOpen ? "pr-0" : "pr-19.25 sm:pr-15.25 @3xl/header-actions:pr-16.25",
"[[data-panel-animations=true]_&]:motion-safe:transition-[padding-right] [[data-panel-animations=true]_&]:motion-safe:duration-(--panel-animation-duration) [[data-panel-animations=true]_&]:motion-safe:ease-out",
)}
>