Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ jobs:
- id: dependencies
run: pnpm run quality:install
- run: pnpm run typecheck
- name: Check Expo SDK compatibility
- name: Check pinned Expo SDK compatibility
if: ${{ !cancelled() && steps.dependencies.outcome == 'success' }}
run: pnpm run doctor:expo
- name: Report latest Expo upgrade recommendations (advisory)
if: ${{ !cancelled() && steps.dependencies.outcome == 'success' }}
continue-on-error: true
run: pnpm run doctor:expo:latest
- name: Score the full source and audit every lockfile
id: scores
if: ${{ !cancelled() && steps.dependencies.outcome == 'success' }}
Expand Down
17 changes: 17 additions & 0 deletions docs/dependency-patches.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ The SDK 58 age exceptions admit reviewed Expo releases and their required
platform tooling. Publisher-trust checks and the install-script allowlist remain
enforced.

## Expo compatibility and upgrade recommendations

`pnpm run doctor:expo` checks installed direct dependencies (including development
packages) against `expo/bundledNativeModules.json` from the exact pinned Expo
release, then runs the remaining Expo Doctor checks online. Missing packages,
incompatible versions and other Doctor failures still block CI. The wrapper uses
the pinned Expo CLI's SemVer implementation and replaces only Doctor's moving
remote version recommendation check; it does not use package exclusions.

`pnpm run doctor:expo:latest` reports Expo's current remote recommendations.
CI displays this as an advisory step, so a newly published patch cannot invalidate
an otherwise compatible frozen build. Review these recommendations during
upgrades, after the seven-day waiting period (or an explicit reviewed exception).
Security audits remain blocking regardless of release age. The pinned map proves
compatibility with that SDK release, not that the release is the newest or free
of vulnerabilities. Updating Expo also updates the compatibility baseline.

## Active package patches

