mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-07 00:44:49 +00:00
* Upgrade to Expo 57 and unify Explorer across layouts * feat(app): retain Explorer across layout and appearance changes Keep one workspace Explorer host and destination-aware navigation so folding, theme updates and compact sheets preserve the current panel. Scope pull request discovery and timeline demand to active surfaces. * fix(app): keep Explorer resize handles stretched through the dock The shared frame moved the divider into an absolute column, leaving its horizontal handle without height. Restore the row so pointer drags reach it, preserving the existing resize and performance contract. * fix(app): keep Explorer drag widths out of the shared stylesheet Carry the existing inline sizing policy into the shared frame so pointer previews do not accumulate CSS rules. * fix(test): align isolated test runtimes with Expo 57 Hoisted React consumers need the matching DOM renderer at the repository root. Automated Metro processes must not install native DevTools into disposable homes, and development toast overlays must not cover compact actions. Keep Explorer journeys on the shared host and synchronize setup fixtures on daemon output rather than a one-second file-marker window. A delayed real child start reproduces the readiness failure on every platform. * fix(test): await retained shell layout after composer resize The gesture host now stays mounted across breakpoints, so its presence no longer identifies compact layout. Report the current layout on the retained host and synchronize composer journeys with that state. * fix(app): preserve browser interactions in retained workspace hosts Initially disabled gesture hosts still registered pointer and wheel listeners, while hover cards used window positions inside a workspace-local sheet portal. Respect initial gesture enablement and position cards relative to their measured floating host. Keep developer-toast dismissal independent of pointer input and replacement toast visibility so modal, hover, and focus checks retain their input state. * fix(test): share developer toast handling with Electron browser runs The standalone Electron browser runner bypassed the browser fixture, allowing developer errors to cover Settings. Use the same non-pointer dismissal in both runners while retaining their console logs.
73 lines
2.2 KiB
TypeScript
73 lines
2.2 KiB
TypeScript
import { Stack } from "expo-router";
|
|
import {
|
|
isValidElement,
|
|
type ComponentProps,
|
|
type ReactElement,
|
|
type ReactNode,
|
|
useCallback,
|
|
useMemo,
|
|
} from "react";
|
|
import { withUnistyles } from "react-native-unistyles";
|
|
import { AppearanceStyleBoundary } from "@/components/appearance-style-boundary";
|
|
|
|
type NativeStackNavigationOptions = Exclude<
|
|
NonNullable<ComponentProps<typeof Stack>["screenOptions"]>,
|
|
(...args: never[]) => unknown
|
|
>;
|
|
|
|
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[];
|
|
/** Screens with retained lifetime owners update appearance at their own leaves. */
|
|
screenOwnedAppearance?: readonly string[];
|
|
}
|
|
|
|
interface ScreenContent {
|
|
route: { name: string };
|
|
children: ReactNode;
|
|
}
|
|
|
|
function ThemedStackBase({
|
|
backgroundColor,
|
|
children,
|
|
screenOptions,
|
|
nestedNavigatorScreens,
|
|
screenOwnedAppearance,
|
|
}: 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) ||
|
|
screenOwnedAppearance?.includes(route.name)) &&
|
|
isValidElement(content)
|
|
)
|
|
return content;
|
|
return <AppearanceStyleBoundary>{content}</AppearanceStyleBoundary>;
|
|
},
|
|
[nestedNavigatorScreens, screenOwnedAppearance],
|
|
);
|
|
|
|
return (
|
|
<Stack screenOptions={themedScreenOptions} screenLayout={screenLayout}>
|
|
{children}
|
|
</Stack>
|
|
);
|
|
}
|
|
|
|
export const ThemedStack = withUnistyles(ThemedStackBase, (theme) => ({
|
|
backgroundColor: theme.colors.surface0,
|
|
}));
|