import React, {
ViewTransition,
Suspense,
use,
useState,
useOptimistic,
startTransition,
addTransitionType,
} from 'react';
import SwipeRecognizer from './SwipeRecognizer.js';
import './NestedParentExit.css';
const items = [
{id: 1, title: 'First Post', body: 'Hello from the first post.'},
{id: 2, title: 'Second Post', body: 'Hello from the second post.'},
{id: 3, title: 'Third Post', body: 'Hello from the third post.'},
];
let feedRevealPromise = null;
export function resetFeedReveal() {
feedRevealPromise = null;
}
function FeedReveal() {
if (feedRevealPromise === null) {
feedRevealPromise = new Promise(resolve => setTimeout(resolve, 1000));
}
use(feedRevealPromise);
return null;
}
function FeedSkeleton() {
return (
{items.map(item => (
// Mirrors FeedItem: each skeleton row relays the exit (level 1), and
// its title/body placeholders relay again (level 2) so they animate
// out separately from the row — up and to the right. This exercises
// the nested parentExit relay through the SSR streaming reveal.
{selected ? (
) : (
}>
{/* The entering ViewTransition is the direct child of the
Suspense content, so it activates an enter scope and the
feed items below relay parentEnter (emitting
vt-parent-enter annotations in Fizz). */}