Fix DM feature: deadlock on send, layout displacement, styling inconsistency#168
Merged
Fix DM feature: deadlock on send, layout displacement, styling inconsistency#168
Conversation
…le pages Co-authored-by: asim <17530+asim@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix design and functionality issues on messages page
Fix DM feature: deadlock on send, layout displacement, styling inconsistency
Mar 2, 2026
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.
The DM (direct messaging) feature had three critical issues: sending a message deadlocked the server, the link to DMs displaced the entire chat layout on desktop, and the DM pages used ad-hoc inline styles completely inconsistent with the rest of the app.
Deadlock fix
saveChatMessages()acquiredchatMessagesMutex.RLock()while bothSendChatMessage()andMarkChatMessageAsRead()already held the write lock — a classic reentrant deadlock on Go's non-reentrantsync.RWMutex. Removed the redundant lock fromsaveChatMessages()since callers already guarantee exclusive access.Layout displacement fix
The DMs link was injected as a standalone
<div>before#topic-selector, adding a rogue flex item inside thebody:has(#messages) #contentflex column. Changed to append it as a tab inside the existing.topic-tabscontainer:DM pages restyled
Replaced all inline styles in
messages.gowith the app's design system classes (thread-preview card,thread-message,thread-message-header/author/time/body,card-list,unread-dot,btn,app.Page()). Pages now render consistently with mail and the rest of the app.Renamed the feature from "Messages" to "DMs" throughout (tab, page titles, back links).
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.