mirror of
https://github.com/block/buzz.git
synced 2026-11-11 20:01:09 +00:00
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:
@@ -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) +
|
||||
|
||||
Reference in New Issue
Block a user