feat: scroll to post bubble from recommended card + back-to-top button
Some checks failed
Deploy to Frontend Servers / deploy (push) Failing after 14s

Recommended cards already routed to /browse#post-<id>, but the stream had
no logic to scroll to the target bubble — and the post might not be paged
in yet. MessageStream now resolves the #post-<id> hash, auto-loads more
pages until the bubble renders, scrolls to it, and gives it a brief gold
highlight. Bubbles get scroll-mt so they clear the sticky header.

Also adds a global floating back-to-top button (BackToTop) mounted in
PublicLayout, shown after scrolling past 400px.

Bundles related staging UI work already present in the working tree.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
TerryM
2026-05-29 11:50:27 +08:00
parent 8e36894851
commit 88a25b6ad4
27 changed files with 748 additions and 139 deletions

View File

@@ -1,5 +1,7 @@
import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom";
import { I18nProvider } from "./i18n";
import { MotionProvider } from "./motion";
import { ToastProvider } from "./components/Toast";
import { PublicLayout } from "./layouts/PublicLayout";
import { Home } from "./pages/Home";
import { Browse } from "./pages/Browse";
@@ -21,7 +23,9 @@ const adminEnabled = import.meta.env.VITE_DISABLE_ADMIN !== "true";
export default function App() {
return (
<I18nProvider>
<AdminRouterModeProvider value="absolute">
<MotionProvider>
<ToastProvider>
<AdminRouterModeProvider value="absolute">
<ImageLightboxProvider>
<VideoPlayerProvider>
<BrowserRouter>
@@ -55,7 +59,9 @@ export default function App() {
</BrowserRouter>
</VideoPlayerProvider>
</ImageLightboxProvider>
</AdminRouterModeProvider>
</AdminRouterModeProvider>
</ToastProvider>
</MotionProvider>
</I18nProvider>
);
}