mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-01 22:23:07 +00:00
* fix(app): restore cached conversations before reconnecting Give each host one timeline write authority so cache restores, live events and fetched pages publish consistent rows and coverage. Persist a moving 40-entry restart page independently of loaded scrollback, and keep native navigation mounted while startup settings hydrate. * fix(app): recover cache writes after initialization failures Keep accepted writes pending and retry initialization without another UI update. Publish the storage index only after loading succeeds, while queued host identity changes still settle in order. * test(app): wait for sidebar and workspace transitions Viewport intersection and leaving the creation route can precede completed UI transitions. Wait for the layering hit test and selected agent tab before asserting or navigating again. * fix(app): restore provider loading on native clients The native AbortSignal lacks throwIfAborted, so successful provider responses failed before reaching every model selector. Preserve both cancellation boundaries using the supported aborted property and the existing query cancellation error.
54 lines
1.8 KiB
TypeScript
54 lines
1.8 KiB
TypeScript
import type { NativeStackNavigationOptions } from "@react-navigation/native-stack";
|
|
import { Stack } from "expo-router";
|
|
import { isValidElement, type ReactElement, type ReactNode, useCallback, useMemo } from "react";
|
|
import { withUnistyles } from "react-native-unistyles";
|
|
import { AppearanceStyleBoundary } from "@/components/appearance-style-boundary";
|
|
|
|
interface ThemedStackBaseProps {
|
|
backgroundColor: string;
|
|
children?: ReactNode;
|
|
screenOptions?: NativeStackNavigationOptions;
|
|
// Screens whose content is another navigator. That navigator owns its own screens' appearance
|
|
// boundary; wrapping it here would remount it.
|
|
nestedNavigatorScreens?: readonly string[];
|
|
}
|
|
|
|
interface ScreenContent {
|
|
route: { name: string };
|
|
children: ReactNode;
|
|
}
|
|
|
|
function ThemedStackBase({
|
|
backgroundColor,
|
|
children,
|
|
screenOptions,
|
|
nestedNavigatorScreens,
|
|
}: ThemedStackBaseProps) {
|
|
const themedScreenOptions = useMemo<NativeStackNavigationOptions>(
|
|
() => ({
|
|
...screenOptions,
|
|
contentStyle: [{ backgroundColor }, screenOptions?.contentStyle],
|
|
}),
|
|
[backgroundColor, screenOptions],
|
|
);
|
|
// Appearance changes remount each screen's content below the native stack, so the navigator
|
|
// and its screen containers keep their identity. See docs/unistyles.md.
|
|
const screenLayout = useCallback(
|
|
({ route, children: content }: ScreenContent): ReactElement => {
|
|
if (nestedNavigatorScreens?.includes(route.name) && isValidElement(content)) return content;
|
|
return <AppearanceStyleBoundary>{content}</AppearanceStyleBoundary>;
|
|
},
|
|
[nestedNavigatorScreens],
|
|
);
|
|
|
|
return (
|
|
<Stack screenOptions={themedScreenOptions} screenLayout={screenLayout}>
|
|
{children}
|
|
</Stack>
|
|
);
|
|
}
|
|
|
|
export const ThemedStack = withUnistyles(ThemedStackBase, (theme) => ({
|
|
backgroundColor: theme.colors.surface0,
|
|
}));
|