fix(desktop): name project threads after their channel and reflow commit bodies

Hard-wrapped git commit messages were rendered as chat line-breaks, so they stayed a narrow column. The conversation panel now titles itself with a clickable #channel, and the mentions card is labeled Related Conversations.

Signed-off-by: Thomas Petersen <thomasp@squareup.com>
This commit is contained in:
Thomas Petersen
2026-08-14 08:49:17 -04:00
parent 670057a358
commit ce1ebfe6c8
12 changed files with 131 additions and 35 deletions

View File

@@ -65,6 +65,8 @@ export type MarkdownParseInputs = {
components: Components;
content: string;
customEmoji?: CustomEmoji[];
/** Omit or true for chat-style `<br>` on every newline. */
hardLineBreaks?: boolean;
mentionNames?: string[];
searchQuery?: string;
variant: string;
@@ -96,7 +98,7 @@ function buildMarkdownElement(input: MarkdownParseInputs): React.ReactElement {
components: input.components,
remarkPlugins: [
remarkGfm,
remarkBreaks,
...(input.hardLineBreaks === false ? [] : [remarkBreaks]),
remarkSpoilers,
remarkMessageLinks,
[remarkMentions, { mentionNames: input.mentionNames }],
@@ -130,6 +132,7 @@ export function renderCachedMarkdown(
// distinct input tuples. Content is last and needs no prefix: everything
// before it is self-delimiting.
const key =
segment(input.hardLineBreaks === false ? "soft" : "hard") +
segment(input.variant) +
listSegment(input.mentionNames) +
listSegment(input.channelNames) +