mirror of
https://github.com/captbaritone/webamp.git
synced 2026-11-07 10:25:59 -10:00
The feed was its own shuffled list (museum favorites plus random skins). Now it continues through whatever the grid shows, the museum or a search: tapping a skin opens the feed on it with the list before and after it, and going back lands the grid on the skin you were on. Feed URLs are plain permalinks; the list lives in the tab (listPosition.ts), and a permalink opened fresh is followed by the museum. /feed redirects to the museum's first skin. - Event logging v3: one session per tab visit spanning both views, with view_switch events and each feed view's list, list index and depth. Older events are still accepted. - The feed loads readmes and like counts on demand. - Keyboard paging steps from the skin actually on screen, so it can't get stuck after a scroll is interrupted. - Going back to the grid animates the skin into its tile. React's <ViewTransition> can't animate Back with Next's router, so it's done by hand. - Grid tiles and view transition snapshots render pixelated. - Download saves the skin under its file name, not its md5. - A feed URL for a missing skin returns a 404 status. - The list position is kept apart from the server actions, so pages with only the menu bar don't each compile another copy of the server code; this kept the build within the server's memory. - Declare reselect (used by legacy-client) and give knexfile.ts named exports. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QzNErwA6wVTLaUTNMARPQt
31 lines
828 B
TypeScript
31 lines
828 B
TypeScript
"use client";
|
|
|
|
import Link from "next/link";
|
|
import { useRouter } from "next/navigation";
|
|
import { ArrowLeft } from "lucide-react";
|
|
import { returnToGrid } from "./gridReturn";
|
|
import { gridPath } from "./paths";
|
|
import { useListPosition } from "./listPosition";
|
|
import { isModifiedClick } from "./BottomMenuBar";
|
|
|
|
// Shown to the left of each skin's title in the feed.
|
|
export default function BackToGrid() {
|
|
const router = useRouter();
|
|
const position = useListPosition();
|
|
return (
|
|
<Link
|
|
href={gridPath(position?.query ?? "")}
|
|
className="skin-back"
|
|
aria-label="Back to grid"
|
|
title="Back to grid"
|
|
onClick={(e) => {
|
|
if (isModifiedClick(e)) return;
|
|
e.preventDefault();
|
|
returnToGrid(router);
|
|
}}
|
|
>
|
|
<ArrowLeft size={22} aria-hidden />
|
|
</Link>
|
|
);
|
|
}
|