Open History to see the last commit
1import { scopeProjectRef, scopeThreadRef } from "@t3tools/client-runtime/environment";
2import type { EnvironmentId, ThreadId } from "@t3tools/contracts";
3import {
4 ChevronDownIcon,
5 FolderGit2Icon,
6 FolderGitIcon,
7 FolderIcon,
8 HistoryIcon,
9} from "lucide-react";
10import { memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
11
12import { useComposerDraftStore, type DraftId } from "../composerDraftStore";
13import { EnvironmentMachineIcon } from "./EnvironmentMachineIcon";
14import { useProject, useThread, useThreadShellsForProjectRefs } from "../state/entities";
15import {
16 type EnvMode,
17 type EnvironmentOption,
18 resolveContextStripLabelsCompact,
19 resolveCurrentWorkspaceLabel,
20 resolveEnvModeLabel,
21 resolveEffectiveEnvMode,
22 resolveLockedWorkspaceLabel,
23 resolvePreviousWorktreeLabel,
24 resolvePreviousWorktreeSeed,
25 shouldShowEnvironmentIndicator,
26} from "./BranchToolbar.logic";
27import { BranchToolbarBranchSelector } from "./BranchToolbarBranchSelector";
28import { BranchToolbarEnvironmentSelector } from "./BranchToolbarEnvironmentSelector";
29import { BranchToolbarEnvModeSelector } from "./BranchToolbarEnvModeSelector";
30import { Button } from "./ui/button";
31import {
32 Menu,
33 MenuGroup,
34 MenuGroupLabel,
35 MenuPopup,
36 MenuRadioGroup,
37 MenuRadioItem,
38 MenuSeparator,
39 MenuTrigger,
40} from "./ui/menu";
41import { Separator } from "./ui/separator";
42import { ComposerSurface } from "./chat/ComposerSurface";
43import { composerFloatingLayerProps } from "./chat/composerEventScope";
44import { measureRestingComposerControls } from "./chat/restingComposerControlsMeasurement";
45import { resolveRestingComposerControlsNaturalWidth } from "./composerFooterLayout";
46import { cn } from "~/lib/utils";
47
48interface BranchToolbarProps {
49 environmentId: EnvironmentId;
50 threadId: ThreadId;
51 showGitControls: boolean;
52 draftId?: DraftId;
53 onEnvModeChange: (mode: EnvMode) => void;
54 effectiveEnvModeOverride?: EnvMode;
55 activeThreadBranchOverride?: string | null;
56 onActiveThreadBranchOverrideChange?: (branch: string | null) => void;
57 startFromOrigin: boolean;
58 onStartFromOriginChange: (startFromOrigin: boolean) => void;
59 envLocked: boolean;
60 onCheckoutPullRequestRequest?: (reference: string) => void;
61 onComposerFocusRequest?: () => void;
62 availableEnvironments?: readonly EnvironmentOption[];
63 onEnvironmentChange?: (environmentId: EnvironmentId) => void;
64 composerControlsHostRef?: (element: HTMLDivElement | null) => void;
65 contextStripVisible?: boolean;
66}
67
68interface MobileRunContextSelectorProps {
69 envLocked: boolean;
70 envModeLocked: boolean;
71 environmentId: EnvironmentId;
72 availableEnvironments: readonly EnvironmentOption[] | undefined;
73 showEnvironmentPicker: boolean;
74 showEnvironmentIndicator: boolean;
75 onEnvironmentChange: ((environmentId: EnvironmentId) => void) | undefined;
76 effectiveEnvMode: EnvMode;
77 activeWorktreePath: string | null;
78 onEnvModeChange: (mode: EnvMode) => void;
79 previousWorktreeLabel: string | null;
80 onUsePreviousWorktree: () => void;
81}
82
83const MobileRunContextSelector = memo(function MobileRunContextSelector({
84 envLocked,
85 envModeLocked,
86 environmentId,
87 availableEnvironments,
88 showEnvironmentPicker,
89 showEnvironmentIndicator,
90 onEnvironmentChange,
91 effectiveEnvMode,
92 activeWorktreePath,
93 onEnvModeChange,
94 previousWorktreeLabel,
95 onUsePreviousWorktree,
96}: MobileRunContextSelectorProps) {
97 const activeEnvironment = useMemo(
98 () => availableEnvironments?.find((env) => env.environmentId === environmentId) ?? null,
99 [availableEnvironments, environmentId],
100 );
101 const WorkspaceIcon =
102 effectiveEnvMode === "worktree"
103 ? FolderGit2Icon
104 : activeWorktreePath
105 ? FolderGitIcon
106 : FolderIcon;
107 const workspaceLabel = envModeLocked
108 ? resolveLockedWorkspaceLabel(activeWorktreePath)
109 : effectiveEnvMode === "worktree"
110 ? resolveEnvModeLabel("worktree")
111 : resolveCurrentWorkspaceLabel(activeWorktreePath);
112 const isLocked = envLocked || envModeLocked;
113 const icon = showEnvironmentIndicator ? (
114 // Button's base styles apply `-mx-0.5` to descendant SVGs, which eats 4px
115 // out of whatever gap we set. mx-0! cancels that so gap-0.5 reads as 2px.
116 <span className="inline-flex shrink-0 items-center gap-0.5">
117 <EnvironmentMachineIcon
118 kind={activeEnvironment?.machine ?? "server"}
119 className="size-3 shrink-0 mx-0!"
120 />
121 <WorkspaceIcon className="size-3 shrink-0 mx-0!" />
122 </span>
123 ) : (
124 <WorkspaceIcon className="size-3 shrink-0" />
125 );
126 const triggerContent = (
127 <>
128 {icon}
129 <span
130 data-composer-label
131 className="min-w-0 max-w-[240px] group-data-[compact]/composer-context:max-w-0"
132 >
133 <span
134 data-composer-label-motion
135 className="block w-full min-w-0 max-w-[240px] origin-left truncate transition-[opacity,transform] duration-180 ease-[cubic-bezier(0.32,0.72,0,1)] group-data-[compact]/composer-context:[transform:translateX(-0.25rem)_scaleX(0.95)] group-data-[compact]/composer-context:opacity-0 motion-reduce:transform-none motion-reduce:transition-opacity"
136 >
137 {showEnvironmentIndicator ? (activeEnvironment?.label ?? "Run on") : workspaceLabel}
138 </span>
139 </span>
140 </>
141 );
142
143 if (isLocked) {
144 return (
145 <span
146 className="inline-flex h-7 min-w-0 max-w-[48%] flex-initial items-center justify-start gap-1 rounded-md border border-transparent px-[calc(--spacing(2)-1px)] font-normal text-muted-foreground/70 text-xs sm:h-6"
147 data-composer-context-control
148 >
149 {triggerContent}
150 </span>
151 );
152 }
153
154 return (
155 <Menu>
156 <MenuTrigger
157 render={<Button variant="ghost" size="xs" />}
158 className="min-w-0 max-w-[48%] flex-initial justify-start font-normal text-muted-foreground/70 text-xs! hover:text-foreground/80"
159 data-composer-context-control
160 >
161 {triggerContent}
162 <ChevronDownIcon className="size-3 shrink-0 opacity-50" />
163 </MenuTrigger>
164 <MenuPopup align="start" side="top" className="w-64" {...composerFloatingLayerProps}>
165 {showEnvironmentPicker && availableEnvironments && onEnvironmentChange ? (
166 <>
167 <MenuGroup>
168 <MenuGroupLabel>Run on</MenuGroupLabel>
169 <MenuRadioGroup
170 value={environmentId}
171 onValueChange={(value) => onEnvironmentChange(value as EnvironmentId)}
172 >
173 {availableEnvironments.map((env) => (
174 <MenuRadioItem
175 key={env.environmentId}
176 disabled={envLocked}
177 value={env.environmentId}
178 >
179 <span className="flex min-w-0 items-center gap-1.5">
180 <EnvironmentMachineIcon kind={env.machine} className="size-3" />
181 <span className="min-w-0 truncate">{env.label}</span>
182 </span>
183 </MenuRadioItem>
184 ))}
185 </MenuRadioGroup>
186 </MenuGroup>
187 <MenuSeparator />
188 </>
189 ) : null}
190 <MenuGroup>
191 <MenuGroupLabel>Workspace</MenuGroupLabel>
192 <MenuRadioGroup
193 value={effectiveEnvMode}
194 onValueChange={(value) => {
195 if (value === "previous-worktree") {
196 onUsePreviousWorktree();
197 return;
198 }
199 onEnvModeChange(value as EnvMode);
200 }}
201 >
202 <MenuRadioItem disabled={envModeLocked} value="local">
203 <span className="flex min-w-0 items-center gap-1.5">
204 {activeWorktreePath ? (
205 <FolderGitIcon className="size-3" />
206 ) : (
207 <FolderIcon className="size-3" />
208 )}
209 <span className="min-w-0 truncate">
210 {resolveCurrentWorkspaceLabel(activeWorktreePath)}
211 </span>
212 </span>
213 </MenuRadioItem>
214 <MenuRadioItem disabled={envModeLocked} value="worktree">
215 <span className="flex min-w-0 items-center gap-1.5">
216 <FolderGit2Icon className="size-3" />
217 <span className="min-w-0 truncate">{resolveEnvModeLabel("worktree")}</span>
218 </span>
219 </MenuRadioItem>
220 {previousWorktreeLabel ? (
221 <MenuRadioItem disabled={envModeLocked} value="previous-worktree">
222 <span className="flex min-w-0 items-center gap-1.5">
223 <HistoryIcon className="size-3" />
224 <span className="min-w-0 truncate">{previousWorktreeLabel}</span>
225 </span>
226 </MenuRadioItem>
227 ) : null}
228 </MenuRadioGroup>
229 </MenuGroup>
230 </MenuPopup>
231 </Menu>
232 );
233});
234
235/**
236 * Collapse the strip's labels to icons only when the text no longer fits.
237 *
238 * Hidden labels stay measurable because their inner text keeps its natural
239 * width while the outer layout box collapses. This lets every pass recompute
240 * the expanded width without remembered values that could go stale or latch
241 * the strip compact. A small hysteresis keeps the boundary from flapping.
242 */
243const COMPOSER_CONTEXT_MOTION_DURATION_MS = 180;
244const COMPOSER_CONTEXT_MOTION_EASING = "cubic-bezier(0.32, 0.72, 0, 1)";
245const COMPOSER_CONTEXT_CONTROL_SELECTOR = "[data-composer-context-control]";
246
247function useLabelsOverflow(element: HTMLDivElement | null): boolean {
248 const [overflows, setOverflows] = useState(false);
249 const pendingControlRectsRef = useRef<Map<HTMLElement, DOMRect> | null>(null);
250 const controlAnimationsRef = useRef(new Map<HTMLElement, Animation>());
251 // A render-synced mirror instead of useEffectEvent: the compiler memoizes
252 // the event callback, which left observers reading the first render's null
253 // element forever.
254 const stateRef = useRef({ element, overflows });
255 stateRef.current = { element, overflows };
256
257 const measure = useCallback(() => {
258 const { element: current, overflows: compact } = stateRef.current;
259 if (!current) return;
260 const available = current.clientWidth;
261 if (available === 0) return;
262 // flex-1 stretches the groups to fill the strip, so their own boxes always
263 // measure "full". Sum the laid-out content instead, skipping hidden form
264 // artifacts and other out-of-flow nodes.
265 const contentWidth = (parent: Element): number => {
266 const gap = Number.parseFloat(getComputedStyle(parent).columnGap) || 0;
267 let width = 0;
268 let counted = 0;
269 for (const child of parent.children) {
270 if (!(child instanceof HTMLElement)) continue;
271 if (child.offsetWidth === 0) continue;
272 const style = getComputedStyle(child);
273 const position = style.position;
274 if (position === "absolute" || position === "fixed") continue;
275 width +=
276 child.offsetWidth +
277 (Number.parseFloat(style.marginInlineStart) || 0) +
278 (Number.parseFloat(style.marginInlineEnd) || 0);
279 counted += 1;
280 }
281 return width + gap * Math.max(0, counted - 1);
282 };
283 const stripGap = Number.parseFloat(getComputedStyle(current).columnGap) || 0;
284 let needed = 0;
285 let groups = 0;
286 for (const child of current.children) {
287 if (!(child instanceof HTMLElement)) continue;
288 // The host itself flexes into all remaining room. Reserve the natural
289 // width of the controls inside it, blocks in overflow included, so Git
290 // labels compact before squeezing out the model picker. Reserving only
291 // the visible controls would let the labels expand into room the
292 // composer just freed, shrink the host, and hide the controls again.
293 const hostedControls = child.matches('[data-chat-resting-composer-controls-host="true"]')
294 ? child.querySelector<HTMLElement>('[data-chat-composer-resting-controls="true"]')
295 : null;
296 const hostedMeasurement = hostedControls
297 ? measureRestingComposerControls(hostedControls)
298 : null;
299 const width = hostedMeasurement
300 ? resolveRestingComposerControlsNaturalWidth(hostedMeasurement)
301 : contentWidth(hostedControls ?? child);
302 if (width <= 1) continue;
303 groups += 1;
304 needed += width;
305 }
306 needed += stripGap * Math.max(0, groups - 1);
307 for (const label of current.querySelectorAll<HTMLElement>("[data-composer-label]")) {
308 // The clipping can happen below the marker (SelectValue truncates
309 // internally), where the outer span's scrollWidth matches its clipped
310 // box. The text's real width is the largest scrollWidth in the subtree.
311 let textWidth = label.scrollWidth;
312 for (const inner of label.querySelectorAll<HTMLElement>("*")) {
313 textWidth = Math.max(textWidth, inner.scrollWidth);
314 }
315 if (compact) {
316 // Compact: the label is squeezed to zero width but keeps reporting
317 // the full width it would need when expanded.
318 needed += textWidth;
319 } else {
320 // Expanded: the label is in flow; only the clipped remainder is
321 // missing from the content sum.
322 needed += Math.max(0, textWidth - label.clientWidth);
323 }
324 }
325 const nextOverflows = resolveContextStripLabelsCompact({
326 compact,
327 neededWidth: needed,
328 availableWidth: available,
329 });
330 if (nextOverflows !== compact) {
331 pendingControlRectsRef.current = new Map(
332 Array.from(current.querySelectorAll<HTMLElement>(COMPOSER_CONTEXT_CONTROL_SELECTOR)).map(
333 (control) => [control, control.getBoundingClientRect()],
334 ),
335 );
336 }
337 setOverflows(nextOverflows);
338 }, []);
339
340 useLayoutEffect(() => {
341 const previousRects = pendingControlRectsRef.current;
342 if (!previousRects) return;
343 pendingControlRectsRef.current = null;
344
345 for (const animation of controlAnimationsRef.current.values()) {
346 animation.cancel();
347 }
348 controlAnimationsRef.current.clear();
349
350 if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
351
352 for (const [control, previousRect] of previousRects) {
353 if (!control.isConnected) continue;
354 const nextRect = control.getBoundingClientRect();
355 const deltaX = previousRect.left - nextRect.left;
356 const deltaY = previousRect.top - nextRect.top;
357 if (Math.abs(deltaX) < 0.5 && Math.abs(deltaY) < 0.5) continue;
358
359 const animation = control.animate(
360 [
361 { transform: `translate3d(${deltaX}px, ${deltaY}px, 0)` },
362 { transform: "translate3d(0, 0, 0)" },
363 ],
364 {
365 duration: COMPOSER_CONTEXT_MOTION_DURATION_MS,
366 easing: COMPOSER_CONTEXT_MOTION_EASING,
367 fill: "backwards",
368 },
369 );
370 controlAnimationsRef.current.set(control, animation);
371 animation.addEventListener(
372 "finish",
373 () => {
374 if (controlAnimationsRef.current.get(control) === animation) {
375 controlAnimationsRef.current.delete(control);
376 }
377 },
378 { once: true },
379 );
380 }
381 }, [overflows]);
382
383 useEffect(
384 () => () => {
385 for (const animation of controlAnimationsRef.current.values()) {
386 animation.cancel();
387 }
388 },
389 [],
390 );
391
392 // Label widths can change without the strip box moving (font family or
393 // size preferences), so re-measure on every render as well as on resize
394 // and font loads.
395 useLayoutEffect(() => {
396 measure();
397 });
398
399 useEffect(() => {
400 if (!element) return;
401 const observer = new ResizeObserver(measure);
402 observer.observe(element);
403 document.fonts.addEventListener("loadingdone", measure);
404 return () => {
405 observer.disconnect();
406 document.fonts.removeEventListener("loadingdone", measure);
407 };
408 }, [element, measure]);
409
410 return overflows;
411}
412
413export const BranchToolbar = memo(function BranchToolbar({
414 environmentId,
415 threadId,
416 showGitControls,
417 draftId,
418 onEnvModeChange,
419 effectiveEnvModeOverride,
420 activeThreadBranchOverride,
421 onActiveThreadBranchOverrideChange,
422 startFromOrigin,
423 onStartFromOriginChange,
424 envLocked,
425 onCheckoutPullRequestRequest,
426 onComposerFocusRequest,
427 availableEnvironments,
428 onEnvironmentChange,
429 composerControlsHostRef,
430 contextStripVisible = true,
431}: BranchToolbarProps) {
432 const threadRef = useMemo(
433 () => scopeThreadRef(environmentId, threadId),
434 [environmentId, threadId],
435 );
436 const draftThread = useComposerDraftStore((store) =>
437 draftId ? store.getDraftSession(draftId) : store.getDraftThreadByRef(threadRef),
438 );
439 const serverThread = useThread(threadRef, { waitForShell: draftThread !== null });
440 const setDraftThreadContext = useComposerDraftStore((store) => store.setDraftThreadContext);
441 const activeProjectRef = serverThread
442 ? scopeProjectRef(serverThread.environmentId, serverThread.projectId)
443 : draftThread
444 ? scopeProjectRef(draftThread.environmentId, draftThread.projectId)
445 : null;
446 const activeProject = useProject(activeProjectRef);
447 const hasActiveThread = serverThread !== null || draftThread !== null;
448 const activeWorktreePath = serverThread?.worktreePath ?? draftThread?.worktreePath ?? null;
449 const effectiveEnvMode =
450 effectiveEnvModeOverride ??
451 resolveEffectiveEnvMode({
452 activeWorktreePath,
453 hasServerThread: serverThread !== null,
454 draftThreadEnvMode: draftThread?.envMode,
455 });
456 const envModeLocked = envLocked || (serverThread !== null && activeWorktreePath !== null);
457
458 // "Previous worktree" hops a draft into the most recently active worktree
459 // of this project — the "keep going where I just was" follow-up flow. Only
460 // drafts can hop; started server threads have their workspace pinned.
461 const canUsePreviousWorktree = draftThread !== null && serverThread === null && !envModeLocked;
462 const projectRefsForWorktreeLookup = useMemo(
463 () => (canUsePreviousWorktree && activeProjectRef ? [activeProjectRef] : []),
464 [canUsePreviousWorktree, activeProjectRef],
465 );
466 const projectThreads = useThreadShellsForProjectRefs(projectRefsForWorktreeLookup);
467 const previousWorktreeSeed = useMemo(
468 () =>
469 canUsePreviousWorktree
470 ? resolvePreviousWorktreeSeed({
471 threads: projectThreads,
472 currentWorktreePath: activeWorktreePath,
473 })
474 : null,
475 [activeWorktreePath, canUsePreviousWorktree, projectThreads],
476 );
477 const previousWorktreeLabel = previousWorktreeSeed
478 ? resolvePreviousWorktreeLabel(previousWorktreeSeed)
479 : null;
480 const onUsePreviousWorktree = useCallback(() => {
481 if (!previousWorktreeSeed || !activeProjectRef) return;
482 // Same shape the branch selector writes when picking a branch that
483 // already lives in a worktree: point the draft at the existing tree.
484 setDraftThreadContext(draftId ?? threadRef, {
485 branch: previousWorktreeSeed.branch,
486 worktreePath: previousWorktreeSeed.worktreePath,
487 envMode: "worktree",
488 projectRef: activeProjectRef,
489 });
490 }, [activeProjectRef, draftId, previousWorktreeSeed, setDraftThreadContext, threadRef]);
491
492 const showEnvironmentPicker = Boolean(
493 availableEnvironments && availableEnvironments.length > 1 && onEnvironmentChange,
494 );
495 const activeEnvironmentOption =
496 availableEnvironments?.find((env) => env.environmentId === environmentId) ?? null;
497 const showEnvironmentIndicator = shouldShowEnvironmentIndicator({
498 activeEnvironment: activeEnvironmentOption,
499 canPickEnvironment: showEnvironmentPicker,
500 });
501 const [stripElement, setStripElement] = useState<HTMLDivElement | null>(null);
502 const labelsOverflow = useLabelsOverflow(stripElement);
503
504 if (!hasActiveThread || !activeProject) return null;
505
506 return (
507 <ComposerSurface.ContextStrip
508 ref={setStripElement}
509 data-compact={labelsOverflow ? "" : undefined}
510 className={cn(
511 "gap-1 text-xs font-normal text-muted-foreground/70",
512 // A non-Git strip with no visible composer controls should occupy no
513 // space, but its host must retain a prospective width so controls can
514 // become visible again when the chat view grows.
515 !contextStripVisible && "pointer-events-none invisible absolute inset-x-0 top-full",
516 )}
517 >
518 {showGitControls ? (
519 <div className="contents @3xl/composer-surface:hidden">
520 <MobileRunContextSelector
521 envLocked={envLocked}
522 envModeLocked={envModeLocked}
523 environmentId={environmentId}
524 availableEnvironments={availableEnvironments}
525 showEnvironmentPicker={showEnvironmentPicker}
526 showEnvironmentIndicator={showEnvironmentIndicator}
527 onEnvironmentChange={onEnvironmentChange}
528 effectiveEnvMode={effectiveEnvMode}
529 activeWorktreePath={activeWorktreePath}
530 onEnvModeChange={onEnvModeChange}
531 previousWorktreeLabel={previousWorktreeLabel}
532 onUsePreviousWorktree={onUsePreviousWorktree}
533 />
534 </div>
535 ) : null}
536 {showGitControls || showEnvironmentIndicator ? (
537 <div
538 className={cn(
539 "min-h-7 min-w-10 items-center gap-1 sm:min-h-6",
540 showGitControls ? "hidden @3xl/composer-surface:flex" : "flex",
541 composerControlsHostRef ? "shrink" : "flex-1",
542 )}
543 >
544 {showEnvironmentIndicator && availableEnvironments && (
545 <>
546 <BranchToolbarEnvironmentSelector
547 envLocked={envLocked}
548 environmentId={environmentId}
549 availableEnvironments={availableEnvironments}
550 {...(showEnvironmentPicker && onEnvironmentChange ? { onEnvironmentChange } : {})}
551 />
552 {showGitControls ? (
553 <Separator
554 orientation="vertical"
555 className="mx-0.5 h-3.5!"
556 data-composer-context-control
557 />
558 ) : null}
559 </>
560 )}
561 {showGitControls ? (
562 <BranchToolbarEnvModeSelector
563 envLocked={envModeLocked}
564 effectiveEnvMode={effectiveEnvMode}
565 activeWorktreePath={activeWorktreePath}
566 onEnvModeChange={onEnvModeChange}
567 previousWorktreeLabel={previousWorktreeLabel}
568 onUsePreviousWorktree={onUsePreviousWorktree}
569 />
570 ) : null}
571 </div>
572 ) : null}
573
574 {composerControlsHostRef ? (
575 // The host takes whatever the workspace and branch controls leave
576 // over, in both strip layouts, so a collapsed composer can show its
577 // model and mode controls wherever they fit.
578 <div
579 ref={composerControlsHostRef}
580 data-composer-context-control
581 data-chat-resting-composer-controls-host="true"
582 className="flex min-w-0 flex-1 items-center justify-start overflow-x-clip overflow-y-visible"
583 />
584 ) : null}
585
586 {showGitControls ? (
587 <BranchToolbarBranchSelector
588 className="min-w-0 flex-initial justify-end @3xl/composer-surface:ml-auto"
589 environmentId={environmentId}
590 threadId={threadId}
591 {...(draftId ? { draftId } : {})}
592 envLocked={envLocked}
593 {...(effectiveEnvModeOverride ? { effectiveEnvModeOverride } : {})}
594 {...(activeThreadBranchOverride !== undefined ? { activeThreadBranchOverride } : {})}
595 {...(onActiveThreadBranchOverrideChange ? { onActiveThreadBranchOverrideChange } : {})}
596 startFromOrigin={startFromOrigin}
597 onStartFromOriginChange={onStartFromOriginChange}
598 {...(onCheckoutPullRequestRequest ? { onCheckoutPullRequestRequest } : {})}
599 {...(onComposerFocusRequest ? { onComposerFocusRequest } : {})}
600 />
601 ) : null}
602 </ComposerSurface.ContextStrip>
603 );
604});