Collapse metadata panels into bottom sheets on mobile

DESIGN.md asks for metadata panels to slide up from the bottom under
768px. A BottomSheet component provides the trigger pill and the sheet
(backdrop blur, scroll lock, Escape to close) and ResponsivePanel swaps
between it and the existing desktop <aside>, so panel content is mounted
once either way.

Applied to the Library/Online/Similar detail asides and to long pool
descriptions. Upload needed nothing: its metadata editor is already a
full-screen modal that stacks cleanly on small screens.
This commit is contained in:
2026-09-17 22:26:38 -05:00
parent e97c3b9da0
commit d8ba442e72
5 changed files with 136 additions and 11 deletions
+5 -1
View File
@@ -1,5 +1,7 @@
import type { ReactNode } from "react";
import { ResponsivePanel } from "@/components/BottomSheet";
export function DetailShell({
breadcrumb,
actions,
@@ -17,7 +19,9 @@ export function DetailShell({
<div className="flex flex-col gap-4">
{breadcrumb}
<div className="grid gap-6 lg:grid-cols-[320px_minmax(0,1fr)]">
<aside className="order-2 flex flex-col gap-4 lg:order-1">{aside}</aside>
<div className="order-2 lg:order-1">
<ResponsivePanel title="Tags & info">{aside}</ResponsivePanel>
</div>
<div className="order-1 flex min-w-0 flex-col gap-4 lg:order-2">
{actions}
{media}
+19 -8
View File
@@ -4,6 +4,7 @@ import { useMemo, useState } from "react";
import { Link, useLocation, useParams } from "react-router-dom";
import { Button, EmptyState, Spinner } from "@/components/ui";
import { BottomSheet } from "@/components/BottomSheet";
import { PostCard } from "@/features/online/PostCard";
import { PoolFollowButton } from "@/features/follows/PoolFollowButton";
import { api } from "@/lib/api";
@@ -19,6 +20,7 @@ import {
type E621Post,
} from "@/lib/e621";
import { formatDate } from "@/lib/format";
import { useIsMobile } from "@/lib/useMediaQuery";
import { useE621 } from "@/store/e621";
const CHUNK = 100;
@@ -48,6 +50,7 @@ export default function PoolDetailPage() {
const credentials = useE621((state) => state.credentials);
const blacklist = useE621((state) => state.blacklist);
const blacklistSet = useMemo(() => new Set(blacklist), [blacklist]);
const isMobile = useIsMobile();
const [visibleCount, setVisibleCount] = useState(CHUNK);
const [showBlacklisted, setShowBlacklisted] = useState(false);
@@ -205,14 +208,22 @@ export default function PoolDetailPage() {
</header>
{pool.description.trim() ? (
<section className="rounded-lg border border-ctp-surface0 bg-ctp-base p-4">
<h2 className="text-sm font-semibold text-ctp-subtext1">
Description
</h2>
<div className="mt-2 text-sm leading-relaxed text-ctp-subtext0">
{renderDText(pool.description)}
</div>
</section>
isMobile ? (
<BottomSheet title="Description">
<div className="text-sm leading-relaxed text-ctp-subtext0">
{renderDText(pool.description)}
</div>
</BottomSheet>
) : (
<section className="rounded-lg border border-ctp-surface0 bg-ctp-base p-4">
<h2 className="text-sm font-semibold text-ctp-subtext1">
Description
</h2>
<div className="mt-2 text-sm leading-relaxed text-ctp-subtext0">
{renderDText(pool.description)}
</div>
</section>
)
) : null}
<section className="flex flex-col gap-3">
@@ -8,6 +8,7 @@ import {
} from "react";
import { Link } from "react-router-dom";
import { ResponsivePanel } from "@/components/BottomSheet";
import { Button, Spinner } from "@/components/ui";
import { api, errorMessage, uploadFile } from "@/lib/api";
import { cn } from "@/lib/cn";
@@ -182,7 +183,7 @@ export default function SimilarPage() {
{check ? (
<div className="grid gap-6 lg:grid-cols-[320px_minmax(0,1fr)]">
<aside className="flex flex-col gap-4">
<ResponsivePanel title="File & check">
<section className="overflow-hidden rounded-lg border border-ctp-surface0 bg-ctp-base">
<div className="flex max-h-72 items-center justify-center overflow-hidden bg-ctp-mantle">
{check.file_url ? (
@@ -242,7 +243,7 @@ export default function SimilarPage() {
</div>
</div>
</section>
</aside>
</ResponsivePanel>
<div className="flex min-w-0 flex-col gap-6">
<section className="rounded-lg border border-ctp-surface0 bg-ctp-base p-4">