diff --git a/app/(app)/u/[handle]/posts/scroll-feed.tsx b/app/(app)/u/[handle]/posts/scroll-feed.tsx index 80fd17b0..fad8d7fb 100644 --- a/app/(app)/u/[handle]/posts/scroll-feed.tsx +++ b/app/(app)/u/[handle]/posts/scroll-feed.tsx @@ -63,6 +63,13 @@ export function ScrollFeed({ if (missing) notFound(); + // When the owner views their own profile here and hides a post, drop it + // from the feed immediately (it moves to their Hidden tab). No-op for + // other viewers, who never see the Hide control. + function onHiddenChange(id: string, hidden: boolean) { + if (hidden) setFeed((rows) => rows.filter((p) => p.id !== id)); + } + return (
{loading ? ( @@ -70,7 +77,9 @@ export function ScrollFeed({ ) : feed.length === 0 ? (

No posts yet.

) : ( - feed.map((p) => ) + feed.map((p) => ( + + )) )}
); diff --git a/app/(app)/u/me/posts/page.tsx b/app/(app)/u/me/posts/page.tsx index 0ab3d7c1..2208c067 100644 --- a/app/(app)/u/me/posts/page.tsx +++ b/app/(app)/u/me/posts/page.tsx @@ -73,6 +73,12 @@ export default function MyPostsFeedPage() { setFeed((rows) => rows.map((p) => (p.id === updated.id ? updated : p))); } + // Hiding a post moves it off the timeline (into the Hidden tab), so drop + // it from this feed immediately rather than waiting for a refresh. + function onHiddenChange(id: string, hidden: boolean) { + if (hidden) setFeed((rows) => rows.filter((p) => p.id !== id)); + } + if (!user) return null; return ( @@ -90,6 +96,7 @@ export default function MyPostsFeedPage() { post={p} onDelete={(id) => setPendingDelete(id)} onUpdated={onPostUpdated} + onHiddenChange={onHiddenChange} /> )) )}