Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 15, 2026
Contributor
|
Some good things here, but we've already merged some individual features :) |
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.
Four more commit types on the contract from #152, plus the two notifications two of them need. Each type is a DTO, a migration or column, a card and composer fields, and one line in the shared loader. The request, the create action, the controllers and the query classes keep the shape they had after #152.
Summary
tempest/highlight, with a filename, a copy button, and folding past 15 lines. Introduces the sharedCodeHighlighter.[deleted]/[unavailable]tombstones.level: max.Why this design
Every type here is added the five-step way #152 describes, which keeps the shared surface small and the types independent of each other:
App\Rulesrule and its visibility inauthorize(), never in an action, so the actions stay create/update/delete only andArchTestpasses.withContentFor()stays the one eager-loading point. A log page or the moderation queue that mixes every type costs the same number of queries as one with a single commit: two tests (loads a log of every commit type with a bounded number of queries,renders every commit type in the queue with a bounded number of queries) triple every type on the page and assert the query count is unchanged.withContentFor()relation, its owncommit-type-content.tsxcase and its owncomposer-types.tsentry, and the one?CommitTypeDataargument carries all of them throughCreateCommit::handle().What's included
Poll
polls(durationas aPollDurationenum of minutes,closes_at),poll_options(label,position) andpoll_votes(unique per poll and voter).PollDatavalidates 2 to 4 options, distinct once trimmed and case-folded, up to 50 characters each, with emoji shortcodes expanded; it forbids images (allowsImages()is false). The clock starts when the commit is approved (UpdatePollsClosesAt, called fromUpdateCommitStatuses), so moderation never shortens a poll; re-approval never extends it.Voting is two steps because a vote is final: the options are a native radio group in a
fieldsetwith a legend, picking one casts nothing, and the "Vote" button submits optimistically with rollback on failure. Focus stays on the poll after voting, and the bars skip their animation under reduced motion.POST commits/{commit}/poll/votes(CommitPollVoteController, invokable) checks visibility inauthorize()(denyAsNotFound) and the poll's state in aVotablePollrule that returns a reason per refusal (not open yet, your own poll, closed), shown in the toast. The vote is idempotent: a second or racing vote keeps the first.Results are hidden server-side until you may see them.
Poll::toArray()sends each option'svotes_countasnullunless you voted, you are the author, or the poll closed; who voted for what is never serialized. Percentages use the largest-remainder method, so the shares always total 100.Mobile: open light / dark, voted light / dark.
Create → approve → vote (MP4):
Snippet
snippets(languageas aSnippetLanguageenum, nullablefilename,code).SnippetDatacaps the code at 4000 characters or 200 lines, normalizes line breaks to\n, and keeps the code exactly as typed. The newCodeHighlighterservice (scoped) highlights server-side withtempest/highlightand validates the result: it keeps the highlighted HTML only when it is the escaped code wrapped inhl-*spans, and otherwise falls back to the plain escaped code. It caches per language and code, and a page of snippets reads the cache once (afterQueryprefetch), so the same code is highlighted once however often it appears. The card shows the filename or language label and a copy button, with the code folded past 15 lines.Mobile: folded light / dark.
Quote
A nullable self-referencing
commits.quoted_commit_id(null on delete), set in the same insert that creates the quote (via the contract'sattributes(), no extra update).QuotableCommitallows only approved commits that still exist.withContentFor()loads the quoted commit scoped to the viewer, so a quote only ever shows what the viewer may see: a deleted quoted commit is a[deleted]tombstone, one hidden since is[unavailable], and authors still see their own once it stops being public. Moderators reviewing a pending quote see what it quotes whatever its status. The quote button sits after the star wherever the star shows, with theqshortcut (in the keyboard-shortcuts dialog) and a "Quote @handle" dialog that has its own mentions, images and stash.CreateQuoteNotificationsnotifies the quoted author once the quote is approved (never for quoting yourself), the mention path dedupes a quoted author who is also mentioned, and the notification is removed when the quoted commit is deleted.Mobile: card light / dark.
Quoting from the feed (MP4):
Question
A nullable self-referencing
commits.accepted_answer_id(null on delete).QuestionDatahas no fields: a question is its body.PUTandDELETE commits/{commit}/accepted-answer(CommitAnswerAcceptanceController/CommitAnswerRevocationController, invokable) let only the question's author accept or remove an answer, and only an approved, non-deleted direct reply. Accepting locks the question row, replaces the previous answer and its notification, and notifies the new answer's author (not when you accept your own reply).withContentFor()derivesis_answered(true only while the accepted answer exists and is approved). The card shows aquestionoransweredbadge; the thread shows "Accept answer" / "Unaccept" to the author and an "Accepted answer" badge on the chosen reply, updated optimistically.Mobile: answered thread light / dark.
Notifications and export
NotificationTypegainsQuotedandAnswerAccepted;NotificationBuilder::relevant()keeps each only while its commit is approved, the same rule as replies and mentions. The notifications page shows "quoted your commit" and "accepted your answer".CreateExportadds each commit's type and data, and the user's own poll votes on polls everyone can still see. The combined composer toolbar with every type's toggle: light / dark.Performance & security
denyAsNotFoundand validates state in a rule; quotes only point at approved, visible commits.Testing
296 tests added (966 after #152 → 1262), 100% line and type coverage, PHPStan
level: max.By area
PollCommitTest,CommitPollVoteControllerTest,PollApprovalTest(lifecycle: opens on approval for its full duration, admins at once, re-approval never extends, no votes before approval),CreateCommitPollVoteTest(final vote, racing votes, counts),CreatePollCommitTest. Visibility: results hidden from non-voters, shown to the author and after close, never who voted, never to guests.SnippetCommitTest,CodeHighlighterTest(highlights, plain text as-is, escapes markup, falls back when the output is not clean, caches once per page).QuoteCommitsTest,CreateQuoteNotificationsTest(approved only, not yourself, not deleted, idempotent), tombstones, moderator view, guest non-exposure, notification cleanup, mention dedupe.QuestionCommitTest,AcceptedAnswerControllerTest,UpdateAcceptedAnswerTest,DeleteAcceptedAnswerTest.NotificationControllerTest,NotificationBuilderTest,ExportControllerTest.Related work
CreateCommit::handle()and no new call site in the query classes. Several of their good ideas are adopted here, with thanks: select-then-Vote, theqshortcut and the tombstones. Where feat: polls on commits #114 and feat: quote commits #96 would each add a positional argument and edit the log queries, this PR passes one?CommitTypeData. Glad to compare notes.tempest/highlightdependency, through the newCodeHighlighter. Body code blocks are unchanged here; refactor: render body code blocks with the shared highlighter #154 moves them ontoCodeHighlighterand keeps feat: inline code and highlighted code blocks in commits #124's behaviour.withContentFor().Notes for reviewers
tempest/highlight(already a dependency via feat: inline code and highlighted code blocks in commits #124) now also backs snippets.CommitPollVoteController,commits/{commit}/poll/votes;CommitAnswerAcceptanceController/CommitAnswerRevocationController.🤖 Generated with Claude Code