Repository navigation
feat: quote commits - #96
Merged
Merged
Conversation
# Conflicts: # app/Actions/CreateCommit.php # app/Http/Controllers/ModerationController.php # app/Queries/CommitAncestorsQuery.php # resources/js/components/commit-card.tsx
# Conflicts: # PRODUCT.md # app/Actions/CreateCommit.php # app/Actions/DeleteCommit.php # app/Actions/ModerateCommits.php # app/Http/Controllers/CommitController.php # app/Http/Controllers/ModerationController.php # app/Http/Controllers/UserController.php # app/Http/Requests/CreateCommitRequest.php # app/Models/Commit.php # app/Queries/CommitAncestorsQuery.php # app/Queries/LogQueries/EveryoneLogQuery.php # app/Queries/LogQueries/FollowingLogQuery.php # app/Queries/NotificationBuilder.php # database/factories/NotificationFactory.php # resources/js/pages/notification/index.tsx # resources/js/types/commit.ts # resources/js/types/notification.ts # tests/Feature/Controllers/NotificationControllerTest.php # tests/Unit/Actions/CreateCommitTest.php # tests/Unit/Actions/DeleteCommitTest.php # tests/Unit/Actions/DeleteUserTest.php
# Conflicts: # resources/js/components/commit-card.tsx
nunomaduro
marked this pull request as draft
October 15, 2026 17:26
This was referenced Oct 15, 2026
Member
|
Before we consider your pull request today, can you fix the conflicts? Thank you! |
Member
Author
On it! |
# Conflicts: # app/Actions/CreateCommit.php # app/Actions/UpdateCommitStatuses.php # app/Http/Controllers/ModerationController.php # app/Http/Requests/CreateCommitRequest.php # resources/js/components/commit-card.tsx # tests/Unit/Actions/ApproveCommitTest.php # tests/Unit/Models/CommitTest.php
Member
Author
|
Fixed, gonna mark it ready for review. |
xHeaven
marked this pull request as ready for review
October 16, 2026 08:55
This reverts commit 0f160aa.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Quote a commit. Every commit you can see gets a "Quote" action in its action row, next to the star. It opens a dialog with the commit previewed under a textarea. What you write is a new commit of your own, with the quoted commit embedded under its body as a compact card. Clicking the card opens the quoted commit's page.
How it works
quoted_commit_idoncommits. It is a self-referencing FK withnullOnDeleteand its own index.[deleted]tombstone. No author or body is sent, becauseCommit::toArray()already reduces a trashed commit to a tombstone.commitsrate limiter.quoted_commit_idgoes throughVisibleCommit, which now takes a custom message ("That commit is no longer available to quote."). It is alsoprohibits:parent_id, so a quote is always top-level and lives in logs, not inside threads.CommitBuilder::withQuotedCommitFor($viewer)eager-loads the quoted commit withwithTrashed()->visibleTo($viewer)plus its author. If the quoted commit is later rejected, or is someone else's pending commit, the viewer getsquoted_commit: nulland the card reads[unavailable] This commit isn't available.The author of the quoted commit still sees it, with its status badge. The moderation queue loads it unfiltered so moderators have the context.NotificationType::Quotedgoes to the quoted commit's author. It followsNotifyAboutRepliesexactly:NotifyAboutQuotesaction works as a pointer, not a copy:commit_idis the quote, the key isquoted:{id}, and it usesinsertOrIgnore.CreateCommit(admins) andModerateCommitson approval, and never fires for quoting yourself.NotificationBuilder::relevant()treats it like a reply, so it is hidden while the quote is not approved.DeleteCommitremoves it when either the quote or the quoted commit is deleted.stash@{0}draft, a counter, ⌘/Ctrl+Enter, and thequoteerror bag.qworks on the focused commit through the existingaria-keyshortcutslookup, and the?sheet lists it.ExportPersonalDatanow includesquoted_commit_idon each commit (additive,schema_versionstays 1).Decisions worth a look
DESIGN.mdsays "The only count on a commit is its stars", and a count would have nowhere to link to, since there is no page listing quotes. If you want one later, the indexedquoted_commit_idalready makes it a cheapwithCount.VisibleCommit. Others see[unavailable]until it is approved.--quotefor the CLI. It doesn't fit cleanly. The signed payload istimestamp\nnonce\nreply_to\nbody, so adding a quote means changing the signed format inVerifySignedCommitand the script, and generalizingFindCommitByReference's reply-specific error messages. That is security-sensitive and better as its own PR.Video
Quoting a commit from the log, then opening the quoted commit
MP4
The demo user isn't an admin, so the new quote lands as
pendingwith the usual review toast.Screenshots
At 2x. All demo data is seeded locally.
Log with quotes (a long URL in the quoted body)
[unavailable](quoted commit rejected after being quoted) and[deleted]Quote dialog
Commit page
Notifications
Each page is marked as read once shown, so only the first shot shows the unread state.
qin the shortcut sheetValidation
quotes(), soft and force delete behavior, and that a tombstone never carries the quote.NotifyAboutQuotes: approved only, not for deleted quoted commits, not for quoting yourself, idempotent.CreateCommit,ApproveCommit(s),DeleteCommitandDeleteUser.NotificationBuilder: relevance, and deletion along with either commit.CommitController: quoting; validation for pending, rejected, deleted, unknown, and quote plus reply; the embed, the tombstone and the no-leak case on the commit page.tests/Browser/QuoteCommitTest.php, by mouse and withqplus ⌘/Ctrl+Enter.bun run test:typesandbun run test:lintall pass.