Open History to see the last commit
1import type {
2 EnvironmentProject,
3 EnvironmentThreadShell,
4} from "@t3tools/client-runtime/state/shell";
5import { EnvironmentId, ThreadId, type SidebarProjectGroupingMode } from "@t3tools/contracts";
6import { useAtomValue } from "@effect/atom-react";
7import { useFocusEffect } from "@react-navigation/native";
8import {
9 CommonActions,
10 NavigationContext,
11 NavigationRouteContext,
12 StackActions,
13 useNavigation,
14} from "@react-navigation/native";
15import {
16 createContext,
17 use,
18 useCallback,
19 useEffect,
20 useMemo,
21 useRef,
22 useState,
23 type ReactNode,
24} from "react";
25import { Platform, useWindowDimensions, View } from "react-native";
26import Animated, {
27 useAnimatedStyle,
28 useDerivedValue,
29 useSharedValue,
30 withTiming,
31} from "react-native-reanimated";
32import { AsyncResult } from "effect/unstable/reactivity";
33
34import {
35 deriveFileInspectorPaneLayout,
36 deriveLayout,
37 deriveWorkspacePaneLayout,
38 type FileInspectorPaneLayout,
39 type Layout,
40 type WorkspaceAuxiliaryPaneRole,
41 type WorkspacePaneLayout,
42} from "../../lib/layout";
43import {
44 resolveThreadSelectionNavigationAction,
45 resolveThreadSelectionOverlayState,
46} from "../../lib/adaptive-navigation";
47import { scopedThreadKey } from "../../lib/scopedEntities";
48import { mobilePreferencesAtom } from "../../state/preferences";
49import {
50 DEFAULT_MOBILE_PROJECT_GROUPING_SETTINGS,
51 resolveMobileProjectGroupingSettings,
52} from "../../state/project-grouping";
53import {
54 parseActiveThreadPath,
55 useHardwareKeyboardCommand,
56} from "../keyboard/hardwareKeyboardCommands";
57import { AndroidHomeFabLayout } from "../home/AndroidHomeFab";
58import { HomeListOptionsProvider } from "../home/home-list-options";
59import { ThreadNavigationSidebar } from "../threads/ThreadNavigationSidebar";
60import { WORKSPACE_PANE_TIMING } from "./workspace-pane-animation";
61import { WorkspaceInspectorPane } from "./workspace-inspector-pane";
62import { WorkspaceContentWidthContext } from "./workspace-content-width";
63
64interface AdaptiveWorkspaceContextValue {
65 readonly layout: Layout;
66 readonly panes: WorkspacePaneLayout;
67 readonly fileInspector: FileInspectorPaneLayout;
68 readonly primarySidebarSearchQuery: string;
69 readonly selectThread: (thread: EnvironmentThreadShell) => void;
70 readonly activateAuxiliaryPaneRole: (role: WorkspaceAuxiliaryPaneRole) => () => void;
71 /**
72 * Route screens hand their inspector pane content to the workspace so it
73 * renders BESIDE the navigator (outside the native stack header) instead of
74 * inside the route. Returns a deactivate callback: the pane animates closed
75 * (content kept mounted for the exit transition) unless a newer
76 * registration already took over — stale deactivates never clobber it.
77 * Prefer useRegisterWorkspaceInspector over calling this directly.
78 */
79 readonly registerWorkspaceInspector: (render: () => ReactNode) => () => void;
80 readonly setPrimarySidebarSearchQuery: (query: string) => void;
81 readonly showAuxiliaryPane: (role: WorkspaceAuxiliaryPaneRole) => void;
82 readonly toggleAuxiliaryPane: () => void;
83 readonly togglePrimarySidebar: () => void;
84 readonly setAuxiliaryPaneWidth: (width: number) => void;
85}
86
87const compactLayout = deriveLayout({ width: 0, height: 0 });
88const compactPanes = deriveWorkspacePaneLayout({
89 layout: compactLayout,
90 viewportWidth: 0,
91 primarySidebarPreferredVisible: true,
92 auxiliaryPanePreferredVisible: true,
93});
94const compactFileInspector = deriveFileInspectorPaneLayout({
95 layout: compactLayout,
96 viewportWidth: 0,
97});
98const AdaptiveWorkspaceContext = createContext<AdaptiveWorkspaceContextValue>({
99 layout: compactLayout,
100 panes: compactPanes,
101 fileInspector: compactFileInspector,
102 primarySidebarSearchQuery: "",
103 selectThread: () => undefined,
104 activateAuxiliaryPaneRole: () => () => undefined,
105 registerWorkspaceInspector: () => () => undefined,
106 setPrimarySidebarSearchQuery: () => undefined,
107 showAuxiliaryPane: () => undefined,
108 toggleAuxiliaryPane: () => undefined,
109 togglePrimarySidebar: () => undefined,
110 setAuxiliaryPaneWidth: () => undefined,
111});
112
113export function useAdaptiveWorkspaceLayout(): AdaptiveWorkspaceContextValue {
114 return use(AdaptiveWorkspaceContext);
115}
116
117export function useAdaptiveWorkspacePaneRole(role: WorkspaceAuxiliaryPaneRole) {
118 const { activateAuxiliaryPaneRole } = useAdaptiveWorkspaceLayout();
119
120 useFocusEffect(
121 useCallback(() => activateAuxiliaryPaneRole(role), [activateAuxiliaryPaneRole, role]),
122 );
123}
124
125/**
126 * Register this screen's inspector pane content with the workspace column.
127 *
128 * The column renders BESIDE the navigator — outside any screen — so the
129 * registering screen's navigation and route contexts are captured here and
130 * re-provided around the portal content. Without them, useNavigation/useRoute
131 * inside the pane (e.g. GitOverviewSheet via useThreadSelection) throw
132 * "Couldn't find a route object".
133 *
134 * Registration is FOCUS-scoped, driven by navigation events rather than the
135 * screen's own render cycle: react-native-screens freezes blurred screens, so
136 * a cleanup that depends on the blurred subtree re-rendering never runs and
137 * would leak the pane into the next route. Blur deactivates the pane (it
138 * animates closed, or is replaced seamlessly when the next route registers in
139 * the same commit); focus re-registers it.
140 */
141export function useRegisterWorkspaceInspector(render: (() => ReactNode) | undefined) {
142 const { registerWorkspaceInspector } = useAdaptiveWorkspaceLayout();
143 // Raw context values (not the useNavigation/useRoute wrappers) so the
144 // portal re-provides exactly what this screen sees.
145 const navigation = use(NavigationContext);
146 const route = use(NavigationRouteContext);
147
148 const wrappedRender = useMemo(() => {
149 if (render === undefined) {
150 return undefined;
151 }
152 return () => (
153 <NavigationContext.Provider value={navigation}>
154 <NavigationRouteContext.Provider value={route}>{render()}</NavigationRouteContext.Provider>
155 </NavigationContext.Provider>
156 );
157 }, [navigation, render, route]);
158
159 const wrappedRenderRef = useRef(wrappedRender);
160 wrappedRenderRef.current = wrappedRender;
161 const focusedRef = useRef(false);
162 const deactivateRef = useRef<(() => void) | null>(null);
163
164 const syncRegistration = useCallback(() => {
165 if (!focusedRef.current || wrappedRenderRef.current === undefined) {
166 deactivateRef.current?.();
167 return;
168 }
169 deactivateRef.current = registerWorkspaceInspector(wrappedRenderRef.current);
170 }, [registerWorkspaceInspector]);
171
172 // Focus lifecycle. Blur/focus events fire even when the blurred subtree is
173 // frozen (events are navigation-driven, renders are not).
174 useFocusEffect(
175 useCallback(() => {
176 focusedRef.current = true;
177 syncRegistration();
178 return () => {
179 focusedRef.current = false;
180 syncRegistration();
181 };
182 }, [syncRegistration]),
183 );
184
185 // Content changes while focused re-register in place.
186 useEffect(() => {
187 if (focusedRef.current) {
188 syncRegistration();
189 }
190 }, [syncRegistration, wrappedRender]);
191
192 // Unmount: hand the pane back (owner-guarded, so a route that already
193 // took over is unaffected).
194 useEffect(
195 () => () => {
196 deactivateRef.current?.();
197 deactivateRef.current = null;
198 },
199 [],
200 );
201}
202
203export function AdaptiveWorkspaceLayout(props: {
204 readonly children: ReactNode;
205 readonly pathname: string;
206 readonly workspaceRouteKey: string | undefined;
207}) {
208 const preferencesResult = useAtomValue(mobilePreferencesAtom);
209 if (!AsyncResult.isSuccess(preferencesResult)) {
210 return AsyncResult.isFailure(preferencesResult) ? (
211 <AdaptiveWorkspaceLayoutContent
212 {...props}
213 projectGroupingMode={DEFAULT_MOBILE_PROJECT_GROUPING_SETTINGS.sidebarProjectGroupingMode}
214 />
215 ) : null;
216 }
217 const groupingSettings = resolveMobileProjectGroupingSettings(preferencesResult.value);
218 return (
219 <AdaptiveWorkspaceLayoutContent
220 {...props}
221 projectGroupingMode={groupingSettings.sidebarProjectGroupingMode}
222 />
223 );
224}
225
226function AdaptiveWorkspaceLayoutContent(
227 props: {
228 readonly children: ReactNode;
229 readonly pathname: string;
230 readonly workspaceRouteKey: string | undefined;
231 } & {
232 readonly projectGroupingMode: SidebarProjectGroupingMode;
233 },
234) {
235 const projectGroupingMode = props.projectGroupingMode;
236 const { width, height } = useWindowDimensions();
237 const pathname = props.pathname;
238 const navigation = useNavigation();
239 const activeRoleOwner = useRef<symbol | null>(null);
240 const [primarySidebarPreferredVisible, setPrimarySidebarPreferredVisible] = useState(true);
241 const [supplementaryPanePreferredVisible, setSupplementaryPanePreferredVisible] = useState(true);
242 const [supplementaryPanePreferredWidth, setSupplementaryPanePreferredWidth] = useState<
243 number | null
244 >(null);
245 const [fileInspectorPreferredVisible, setFileInspectorPreferredVisible] = useState(true);
246 const [fileInspectorPreferredWidth, setFileInspectorPreferredWidth] = useState<number | null>(
247 null,
248 );
249 const [primarySidebarSearchQuery, setPrimarySidebarSearchQuery] = useState("");
250 const [focusedAuxiliaryPaneRole, setFocusedAuxiliaryPaneRole] =
251 useState<WorkspaceAuxiliaryPaneRole | null>(null);
252 const baseLayout = useMemo(() => deriveLayout({ width, height }), [height, width]);
253 const layout = baseLayout;
254 // In split layouts the sidebar IS the thread list — it renders on every
255 // route, including Home (which shows an empty-detail pane instead of the
256 // compact list).
257 const shouldRenderPrimarySidebar = layout.usesSplitView;
258 const fileInspector = useMemo(
259 () =>
260 deriveFileInspectorPaneLayout({
261 layout,
262 viewportWidth: width,
263 preferredWidth: fileInspectorPreferredWidth ?? undefined,
264 reservedLeadingWidth:
265 shouldRenderPrimarySidebar && primarySidebarPreferredVisible
266 ? (layout.listPaneWidth ?? 0)
267 : 0,
268 }),
269 [
270 fileInspectorPreferredWidth,
271 layout,
272 primarySidebarPreferredVisible,
273 shouldRenderPrimarySidebar,
274 width,
275 ],
276 );
277 const auxiliaryPaneRole: WorkspaceAuxiliaryPaneRole =
278 focusedAuxiliaryPaneRole ?? (/\/files(?:\/|$)/.test(pathname) ? "inspector" : "supplementary");
279 const auxiliaryPanePreferredVisible =
280 auxiliaryPaneRole === "inspector"
281 ? fileInspectorPreferredVisible
282 : supplementaryPanePreferredVisible;
283 const auxiliaryPanePreferredWidth =
284 auxiliaryPaneRole === "inspector"
285 ? fileInspectorPreferredWidth
286 : supplementaryPanePreferredWidth;
287 const panes = useMemo(
288 () =>
289 deriveWorkspacePaneLayout({
290 layout,
291 viewportWidth: width,
292 primarySidebarPreferredVisible,
293 auxiliaryPanePreferredVisible,
294 auxiliaryPaneRole,
295 auxiliaryPanePreferredWidth: auxiliaryPanePreferredWidth ?? undefined,
296 }),
297 [
298 auxiliaryPanePreferredVisible,
299 auxiliaryPaneRole,
300 auxiliaryPanePreferredWidth,
301 layout,
302 primarySidebarPreferredVisible,
303 width,
304 ],
305 );
306 const activeThread = parseActiveThreadPath(pathname);
307 const environmentId = activeThread?.environmentId ?? null;
308 const threadId = activeThread?.threadId ?? null;
309 const selectedThreadKey = useMemo(() => {
310 if (environmentId === null || threadId === null) {
311 return null;
312 }
313 try {
314 return scopedThreadKey(EnvironmentId.make(environmentId), ThreadId.make(threadId));
315 } catch {
316 return null;
317 }
318 }, [environmentId, threadId]);
319 // Wrapped in an object: bare functions in useState would be treated as
320 // lazy initializers/updaters. `active: false` keeps the outgoing route's
321 // content mounted so the pane can animate closed (or be replaced
322 // seamlessly by the next route's registration in the same commit).
323 const [workspaceInspector, setWorkspaceInspector] = useState<{
324 readonly render: () => ReactNode;
325 readonly active: boolean;
326 } | null>(null);
327 const workspaceInspectorOwner = useRef<symbol | null>(null);
328 const registerWorkspaceInspector = useCallback((render: () => ReactNode) => {
329 const owner = Symbol("workspace-inspector");
330 workspaceInspectorOwner.current = owner;
331 setWorkspaceInspector({ render, active: true });
332
333 return () => {
334 // During a push/replace the outgoing screen deactivates AFTER the
335 // incoming screen registered — only the current owner may deactivate.
336 if (workspaceInspectorOwner.current !== owner) {
337 return;
338 }
339 setWorkspaceInspector((current) => (current === null ? null : { ...current, active: false }));
340 };
341 }, []);
342 // Once the close animation settles, drop the stale content entirely.
343 const handleWorkspaceInspectorClosed = useCallback(() => {
344 setWorkspaceInspector((current) => (current !== null && !current.active ? null : current));
345 }, []);
346 const activateAuxiliaryPaneRole = useCallback((role: WorkspaceAuxiliaryPaneRole) => {
347 const owner = Symbol(role);
348 activeRoleOwner.current = owner;
349 setFocusedAuxiliaryPaneRole(role);
350
351 return () => {
352 if (activeRoleOwner.current !== owner) {
353 return;
354 }
355 activeRoleOwner.current = null;
356 setFocusedAuxiliaryPaneRole(null);
357 };
358 }, []);
359 const togglePrimarySidebar = useCallback(() => {
360 if (!panes.primarySidebarVisible && panes.primarySidebarSuppressedByAuxiliary) {
361 setFileInspectorPreferredVisible(false);
362 setPrimarySidebarPreferredVisible(true);
363 return;
364 }
365 setPrimarySidebarPreferredVisible((current) => !current);
366 }, [panes.primarySidebarSuppressedByAuxiliary, panes.primarySidebarVisible]);
367 const revealPrimarySidebar = useCallback(() => {
368 if (panes.primarySidebarSuppressedByAuxiliary) {
369 setFileInspectorPreferredVisible(false);
370 }
371 setPrimarySidebarPreferredVisible(true);
372 }, [panes.primarySidebarSuppressedByAuxiliary]);
373 const handleToggleSidebarCommand = useCallback(() => {
374 togglePrimarySidebar();
375 return true;
376 }, [togglePrimarySidebar]);
377 useHardwareKeyboardCommand("toggleSidebar", handleToggleSidebarCommand);
378 const showAuxiliaryPane = useCallback((role: WorkspaceAuxiliaryPaneRole) => {
379 if (role === "inspector") {
380 setFocusedAuxiliaryPaneRole("inspector");
381 setFileInspectorPreferredVisible(true);
382 return;
383 }
384 setFocusedAuxiliaryPaneRole("supplementary");
385 setSupplementaryPanePreferredVisible(true);
386 }, []);
387 const handleOpenFilesCommand = useCallback(() => {
388 const activeThread = parseActiveThreadPath(pathname);
389 if (!layout.usesSplitView || !fileInspector.supported || activeThread === null) {
390 return false;
391 }
392 showAuxiliaryPane("inspector");
393 if (/\/files(?:\/|$)/.test(pathname)) {
394 return true;
395 }
396 navigation.navigate("ThreadFiles", activeThread);
397 return true;
398 }, [fileInspector.supported, layout.usesSplitView, pathname, navigation, showAuxiliaryPane]);
399 useHardwareKeyboardCommand("files", handleOpenFilesCommand);
400 const toggleAuxiliaryPane = useCallback(() => {
401 if (auxiliaryPaneRole === "inspector") {
402 setFileInspectorPreferredVisible((current) => !current);
403 return;
404 }
405 setSupplementaryPanePreferredVisible((current) => !current);
406 }, [auxiliaryPaneRole]);
407 const setAuxiliaryPaneWidth = useCallback(
408 (nextWidth: number) => {
409 if (auxiliaryPaneRole === "inspector") {
410 setFileInspectorPreferredWidth(nextWidth);
411 return;
412 }
413 setSupplementaryPanePreferredWidth(nextWidth);
414 },
415 [auxiliaryPaneRole],
416 );
417 const handleOpenSettings = useCallback(() => {
418 navigation.navigate("SettingsSheet", {
419 screen: "SettingsContent",
420 params: { screen: "Settings" },
421 });
422 }, [navigation]);
423
424 const handleStartNewTask = useCallback(() => {
425 navigation.navigate("NewTaskSheet", { screen: "NewTask" });
426 }, [navigation]);
427
428 // Minted here (root stack navigation) so the sidebar pane stays free of
429 // navigation hooks — on iOS it renders inside an independent nav tree.
430 const handleOpenEnvironmentSettings = useCallback(() => {
431 navigation.navigate("SettingsSheet", {
432 screen: "SettingsContent",
433 params: { screen: "SettingsEnvironments" },
434 });
435 }, [navigation]);
436
437 const handleNewThreadOnBranch = useCallback(
438 (thread: EnvironmentThreadShell) => {
439 navigation.navigate("NewTaskSheet", {
440 screen: "NewTaskDraft",
441 params: {
442 environmentId: String(thread.environmentId),
443 projectId: String(thread.projectId),
444 branch: thread.branch,
445 worktreePath: thread.worktreePath,
446 },
447 });
448 },
449 [navigation],
450 );
451
452 const handleNewThreadInProject = useCallback(
453 (project: EnvironmentProject) => {
454 navigation.navigate("NewTaskSheet", {
455 screen: "NewTaskDraft",
456 params: {
457 environmentId: String(project.environmentId),
458 projectId: String(project.id),
459 title: project.title,
460 },
461 });
462 },
463 [navigation],
464 );
465
466 const renderedSidebarWidth = useSharedValue(
467 panes.primarySidebarVisible ? (layout.listPaneWidth ?? 0) : 0,
468 );
469 useEffect(() => {
470 const targetWidth = panes.primarySidebarVisible ? (layout.listPaneWidth ?? 0) : 0;
471 renderedSidebarWidth.value = withTiming(targetWidth, WORKSPACE_PANE_TIMING);
472 }, [layout.listPaneWidth, panes.primarySidebarVisible, renderedSidebarWidth]);
473 const sidebarAnimatedStyle = useAnimatedStyle(() => ({
474 opacity: Math.min(1, renderedSidebarWidth.value / 80),
475 width: renderedSidebarWidth.value,
476 }));
477
478 // Freeze the content pane at its SETTLED width while the side panes
479 // animate. The navigator (native header + markdown feed) lays out ONCE per
480 // pane toggle instead of re-measuring on every animation frame — the
481 // animating columns merely clip/reveal it over a matching background.
482 // Continuously re-wrapping the chat feed was the main source of dropped
483 // frames during sidebar/inspector transitions.
484 const inspectorColumnTargetWidth =
485 workspaceInspector !== null && workspaceInspector.active && panes.auxiliaryPaneVisible
486 ? (panes.auxiliaryPaneWidth ?? 0)
487 : 0;
488 const contentSettledWidth = layout.usesSplitView
489 ? Math.max(0, panes.contentPaneWidth - inspectorColumnTargetWidth)
490 : null;
491 const renderedInspectorWidth = useSharedValue(inspectorColumnTargetWidth);
492 const renderedContentWidth = useDerivedValue(() =>
493 Math.max(0, width - renderedSidebarWidth.value - renderedInspectorWidth.value),
494 );
495
496 const handleSelectThread = useCallback(
497 (thread: EnvironmentThreadShell) => {
498 const params = {
499 environmentId: String(thread.environmentId),
500 threadId: String(thread.id),
501 };
502 const navigationAction = resolveThreadSelectionNavigationAction({
503 usesSplitView: layout.usesSplitView,
504 pathname,
505 });
506 const overlayState = resolveThreadSelectionOverlayState({
507 state: navigation.getState(),
508 workspaceRouteKey: props.workspaceRouteKey,
509 action: navigationAction,
510 params,
511 });
512 if (overlayState !== null) {
513 setFileInspectorPreferredVisible(false);
514 navigation.dispatch(CommonActions.reset(overlayState));
515 return;
516 }
517 if (navigationAction === "set-params") {
518 const nextThreadKey = scopedThreadKey(thread.environmentId, thread.id);
519 if (nextThreadKey === selectedThreadKey) {
520 return;
521 }
522 setFileInspectorPreferredVisible(false);
523 navigation.navigate("Thread", params);
524 return;
525 }
526 if (navigationAction === "replace") {
527 setFileInspectorPreferredVisible(false);
528 navigation.dispatch(StackActions.replace("Thread", params));
529 return;
530 }
531 navigation.navigate("Thread", params);
532 },
533 [layout.usesSplitView, pathname, navigation, selectedThreadKey, props.workspaceRouteKey],
534 );
535
536 const contextValue = useMemo(
537 () => ({
538 layout,
539 panes,
540 fileInspector,
541 primarySidebarSearchQuery,
542 selectThread: handleSelectThread,
543 activateAuxiliaryPaneRole,
544 registerWorkspaceInspector,
545 setPrimarySidebarSearchQuery,
546 showAuxiliaryPane,
547 toggleAuxiliaryPane,
548 togglePrimarySidebar,
549 setAuxiliaryPaneWidth,
550 }),
551 [
552 activateAuxiliaryPaneRole,
553 fileInspector,
554 handleSelectThread,
555 layout,
556 panes,
557 primarySidebarSearchQuery,
558 registerWorkspaceInspector,
559 showAuxiliaryPane,
560 setPrimarySidebarSearchQuery,
561 setAuxiliaryPaneWidth,
562 toggleAuxiliaryPane,
563 togglePrimarySidebar,
564 ],
565 );
566
567 return (
568 <HomeListOptionsProvider projectGroupingMode={projectGroupingMode}>
569 <AdaptiveWorkspaceContext.Provider value={contextValue}>
570 <View testID="adaptive-workspace-layout" className="flex-1 flex-row">
571 {shouldRenderPrimarySidebar && layout.listPaneWidth !== null ? (
572 <Animated.View
573 className="self-stretch overflow-hidden"
574 accessibilityElementsHidden={!panes.primarySidebarVisible}
575 collapsable={false}
576 importantForAccessibility={
577 panes.primarySidebarVisible ? "auto" : "no-hide-descendants"
578 }
579 pointerEvents={panes.primarySidebarVisible ? "auto" : "none"}
580 style={sidebarAnimatedStyle}
581 >
582 <View className="flex-1" style={{ width: layout.listPaneWidth }}>
583 <AndroidHomeFabLayout sidebar onStartNewTask={handleStartNewTask}>
584 <ThreadNavigationSidebar
585 width={layout.listPaneWidth}
586 visible={panes.primarySidebarVisible}
587 onRequestVisibility={revealPrimarySidebar}
588 selectedThreadKey={selectedThreadKey}
589 onOpenSettings={handleOpenSettings}
590 onOpenEnvironmentSettings={handleOpenEnvironmentSettings}
591 onNewThreadInProject={handleNewThreadInProject}
592 onNewThreadOnBranch={handleNewThreadOnBranch}
593 onSelectThread={handleSelectThread}
594 onSearchQueryChange={setPrimarySidebarSearchQuery}
595 searchQuery={primarySidebarSearchQuery}
596 />
597 </AndroidHomeFabLayout>
598 </View>
599 </Animated.View>
600 ) : null}
601 <View
602 className={
603 Platform.OS === "android"
604 ? "flex-1 overflow-hidden bg-header"
605 : "flex-1 overflow-hidden bg-screen"
606 }
607 collapsable={false}
608 >
609 <View
610 collapsable={false}
611 style={
612 contentSettledWidth !== null
613 ? {
614 flex: 1,
615 width: contentSettledWidth,
616 }
617 : { flex: 1 }
618 }
619 >
620 <WorkspaceContentWidthContext
621 value={layout.usesSplitView ? renderedContentWidth : null}
622 >
623 {props.children}
624 </WorkspaceContentWidthContext>
625 </View>
626 </View>
627 <WorkspaceInspectorPane
628 renderedInspectorWidth={renderedInspectorWidth}
629 active={workspaceInspector?.active ?? false}
630 panes={panes}
631 renderInspector={workspaceInspector?.render}
632 setAuxiliaryPaneWidth={setAuxiliaryPaneWidth}
633 onClosed={handleWorkspaceInspectorClosed}
634 />
635 </View>
636 </AdaptiveWorkspaceContext.Provider>
637 </HomeListOptionsProvider>
638 );
639}