Skip to content

fix: show follow back on profiles and hover cards - #859

Merged
xHeaven merged 3 commits into
dev-null-sh:productionfrom
richardkeep:fix/profile-follow-back
Oct 31, 2026
Merged

xHeaven merged 3 commits into
dev-null-sh:productionfrom
richardkeep:fix/profile-follow-back

Conversation

@richardkeep

@richardkeep richardkeep commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Show “Follow back” on profiles and user hover cards when the developer already follows you and you do not follow them yet. The hover card previously showed “Follows you” beside a “Follow” button.

Changes

  • Pass the existing inbound follow state to the profile button and hover-card label, including its accessible name.
  • Reserve the same 104px width for the hover button and its loading placeholder.
  • Cover follower, stranger, and mutual follow states; document the labels in the knowledge base.

Validation

  • Reproduced the hover-card bug in the local feed and confirmed the new regression test fails before the fix.
  • composer test:lint — passed with an isolated temporary cache after the initial run referenced a deleted checkout from Rector’s shared container cache.
  • composer test:types and composer test:type-coverage — passed; type coverage 100%.
  • bun run test:unit — 221 passed.
  • bunx vp test run --config tests/draft-images.config.ts tests/Unit/FollowState.test.tsx tests/Unit/GuestFollow.test.tsx — 31 passed.
  • XDEBUG_MODE=coverage php -d memory_limit=-1 vendor/bin/pest --parallel --ci --coverage --exactly=100.0 --passthru-php="'-d' 'memory_limit=-1'" — 5,195 passed, 28,163 assertions, 100% coverage.
  • bun run build — passed.
  • Local Chromium: profile and feed hover card show “Follow back”; strangers keep “Follow”; following/unfollowing preserves the correct labels. Hover control remains 104px with no measured layout shift during following. Desktop checks at 1440×900 and 1366×650 in light/dark; profile at 390×844 in light/dark viewport emulation, no horizontal overflow.

Independent review

Independent reviewer: CODE PASS and UI behavior PASS for base 6105f8f76d3f35b30f1733d66b34b239e3fcdb3e → head 99e222b7a571aaade292c7c1fc5de54a8e88468b. Reviewer independently ran the 31 focused TSX tests and checked follower/stranger labels and responsive geometry in the running app.

Limitations

Browser verification used live DOM, accessibility, and geometry without captured media. Mobile coverage used viewport emulation, not hardware or a simulator. No mobile interaction was changed. Hosted CI is checked separately before merging.

Summary by CodeRabbit

  • Bug Fixes
    • Follow buttons now reflect whether the profile owner follows you, displaying “Follow back” when appropriate.
    • Follow buttons and their loading placeholders have a consistent minimum width across profile previews.

@coderabbitai

coderabbitai Bot commented Oct 31, 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: 962cfec2-887f-417f-910c-2b241efce340
Commits

Reviewing files that changed from the base of the PR and between b33e222 and 99e222b.

Files selected for processing: 3
  • KNOWLEDGE_BASE.md
  • resources/js/components/user-preview.tsx
  • tests/Unit/FollowState.test.tsx

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

Walkthrough

The profile page passes inbound follow state to FollowButton. The user preview uses that state to display “Follow back” when the user follows the viewer and the viewer does not follow them. The preview button and loading placeholder also use a minimum width of 26.

Changes: Follow-back state

Layer / File(s) Summary
Pass inbound follow state
resources/js/pages/user/show.tsx
The profile page passes followsYou to FollowButton.
Display and test follow-back state
resources/js/components/user-preview.tsx, tests/Unit/FollowState.test.tsx, KNOWLEDGE_BASE.md
The preview button uses “Follow back” when the user follows the viewer and the viewer does not follow them. Tests cover “Follow back,” “Follow,” and “Unfollow.” The button and loading placeholder minimum widths change from 24 to 26. The developer documentation notes the follow-back option.

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

Change: Bug fix

Possibly related PRs

Suggested reviewers: xheaven, mnapoli

Merge Risk: Minimal · up to 99e22

The follow-back change is ready to merge with no identified material risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix: show follow back on profiles and hover cards" matches the changeset. The raw summary says the profile page now passes followsYou to FollowButton, the user preview follow button shows "…
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.
Full details: Title check

Explanation

The title "fix: show follow back on profiles and hover cards" matches the changeset. The raw summary says the profile page now passes followsYou to FollowButton, the user preview follow button shows "Follow back" when the user follows the viewer, and the docs now describe Follow back on profiles and hover cards. The PR objectives describe the same goal of showing "Follow back" when a user already follows the viewer. The title is specific and concise, and it names the main user-visible change.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 3 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@xHeaven xHeaven changed the title fix: fix profile follow button for users who follow you fix: show follow back on profiles and hover cards Oct 31, 2026
@xHeaven
xHeaven merged commit 1c0ce3d into dev-null-sh:production Oct 31, 2026
6 of 7 checks passed
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