Skip to content

refactor: name the profile connection lists with an enum - #1193

Closed
sulimanbenhalim wants to merge 1 commit into
dev-null-sh:productionfrom
sulimanbenhalim:refactor/connections-enum
Closed

sulimanbenhalim wants to merge 1 commit into
dev-null-sh:productionfrom
sulimanbenhalim:refactor/connections-enum

Conversation

@sulimanbenhalim

@sulimanbenhalim sulimanbenhalim commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Changes

  • new App\Enums\ConnectionType with Followers FollowersYouKnow Following and Mutuals named after the ConnectionType the page already uses
  • the four controllers pass the case as type and connections() matches on it so the strings live in one place
  • inertia sends the enum's value so the page still gets the same type and nothing changes on the frontend

Validation

  • full suite with --parallel --ci --coverage --exactly=100.0 plus lint types and type coverage pass locally (4525 tests)
  • the controller tests still see type as followers followers_you_know following and mutuals

Independent review

  • read-only Claude agent: PASS on base 2143da4f head f62a9a90 after a FAIL round that caught followers_you_know

Limitations

  • None

Summary by CodeRabbit

  • Refactor
    • Connection pages now use consistent, predefined connection types. The names, descriptions, and displayed content for followers, people you know, following, and mutual connections remain unchanged. No changes to connection lists or pagination are visible to users.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

The change adds a string-backed enum for four connection types. Connection controllers use enum cases, and PageMetadata::connections accepts the enum and uses its cases to select metadata.

Changes: Connection type handling

Layer / File(s) Summary
Connection type and metadata contract
app/Enums/ConnectionType.php, app/Services/PageMetadata.php
Adds four connection type cases. PageMetadata::connections accepts the enum and matches cases to generate titles and descriptions. The URL uses the enum value.
Controller enum adoption
app/Http/Controllers/UserFollowersController.php, app/Http/Controllers/UserFollowersYouKnowController.php, app/Http/Controllers/UserFollowingController.php, app/Http/Controllers/UserMutualsController.php
The controllers use enum cases for the rendered type values and, where applicable, the PageMetadata::connections argument.

Priority: Not assessed

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

Change: Refactor

Possibly related PRs

  • dev-null-sh/dev-null.sh#1006: Adds the mutuals connection page and its controller and metadata handling, which this change updates to use ConnectionType::Mutuals.
  • dev-null-sh/dev-null.sh#733: Adds the followers-you-know connection page and controller, which this change updates to use ConnectionType::FollowersYouKnow.

Suggested reviewers: xheaven, kachelle, ashkesarmaa

Merge Risk: Minimal · up to f62a9

The refactor preserves the existing connection types and metadata behavior, so it is mergeable with normal checks.

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.

@nunomaduro

Copy link
Copy Markdown
Member

Closing as a duplicate of #1194. Thanks for the work on this!

@nunomaduro nunomaduro closed this Oct 26, 2026
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