Skip to content

feat: remove a suggestion once you follow them - #1148

Open
benjam-es wants to merge 1 commit into
dev-null-sh:productionfrom
benjam-es:feat/follow-removes-suggestion
Open

benjam-es wants to merge 1 commit into
dev-null-sh:productionfrom
benjam-es:feat/follow-removes-suggestion

Conversation

@benjam-es

@benjam-es benjam-es commented Oct 25, 2026 •

Copy link
Copy Markdown

Issue:
After clicking to follow someone from the suggestion list, the suggestion still remains

Expectation:
Clicking 'follow' from the suggestion list should remove that suggestion from the list to offer a new suggestion. The 'not interested' click already does this

Solution (in PR):
A followed suggestion now folds away and a spare takes its slot, after a short beat, the way dismissing one already does.

Summary by CodeRabbit

  • New Features
    • Following a suggested account now removes it from the suggestions list, with replacement suggestions handled as available.
  • Bug Fixes
    • Follow actions now update suggestion lists without affecting the behavior of unfollowing.

A followed suggestion now folds away and a spare takes its slot,
after a short beat, the way dismissing one already does.

Signed-off-by: Ben James <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fc22385d-6356-4c64-a61c-f3441d7ee88e
Commits

Reviewing files that changed from the base of the PR and between 5709994 and a2f9a38.

Files selected for processing: 2
  • resources/js/components/follow-button.tsx
  • resources/js/components/who-to-follow.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

Follow actions now notify suggestion rows, which remove the followed user from the aside or log list. The removal flow marks the user dismissed and removes them immediately when a spare exists, or after a delay otherwise.

Changes: Followed suggestion removal

Layer / File(s) Summary
Follow callback contract
resources/js/components/follow-button.tsx
FollowIconButton accepts an optional onFollowed callback. It invokes the callback after a successful follow, but not after an unfollow.
Suggestion removal flow
resources/js/components/who-to-follow.tsx
SuggestedUserRow waits 600 ms before calling onFollowed. The aside and log pass callbacks that remove the followed suggestion. Removal happens immediately when a spare exists, or after 300 ms otherwise.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Feature

Possibly related issues

  • Issue 897 describes followed suggestions remaining in the list. This change removes followed suggestions and uses the existing spare-suggestion flow.

Possibly related PRs

Suggested reviewers: harris21

Merge Risk: Minimal · up to a2f9a

The supplied evidence does not establish a blocker to merging, though the delayed removal behavior after navigation has not been verified.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: removing a suggestion after the user follows them.
Docstring Coverage Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@jubianchi

Copy link
Copy Markdown
Contributor

Note

This message is generated by an AI agent on behalf of @jubianchi. It may contain errors—verify important details.

@benjam-es, who-to-follow.tsx has moved a lot since this was opened, most recently with #1477 (merged Nov 4), which syncs Who to follow across tabs: a follow or a dismissal elsewhere updates the loaded rows in place ("Reconcile the loaded rows, rather than drawing a different set of suggestions after every follow").

What that means for this PR after a rebase:

  • On the other tabs, useSuggestedUserUpdates() reads each loaded row's state and only flips its follow button for someone followed, while only dismissed people are removed: who-to-follow.tsx#L128-L136.
  • Here, removeSuggestion() adds the followed person to the local dismissedIds without telling the server, so the server never reports them as dismissed. The row would fold away in the tab you follow from, but stay, shown as followed, in your other tabs.
  • Keeping the row also keeps the way to undo a follow made by mistake: the icon turns into "Unfollow @handle" (follow-button.tsx#L372). Which of the two matters more is a UI choice for the maintainers.

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.

2 participants