| Package | Change and boundary | Owning checks |
Expand Down
2 changes: 1 addition & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pnpm run export:android
pnpm run export:ios
```

`check` runs TypeScript, Expo Doctor, React Doctor, aislop and dependency audits
`check` runs TypeScript, pinned-SDK compatibility and Expo Doctor, React Doctor, aislop and dependency audits
for the root, runtime and quality-tool lockfiles. High/critical audit findings
block the gate. A successful export is a JavaScript bundle, not an installable
native build. Report each result and any blocked or skipped stage separately.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1227,13 +1227,13 @@
],
"mainJavaScriptProfile": {
"platform": "android",
"reviewedMetroBundleSha256": "acdb49ef24e52336cd6979940684197729aa0cb9f2722d9217b9c243ef94472e",
"sourceMapSha256": "9ad6017a90de4a516fdc19d52491b15704d519c6bcb0af687c53724f77c9cf07",
"reviewedMetroBundleSha256": "5114c8398756bb5eb45f92dc57df5ccb4fc356ed604c5f5ee8cb06be3fe9ddc3",
"sourceMapSha256": "a7ec2ac7b5ff7c0834777d80a33b5d49563a33b34ba59ee2ea4530fa5c4432f2",
"packageIdentityCount": 58,
"suppliedOriginalFileCount": 55,
"sharedOriginalPackageCount": 4,
"dependencyInputs": {
"package.json": "2753ee15120edfbd724967bb75d3ffa66ff22f9d098a0f23a48197596ff571d3",
"package.json": "4b3b3fbcc90577e69e4ee99776517a5dbd405c4c77f8e719f3eb47d4db458966",
"pnpm-lock.yaml": "85fbc48ad55786262c490044e826b6282e45dadd459ca692bb6ca4db3a283b6c",
"node_modules/.pnpm/@expo+cli@58.1.20_@expo+dom-webview@58.0.2_expo-constants@58.0.16_expo@58.0.24_react-na_9e33ccae367f67a78635be2cb8b90a55/node_modules/@expo/cli/package.json": "98f35dbe2ac27fd7ee90905352ab6215fc157f80094f6e7c2bce87ebd1e85c39",
"node_modules/.pnpm/@react-native+js-polyfills@0.88.1/node_modules/@react-native/js-polyfills/package.json": "4b540e4c8ea9920faeefdaa16a7da7dd49ff5521fd168153ef52aa5e975f837b",
Expand Down
6 changes: 3 additions & 3 deletions modules/napplet-host/ios/Resources/notices/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1371,13 +1371,13 @@
],
"mainJavaScriptProfile": {
"platform": "ios",
"reviewedMetroBundleSha256": "2a7d2fdee0be19b8dc1ba588e3a09c43e6aba9fc746c34a5f379dedd5b59d02e",
"sourceMapSha256": "a18748605a592f16e48701b1e5b33fac8206ea55f3d8705a5419f19df036359c",
"reviewedMetroBundleSha256": "271894e37a2b9fb3d5ec2d67123b1211e4b6eba4d1595c70da072134ef5464f0",
"sourceMapSha256": "988096e39a789188e565d573855c2c31d4d10bed799476238a422a0a9abc216e",
"packageIdentityCount": 58,
"suppliedOriginalFileCount": 55,
"sharedOriginalPackageCount": 4,
"dependencyInputs": {
"package.json": "2753ee15120edfbd724967bb75d3ffa66ff22f9d098a0f23a48197596ff571d3",
"package.json": "4b3b3fbcc90577e69e4ee99776517a5dbd405c4c77f8e719f3eb47d4db458966",
"pnpm-lock.yaml": "85fbc48ad55786262c490044e826b6282e45dadd459ca692bb6ca4db3a283b6c",
"node_modules/.pnpm/@expo+cli@58.1.20_@expo+dom-webview@58.0.2_expo-constants@58.0.16_expo@58.0.24_react-na_9e33ccae367f67a78635be2cb8b90a55/node_modules/@expo/cli/package.json": "98f35dbe2ac27fd7ee90905352ab6215fc157f80094f6e7c2bce87ebd1e85c39",
"node_modules/.pnpm/@react-native+js-polyfills@0.88.1/node_modules/@react-native/js-polyfills/package.json": "4b540e4c8ea9920faeefdaa16a7da7dd49ff5521fd168153ef52aa5e975f837b",
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"prebuild:android": "pnpm run runtime:build && expo prebuild --platform android --no-install --template ./node_modules/expo/template.tgz",
"export:android": "pnpm run runtime:build && expo export --platform android",
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.tests.json",
"doctor:expo": "expo-doctor",
"doctor:expo": "node scripts/check-expo.mjs",
"doctor:react": "react-doctor . --no-telemetry --no-supply-chain --yes --blocking warning",
"doctor:slop": "node tools/quality/node_modules/aislop/dist/cli.js ci",
"quality:install": "pnpm --dir tools/quality install --frozen-lockfile",
Expand Down Expand Up @@ -54,7 +54,8 @@
"test:signer:native": "python3 tests/native/signer-core/run.py",
"build:release": "node scripts/android-release.mjs build",
"sign:release": "node scripts/android-release.mjs sign",
"test:release": "node --test tests/release/*.test.mjs"
"test:release": "node --test tests/release/*.test.mjs",
"doctor:expo:latest": "expo install --check"
},
"dependencies": {
"@expo/dom-webview": "58.0.2",
Expand Down
66 changes: 66 additions & 0 deletions scripts/check-expo.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { spawnSync } from "node:child_process";
import { readFileSync } from "node:fs";
import { createRequire } from "node:module";
import { resolve } from "node:path";
import { pathToFileURL } from "node:url";

const root = createRequire(new URL("../package.json", import.meta.url));
const expo = createRequire(root.resolve("expo/package.json"));
// Use the pinned Expo CLI's own SemVer implementation.
const cli = createRequire(expo.resolve("@expo/cli/package.json"));
const { valid, validRange, satisfies } = cli("semver");

export function checkVersions(manifest, bundled, installed) {
const dependencies = { ...manifest.devDependencies, ...manifest.dependencies };
const pinnedExpo = dependencies.expo;
if (!valid(pinnedExpo) || installed("expo") !== pinnedExpo) {
throw new Error("Expo must be installed at the exact version pinned in package.json.");
}
for (const required of ["react", "react-native"]) {
if (!bundled[required] || !dependencies[required]) {
throw new Error(`Missing SDK compatibility baseline for ${required}.`);
}
}
const failures = [];
let checked = 0;
for (const name of Object.keys(dependencies)) {
if (!Object.hasOwn(bundled, name)) continue;
const expected = bundled[name];
if (!validRange(expected)) throw new Error(`Invalid SDK range for ${name}.`);
const actual = installed(name);
if (!satisfies(actual, expected)) {
failures.push(`${name}: installed ${actual}, SDK requires ${expected}`);
}
checked += 1;
}
if (failures.length) throw new Error(failures.join("\n"));
return checked;
}

export function checkProject(projectRoot) {
const project = createRequire(resolve(projectRoot, "package.json"));
const manifest = JSON.parse(readFileSync(resolve(projectRoot, "package.json"), "utf8"));
const bundled = project("expo/bundledNativeModules.json");
const checked = checkVersions(manifest, bundled, (name) => project(`${name}/package.json`).version);
return `Expo ${manifest.dependencies.expo}: ${checked} dependencies match the pinned SDK compatibility map.`;
}

export function runDoctor(projectRoot, run = spawnSync) {
console.log(checkProject(projectRoot));
console.log("The remaining Expo Doctor checks run online; latest upgrade recommendations are separate.");
const result = run(process.execPath, [root.resolve("expo-doctor/build/index.js"), projectRoot], {
stdio: "inherit",
env: { ...process.env, EXPO_DOCTOR_SKIP_DEPENDENCY_VERSION_CHECK: "1" },
});
if (result.error) throw result.error;
return result.status ?? 1;
}

if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) {
try {
process.exitCode = runDoctor(process.cwd());
} catch (error) {
console.error(error.message);
process.exitCode = 1;
}
}
36 changes: 18 additions & 18 deletions src/shell/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { ShellPressable as Pressable } from './ShellPressable';
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
import Animated, { useAnimatedScrollHandler, useAnimatedStyle, type SharedValue } from 'react-native-reanimated';
import { OverviewCard } from './OverviewCard';
import { createOverviewScrollRestorer, overviewScrollOffset } from './overview-scroll';
import type { OverviewGeometry, CardMeasurement, Size } from './motion';
import type { NappletDescriptor } from './workspace';
import { useShellStyles, type ShellPalette, type ShellFonts } from './theme';

export interface OverviewHandle { focusCard: (id: string | null) => void; revealCard: (id: string | null) => void }
interface Props {
hidden?: boolean;
sessions: readonly NappletDescriptor[];
geometry: OverviewGeometry;
size: Size;
Expand All @@ -36,42 +36,43 @@ function focusView(view: ViewInstance | TextInstance | null | undefined) {
const sessionKey = (session: NappletDescriptor): string => session.id;

/** Only transparent controls virtualize; the live native views stay in WorkspaceStage. */
export const Overview = forwardRef<OverviewHandle, Props>(function Overview({ hidden = false, sessions, geometry, size, visible, busy, focusedId, progress, scrollY, swipeId, swipeY, pending, onFocus, onClose, onOpen, onDragEnd, onMeasure }, ref) {
export const Overview = forwardRef<OverviewHandle, Props>(function Overview({ sessions, geometry, size, visible, busy, focusedId, progress, scrollY, swipeId, swipeY, pending, onFocus, onClose, onOpen, onDragEnd, onMeasure }, ref) {
const { styles } = useShellStyles(createStyles);
const scroll = useRef<FlatList<NappletDescriptor>>(null);
const heading = useRef<TextInstance>(null);
const cardRefs = useRef(new Map<string, ViewInstance>());
const scrollGesture = useMemo(() => Gesture.Native(), []);
const inactive = busy || !visible;
const scrollGesture = useMemo(() => Gesture.Native().enabled(!inactive), [inactive]);
const setCardRef = useCallback((id: string, view: ViewInstance | null) => {
if (view) cardRefs.current.set(id, view); else cardRefs.current.delete(id);
}, []);
const restoreScroll = useMemo(() => createOverviewScrollRestorer(), []);
const revealCard = useCallback((id: string | null) => {
const index = sessions.findIndex(session => session.id === id);
const next = overviewScrollOffset(geometry, index, scrollY.get(), size.height);
scroll.current?.scrollToOffset({ offset: next, animated: false });
scrollY.set(next);
}, [geometry, scrollY, sessions, size.height]);
useImperativeHandle(ref, () => ({
focusCard: id => focusView(id ? cardRefs.current.get(id) ?? heading.current : heading.current),
revealCard: id => {
const index = sessions.findIndex(session => session.id === id);
const rect = geometry.cards[index];
if (!rect) return;
const top = scrollY.get();
const bottom = rect.y + rect.height + geometry.captionHeight;
const next = rect.y < top ? Math.max(0, rect.y - 12) : bottom > top + size.height ? bottom - size.height + 12 : top;
scroll.current?.scrollToOffset({ offset: next, animated: false });
scrollY.set(next);
},
}), [geometry, scrollY, sessions, size.height]);
revealCard,
}), [revealCard]);
const opacity = useAnimatedStyle(() => ({ opacity: progress.get() }));
const onScroll = useAnimatedScrollHandler(event => { scrollY.set(event.contentOffset.y); });
const headerHeight = geometry.cards[0]?.y ?? 72;
const cardHeight = geometry.cards[0]?.height ?? 0;
const stride = cardHeight + geometry.captionHeight + 20;
const renderCard = useCallback(({ item, index }: { item: NappletDescriptor; index: number }) => (
<OverviewCard session={item} rect={geometry.cards[index]} captionHeight={geometry.captionHeight}
busy={busy} selected={focusedId === item.id} pending={pending.has(item.id)} swipeId={swipeId} swipeY={swipeY} scrollGesture={scrollGesture}
busy={inactive} selected={focusedId === item.id} pending={pending.has(item.id)} swipeId={swipeId} swipeY={swipeY} scrollGesture={scrollGesture}
setRef={setCardRef} onFocus={onFocus} onClose={onClose} onDragEnd={onDragEnd} onMeasure={onMeasure} />
), [busy, focusedId, geometry, onClose, onDragEnd, onFocus, onMeasure, pending, scrollGesture, setCardRef, swipeId, swipeY]);
return <Animated.View style={[StyleSheet.absoluteFill, styles.layer, opacity, hidden && styles.hidden]} pointerEvents={visible && !busy ? 'auto' : 'none'} accessibilityElementsHidden={!visible} importantForAccessibility={visible ? 'auto' : 'no-hide-descendants'}>
), [inactive, focusedId, geometry, onClose, onDragEnd, onFocus, onMeasure, pending, scrollGesture, setCardRef, swipeId, swipeY]);
return <Animated.View style={[StyleSheet.absoluteFill, styles.layer, opacity]} pointerEvents={visible && !busy ? 'auto' : 'none'} accessibilityElementsHidden={!visible} importantForAccessibility={visible ? 'auto' : 'no-hide-descendants'}>
<GestureDetector gesture={scrollGesture}>
<Animated.FlatList ref={scroll} data={sessions} numColumns={2} keyExtractor={sessionKey} testID="napplet-overview"
initialNumToRender={6} windowSize={5} removeClippedSubviews={false} scrollEnabled={visible && !busy}
onLayout={() => restoreScroll('layout', () => revealCard(focusedId))}
onContentSizeChange={() => restoreScroll('content', () => revealCard(focusedId))}
onScroll={onScroll} scrollEventThrottle={16} bounces={false} overScrollMode="never" keyboardShouldPersistTaps="handled"
columnWrapperStyle={styles.row} contentContainerStyle={{ minHeight: geometry.contentHeight, paddingHorizontal: 12, paddingBottom: 24 }}
getItemLayout={(_data, row) => ({ index: row, length: stride, offset: headerHeight + row * stride })}
Expand All @@ -89,7 +90,6 @@ export const Overview = forwardRef<OverviewHandle, Props>(function Overview({ hi
</Animated.View>;
});
const createStyles = (colors: ShellPalette, fonts: ShellFonts) => StyleSheet.create({
hidden: {display: 'none'},
layer: { zIndex: 10 }, row: { gap: 16 },
headingRow: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: 12 },
heading: { fontFamily: fonts.strong, fontSize: 19, color: colors.text, flexShrink: 1 },
Expand Down
4 changes: 2 additions & 2 deletions src/shell/WorkspaceStage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ export const WorkspaceStage = forwardRef<OverviewHandle, StageProps>(function Wo
{workspace.sessions.map((session, index) => <LiveSession hidden={homeVisible(workspace)} key={session.id} gutter={fullscreen ? 0 : HANDLE_GUTTER} onZoomTarget={onZoomTarget} session={session} closeCheck={closeCheck?.sessionId === session.id ? JSON.stringify({id: closeCheck.id, generation: closeCheck.generation}) : ''} index={index} size={size} rect={resolveCardRect(geometry.cards[index], measured[session.id])}
progress={progress} position={position} scrollY={scrollY} swipeY={swipeY} swipeId={swipeId} {...workspaceSessionActivity({focused: workspace.focusedId === session.id, overview: workspace.overview, busy, interactive, blocked, checkingClose: closeCheck !== null, hostActivityBlocked})}
raised={workspace.focusedId === session.id} onHostEvent={onHostEvent} />)}
<Overview hidden={homeVisible(workspace)} ref={ref} sessions={workspace.sessions} geometry={geometry} size={size} visible={workspace.overview && !homeVisible(workspace)} busy={disabled} focusedId={workspace.focusedId}
{!homeVisible(workspace) && <Overview ref={ref} sessions={workspace.sessions} geometry={geometry} size={size} visible={workspace.overview && !homeVisible(workspace)} busy={disabled} focusedId={workspace.focusedId}
Comment thread
macro88 marked this conversation as resolved.
Resolved
progress={progress} scrollY={scrollY} swipeId={swipeId} swipeY={swipeY} pending={pending} onFocus={onFocus} onClose={onClose} onOpen={onOpen}
onDragEnd={onDragEnd}
onMeasure={(id, measurement) => setMeasured(previous => {
const prior = previous[id];
return prior && resolveCardRect(measurement.expected, prior) === prior.actual
&& prior.actual.width === measurement.actual.width && prior.actual.height === measurement.actual.height
? previous : { ...previous, [id]: measurement };
})} />
})} />}
{homeVisible(workspace) && <View style={styles.home} pointerEvents={disabled ? 'none' : 'auto'}>{home}</View>}
<Handles width={size.width} position={position} index={Math.max(0, workspace.sessions.findIndex(session => session.id === workspace.focusedId))} count={workspace.sessions.length} top={clamp(size.height * 0.62, 40, Math.max(40, size.height - 104))} disabled={fullscreen || workspace.overview || disabled}
canPrevious={adjacentNapplet(workspace, -1) !== null} canNext={adjacentNapplet(workspace, 1) !== null}
Expand Down
49 changes: 49 additions & 0 deletions src/shell/overview-scroll.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import assert from 'node:assert/strict';
import { test } from 'node:test';
import { overviewGeometry } from './motion.ts';
import { createOverviewScrollRestorer, overviewScrollOffset } from './overview-scroll.ts';

const size = { width: 369, height: 704 };
const geometry = overviewGeometry(size, 20);

test('Home remount waits for viewport and content in either native event order', () => {
for (const events of [['layout', 'content'], ['content', 'layout']] as const) {
const ready = createOverviewScrollRestorer();
let nativeOffset = 0;
let sharedOffset = 0;
let scrolls = 0;
const restore = () => {
const next = overviewScrollOffset(geometry, 18, sharedOffset, size.height);
nativeOffset = next;
sharedOffset = next;
scrolls += 1;
};
ready(events[0], restore);
assert.equal(scrolls, 0);
ready(events[1], restore);
assert.equal(scrolls, 1);
assert.equal(nativeOffset, sharedOffset);
const rect = geometry.cards[18];
assert(rect.y >= nativeOffset);
assert(rect.y + rect.height + geometry.captionHeight <= nativeOffset + size.height);
// Later content measurements must not undo the user's manual scrolling.
nativeOffset = sharedOffset = 100;
ready('content', restore);
ready('layout', restore);
assert.equal(scrolls, 1);
assert.equal(nativeOffset, 100);
}
});

test('returning through Home restores a retained offset even if the card is already in view', () => {
const top = overviewScrollOffset(geometry, 10, 0, size.height);
assert(top > 0);
assert.equal(overviewScrollOffset(geometry, 10, top, size.height), top);
assert.equal(overviewScrollOffset(geometry, 0, top, size.height), 60);
});

test('closed cards, empty lists and changed viewport geometry cannot retain an invalid offset', () => {
assert.equal(overviewScrollOffset(overviewGeometry(size, 0), -1, 1000, size.height), 0);
assert.equal(overviewScrollOffset(geometry, -1, -100, size.height), 0);
assert.equal(overviewScrollOffset(geometry, -1, 1e6, size.height), geometry.contentHeight - size.height);
});
Loading
Loading