xrdwb17xu: Add the full-screen snap feed with media and quote slides on phones

This commit is contained in:
2026-10-20 08:21:28 -06:00
parent 25fd360a2b
commit bf5e0ed475
12 changed files with 815 additions and 61 deletions
+11
View File
@@ -1,8 +1,12 @@
"use client";
import type { ReactNode, Ref } from "react";
import { canDelete, type CardPost } from "@/lib/feed-model";
import { Composer, type ComposerProps } from "./Composer";
import { GrowButton, IconButton } from "./Buttons";
import { PostCard } from "./PostCard";
import { useCompactLayout } from "./layout-context";
import { MobileFeed, type CurrentSlide } from "./MobileFeed";
export type FeedStatus = "loading" | "ready" | "error";
@@ -33,6 +37,10 @@ export interface FeedViewProps {
/** The scrolling feed list; the page itself never scrolls. */
listRef?: Ref<HTMLDivElement>;
now?: number;
/** Another page can load; the phone feed ends with a loading slide. */
hasMore?: boolean;
/** Phone layout only: the slide on screen changed (for the dock). */
onCurrentChange?: (slide: CurrentSlide) => void;
}
function Spinner() {
@@ -104,6 +112,9 @@ function FeedPanel({ children, composer, onRefresh, busy, refreshFailed }: { chi
}
export function FeedView(p: FeedViewProps) {
// At 760px and below the feed is the full-screen snap reel instead of the panel.
const compact = useCompactLayout();
if (compact) return <MobileFeed {...p} />;
if (p.status === "loading") {
return (
<FeedPanel onRefresh={p.onRefresh} busy>