Skip to content

feat: pin a commit to your profile - #90

Merged
brendt merged 6 commits into
dev-null-sh:productionfrom
xHeaven:t3/pinned-profile-commit
Oct 15, 2026
Merged

brendt merged 6 commits into
dev-null-sh:productionfrom
xHeaven:t3/pinned-profile-commit

Conversation

@xHeaven

@xHeaven xHeaven commented Oct 15, 2026

Copy link
Copy Markdown
Member

feat: pin a commit to your profile

An older commit can now stay above the normal profile log. Owners can use Pin and Unpin in their commits' existing action row. One commit is pinned per account; pinning another replaces it in one atomic update.

The pinned row keeps the author's current lane color, reply controls, permalink, and moderation badge, with a quiet Pinned label. It appears once, above the chronological log on the Commits tab. The Replies tab keeps its existing query, parent context, pagination, and empty states, with no pin or pin controls. Pin changes return to the top and reset the cursor log so previously loaded pages cannot retain duplicate entries.

Behavior and decisions

  • Only an owner's nondeleted top-level commits are eligible. Replies and other authors' commits are forbidden, including for admins. Owners can pin their own pending or rejected commits; other signed-in readers only see approved pins.
  • Profile queries enforce ownership, top-level eligibility, moderation visibility, and soft-delete filtering when resolving a pin. Deleted or unavailable pins disappear without breaking the profile. Permanent deletion clears the nullable foreign key.
  • One hidden users.pinned_commit_id field gives each account one slot. Pin replacement is one SQL update; unpin checks the commit ID so an old request cannot clear a newer replacement. No changes to mirrored GitHub identity.
  • Counts and adaptive activity still include the pinned commit normally. The cursor query excludes it on every page and retains its stable timestamp/ID ordering. Commits-only partial reloads do not resolve the pinned row, activity, or profile counts.
  • Guest pages remain landing-page previews. No pinned body or reference is exposed in guest or user-preview props. Pin changes preserve the profile timestamp, so private pin changes do not invalidate the guest preview image.
  • Updated through production's moderation notifications, exports, link previews, terminal posting, and streaks. Pinned rows load the same star count, viewer state, link previews, and private saved state as ordinary cards. Star, Pin, Copy link, and Save controls coexist in production's inline action row.

Screenshots

All content below is fictional local developer demo data, captured against a separate local SQLite database.

View Light Dark
Desktop owner Desktop light Desktop dark
Mobile owner Mobile light Mobile dark
Signed-in reader
Approved pin without owner controls

The Replies tab has no pinned row or pin controls.

Replies without a pin

Interactive flow

Pin a commit, replace it with another, then unpin. This is the real UI and HTTP flow.

Pin, replace, and unpin

Watch the MP4

Validation

  • Merged production through f25e464, including profile tabs, inline stars, private bookmarks, and S3 support. Inspected all automatic merges and resolved the four tab/star conflicts.
  • 110 focused backend Pest tests passed with 1,933 assertions using in-memory SQLite. Coverage includes pin/replace/unpin for owners and signed-in readers on both profile tabs, private moderation state, deletion, stale unpin requests, cursor ordering, counts, activity, lazy partial reloads, stars, and private saved state.
  • Five scoped browser tests passed with 56 assertions. They cover pin/replace/unpin, exactly one card per commit, no pins on Replies, preserved Star and Save controls, tab switching, pagination resets, and existing inline-star behavior. The test runner reported three warnings without diagnostic details.
  • Frontend lint, TypeScript, production frontend build, Pint, scoped PHPStan, scoped Rector dry run, and git diff --check passed.
  • Refreshed all embedded media against the merged inline-star/bookmark layout using a separate local SQLite database on port 8122. Live Chrome flow verified persisted star state, pin/replace/unpin with eight unique cards and no duplicates, no owner pin controls for readers, and no pin on Replies. Desktop/mobile light/dark captures had zero horizontal overflow and no console or JavaScript errors.

Deployment and limits

Run the new nullable foreign-key migration with the normal deployment. No feature dependency changes. The production merge retains its existing S3 dependencies. No production/staging data was accessed or changed. Captures use Chrome with mobile viewport emulation, not physical mobile devices. No full test suite was run.

Temporary login routes and browser failure screenshots were removed before committing. The demo database, seed/capture scripts, and media stayed outside the application repository.

@brendt
brendt merged commit 326a11b into dev-null-sh:production Oct 15, 2026
1 check passed
@xHeaven
xHeaven deleted the t3/pinned-profile-commit branch October 15, 2026 18:38
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