Repository navigation
Pin messages (GRYT-1619) - #281
Merged
Merged
Conversation
Two nullable columns on messages, pinned_at and pinned_by, plus a partial index for listing them. chat:pin sets or clears them and broadcasts chat:pinned to the conversation. chat:pins returns the list, newest pin first. In a channel you need manage_messages to pin. In a DM or group anyone in it can, since there's nobody else to ask. A conversation tops out at 50 pins. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Server half of pinned messages. The client and phone UI come next, in their own PRs.
What changes
messages.pinned_atandpinned_by(both nullable TEXT), plus a partial index on(conversation_id, pinned_at) WHERE pinned_at IS NOT NULL. Existing rows are untouched.chat:pin {conversationId, messageId, pinned, accessToken}. You needmanage_messagesin a channel. In a DM or group any participant can pin. It's rate-limited like edits, and capped at 50 pins per conversation. It broadcastschat:pinned {conversation_id, message_id, pinned_at, pinned_by}to the conversation.chat:pins {conversationId}replies withchat:pins {conversation_id, items}, newest pin first, enriched the same waychat:fetchis. Senders you've blocked are filtered out.Please look at
connection.ts. It's review-required because it's underdb/.Tests:
pins.test.tscovers pin, list order, unpin, the missing-message case and conversation scoping. The full suite passes (1986).🤖 Generated with Claude Code