Conversation
The activity section on the profile already swaps the owner empty state for the visitor one in preview mode, but the standalone posts, replies and upvoted pages still compared the logged user to the profile owner directly. The preview toggle lives in the profile sidebar, which renders on those pages too, so an owner with no posts toggled preview and was still offered "New post" — reading as if visitors could post on their profile. They now take `isOwner` from useProfilePreview, the same source the activity section uses, and the "Show More" links carry the preview flag so switching to the full list does not silently leave preview mode. The replies page spec gained a router mock of its own; its fixtures were also brought up to the current types, which the strict-changed guard checks once the file is touched. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
idoshamun
deleted the
eng-2025-feedback-ux-issue-create-post-button-in-preview-mode-may
branch
September 14, 2026 06:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A user with no posts turned on preview mode and was still offered a New post button under activity, reading as if visitors could post on their profile.
The activity section on the profile page itself already handles this — it swaps the owner empty state for the visitor one via
useProfilePreview. The hole was one level deeper: the standalone/[userId]/posts,/repliesand/upvotedpages compared the logged user to the profile owner directly. The preview toggle lives inProfileWidgets, whichProfileLayoutrenders in the aside on those pages too, so toggling preview there left the owner CTAs in place.Changes
pages/[userId]/{posts,replies,upvoted}.tsxtakeisOwnerfromuseProfilePreview(user)instead ofloggedUser?.id === user.id, so preview mode shows the visitor empty state ("… hasn't posted yet" / "hasn't upvoted yet" / "hasn't replied to any post yet") with no owner CTA.getUserPathtakes an optional preview flag and the activity tabs pass it, so the Show More links keep?preview=truerather than silently dropping a previewing owner back into owner mode on the full list.next/routermock (it relied on the global one) and its fixtures updated to current types (socialLinks,numAwards,noindex), which the strict-changed typecheck guard requires once the file is touched.Key decisions
useProfilePreviewrather than re-deriving preview state per page, so all profile surfaces read the flag from one place.hideOptionsMenu; the standalone page does not, but that is a separate preview-fidelity gap from the reported CTA issue.Verification
ProfilePostsPage/ProfileUpvotedPage/ProfileRepliesPage: 12 passed. Revertingposts.tsxmakes the new test fail, so it is not vacuous.typecheck-strict-changed.jsand ESLint clean on all changed files. Full webapp and sharedtscshow only pre-existing errors in untouched files.Closes ENG-2025
Created by Huginn 🐦⬛
🤖 Generated with Claude Code
Preview domain
https://eng-2025-feedback-ux-issue-creat.preview.app.daily.dev