Skip to content

Hide back button on home page and edit option on deleted reviews#339

Open
xenacode-art wants to merge 2 commits intom2b3:sureshDevfrom
xenacode-art:fix/back-button-and-deleted-review-edit
Open

Hide back button on home page and edit option on deleted reviews#339
xenacode-art wants to merge 2 commits intom2b3:sureshDevfrom
xenacode-art:fix/back-button-and-deleted-review-edit

Conversation

@xenacode-art
Copy link
Copy Markdown

Closes #312
Closes #290

NavBar — back button on root home page (#312)

The MoveLeft back arrow was rendering on every page, including /
where there's no history to go back to. Added a pathname !== '/'
check so it only shows when you're somewhere navigable back from.

ReviewCard — edit button visible on deleted reviews (#290)

The edit pencil was shown whenever review.is_author was true, with
no check for whether the review had been soft-deleted. ReviewOut
exposes a deleted_at field — added !review.deleted_at to the
condition so the edit option is hidden once a review is deleted.

@bsureshkrishna
Copy link
Copy Markdown
Contributor

The live branch is sureshDev. Please target that.

@xenacode-art xenacode-art changed the base branch from main to sureshDev March 22, 2026 20:25
NavBar: the back arrow was showing on every page including the root
home page where there's nowhere to go back to. Added a pathname check
so it only renders when you're not on '/'.

ReviewCard: the edit pencil was visible to the review author even after
the review had been soft-deleted (deleted_at set). Added a !deleted_at
guard so the edit option only shows up on reviews that haven't been
deleted.

Fixes m2b3#312, m2b3#290
@xenacode-art xenacode-art force-pushed the fix/back-button-and-deleted-review-edit branch from 62dfb2c to 081c4e4 Compare March 22, 2026 20:27
@xenacode-art
Copy link
Copy Markdown
Author

thank you @bsureshkrishna for pointing that out, i have retargeted . Do take a look and let me know if there is anything else you need me to do.

Comment thread src/components/common/NavBar.tsx Outdated
>
<MoveLeft className="size-5" strokeWidth={1.5} />
</button>
{pathname !== '/' && (
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think removing back button on home page is necessary. it can stay there.

<span className="flex items-center gap-2 text-sm font-bold text-text-secondary">
{review.user.username}
{review.is_author && (
{review.is_author && !review.deleted_at && (
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you check the same for comments and discussions.

Revert the pathname !== '/' back button guard per reviewer feedback —
the back button is fine to show on the home page.

Also fixes the same deleted-item edit button issue in DiscussionCard:
canEditDiscussion was true for any author regardless of deleted_at.
Added !discussion.deleted_at guard to match the ReviewCard fix.

Closes m2b3#290
@xenacode-art
Copy link
Copy Markdown
Author

xenacode-art commented Mar 25, 2026

On the ReviewCard comment:
Checked Comment.tsx already guards edit/delete behind {!is_deleted && ( so comments are covered. Found the same issue in DiscussionCard.tsx though: canEditDiscussion had no deleted_at check. Fixed in the latest commit. Also reverted the back button stays on the home page ( minor )

@bsureshkrishna
Copy link
Copy Markdown
Contributor

@xenacode-art - thank you for these. I would like to think first about the entire deletion policy setup before I move forward on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT]: Hide back navigation button on the root home page [BUG] User can still edit, vote, delete review and comment even after Deleted

3 participants