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
+21 -2
View File
@@ -1,10 +1,11 @@
"use client";
import type { ReactNode } from "react";
import { useLayoutEffect, useRef, useState, type ReactNode } from "react";
import type { Person } from "@/lib/auth-client";
import { useTheme } from "@/lib/use-theme";
import { HexAvatar } from "./HexAvatar";
import { Logo } from "./Logo";
import { CompactLayoutContext, isCompactWidth } from "./layout-context";
const iconProps = {
viewBox: "0 0 24 24",
@@ -73,8 +74,25 @@ export interface AppShellProps {
/** Signed-in bento shell (spec "Desktop and tablet layout", ADR 0001 section 3). */
export function AppShell({ person, search, feed, discover }: AppShellProps) {
const root = useRef<HTMLDivElement>(null);
const [compact, setCompact] = useState(false);
// The CSS switches layout with a container query on .app; the feed also
// needs to know, because the phone feed is different markup (full-screen slides).
useLayoutEffect(() => {
const el = root.current;
if (!el) return;
const measure = () => setCompact(isCompactWidth(el.getBoundingClientRect().width));
measure();
if (typeof ResizeObserver === "undefined") return;
const ro = new ResizeObserver(measure);
ro.observe(el);
return () => ro.disconnect();
}, []);
return (
<div className="app">
<CompactLayoutContext.Provider value={compact}>
<div className="app" ref={root} data-layout={compact ? "compact" : "wide"}>
<main className="bento">
<div className="bento-col bento-left">
<AccountPanel person={person} />
@@ -86,5 +104,6 @@ export function AppShell({ person, search, feed, discover }: AppShellProps) {
</aside>
</main>
</div>
</CompactLayoutContext.Provider>
);
}