Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

Merge remote-tracking branch 'origin/main' into feature/file-upload-cloudfront

yushen1e2263330176
diff --cc apps/web/components/common/rich-text-editor.tsx
index 058ece3631,8614471b00..8780a86c9a
--- a/apps/web/components/common/rich-text-editor.tsx
+++ b/apps/web/components/common/rich-text-editor.tsx
@@@ -12,12 -12,9 +12,12 @@@ import Placeholder from "@tiptap/extens
import Link from "@tiptap/extension-link";
import Typography from "@tiptap/extension-typography";
import Mention from "@tiptap/extension-mention";
+import Image from "@tiptap/extension-image";
- import { Markdown } from "tiptap-markdown";
+ import { Markdown } from "@tiptap/markdown";
import { Extension } from "@tiptap/core";
+import { Plugin, PluginKey } from "@tiptap/pm/state";
import { cn } from "@/lib/utils";
+import type { UploadResult } from "@/shared/hooks/use-file-upload";
import { createMentionSuggestion } from "./mention-suggestion";
import "./rich-text-editor.css";
@@@ -236,12 -159,11 +236,12 @@@ const RichTextEditor = forwardRef<RichT
const debounceRef = useRef<ReturnType<typeof setTimeout>>(undefined);
const onUpdateRef = useRef(onUpdate);
const onSubmitRef = useRef(onSubmit);
+ const onUploadFileRef = useRef(onUploadFile);
- // Helper to get markdown from tiptap-markdown storage
+ // Helper to get markdown from @tiptap/markdown extension
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const getEditorMarkdown = (ed: any): string =>
- ed?.storage?.markdown?.getMarkdown?.() ?? "";
+ ed?.getMarkdown?.() ?? "";
// Keep refs in sync without recreating editor
onUpdateRef.current = onUpdate;
@@@ -263,18 -184,8 +263,14 @@@
LinkExtension,
Typography,
MentionExtension,
+ Image.configure({
+ inline: false,
+ allowBase64: false,
+ HTMLAttributes: { style: "max-width: 100%; height: auto;" },
+ }),
- Markdown.configure({
- html: false,
- transformPastedText: true,
- transformCopiedText: true,
- }),
+ Markdown,
createSubmitExtension(() => onSubmitRef.current?.()),
+ createFileUploadExtension(onUploadFileRef),
],
onUpdate: ({ editor: ed }) => {
if (!onUpdateRef.current) return;
diff --cc apps/web/features/issues/components/comment-card.tsx
index eb1261a420,69c46956b6..85be9106ea
--- a/apps/web/features/issues/components/comment-card.tsx
+++ b/apps/web/features/issues/components/comment-card.tsx
@@@ -186,43 -232,148 +234,149 @@@ function CommentCard(
};
collectReplies(entry.id);
+ const replyCount = allNestedReplies.length;
+ const contentPreview = (entry.content ?? "").replace(/\n/g, " ").slice(0, 80);
+ const reactions = entry.reactions ?? [];
+
return (
- <Card className={`!py-0 !gap-0 overflow-hidden${entry.id.startsWith("temp-") ? " opacity-60" : ""}`}>
- {/* Parent comment */}
- <div className="px-4">
- <CommentRow
- entry={entry}
- currentUserId={currentUserId}
- onEdit={onEdit}
- onDelete={onDelete}
- onToggleReaction={onToggleReaction}
- />
- </div>
+ <Card className={`!py-0 !gap-0 overflow-hidden${isTemp ? " opacity-60" : ""}`}>
+ <Collapsible open={open} onOpenChange={setOpen}>
+ {/* Header — always visible, acts as toggle */}
+ <div className="px-4 py-3">
+ <div className="flex items-center gap-2.5">
+ <CollapsibleTrigger className="shrink-0 text-muted-foreground hover:text-foreground transition-colors">
+ <ChevronRight className={cn("h-3.5 w-3.5 transition-transform", open && "rotate-90")} />
+ </CollapsibleTrigger>
+ <ActorAvatar actorType={entry.actor_type} actorId={entry.actor_id} size={24} />
+ <span className="text-sm font-medium">
+ {getActorName(entry.actor_type, entry.actor_id)}
+ </span>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <span className="text-xs text-muted-foreground cursor-default">
+ {timeAgo(entry.created_at)}
+ </span>
+ }
+ />
+ <TooltipContent side="top">
+ {new Date(entry.created_at).toLocaleString()}
+ </TooltipContent>
+ </Tooltip>
- {/* Replies — flat, separated by border */}
- {allNestedReplies.map((reply) => (
- <div key={reply.id} className="border-t border-border/50 px-4">
- <CommentRow
- entry={reply}
- currentUserId={currentUserId}
- onEdit={onEdit}
- onDelete={onDelete}
- onToggleReaction={onToggleReaction}
- />
+ {!open && contentPreview && (
+ <span className="text-xs text-muted-foreground truncate">
+ {contentPreview}{(entry.content ?? "").length > 80 ? "..." : ""}
+ </span>
+ )}
+ {!open && replyCount > 0 && (
+ <span className="text-xs text-muted-foreground shrink-0 ml-auto">
+ {replyCount} {replyCount === 1 ? "reply" : "replies"}
+ </span>
+ )}
+
+ {open && !isTemp && (
+ <DropdownMenu>
+ <DropdownMenuTrigger
+ render={
+ <Button variant="ghost" size="icon-xs" className="ml-auto text-muted-foreground">
+ <MoreHorizontal className="h-4 w-4" />
+ </Button>
+ }
+ />
+ <DropdownMenuContent align="end">
+ <DropdownMenuItem onClick={() => {
+ navigator.clipboard.writeText(entry.content ?? "");
+ toast.success("Copied");
+ }}>
+ <Copy className="h-3.5 w-3.5" />
+ Copy
+ </DropdownMenuItem>
+ {isOwn && (
+ <>
+ <DropdownMenuSeparator />
+ <DropdownMenuItem onClick={startEdit}>
+ <Pencil className="h-3.5 w-3.5" />
+ Edit
+ </DropdownMenuItem>
+ <DropdownMenuSeparator />
+ <DropdownMenuItem onClick={() => onDelete(entry.id)} variant="destructive">
+ <Trash2 className="h-3.5 w-3.5" />
+ Delete
+ </DropdownMenuItem>
+ </>
+ )}
+ </DropdownMenuContent>
+ </DropdownMenu>
+ )}
+ </div>
</div>
- ))}
-
- {/* Reply input — always visible at bottom */}
- <div className="border-t border-border/50 px-4 py-2.5">
- <ReplyInput
- issueId={issueId}
- placeholder="Leave a reply..."
- size="sm"
- avatarType="member"
- avatarId={currentUserId ?? ""}
- onSubmit={(content) => onReply(entry.id, content)}
- />
- </div>
+
+ {/* Collapsible body */}
+ <CollapsibleContent>
+ {/* Parent comment body */}
+ <div className="px-4 pb-3">
+ {editing ? (
+ <form
+ onSubmit={(e) => { e.preventDefault(); saveEdit(); }}
+ className="pl-10"
+ >
+ <input
+ autoFocus
+ value={editContent}
+ onChange={(e) => setEditContent(e.target.value)}
+ aria-label="Edit comment"
+ className="w-full text-sm bg-transparent border-b border-border outline-none py-1"
+ onKeyDown={(e) => { if (e.key === "Escape") cancelEdit(); }}
+ />
+ <div className="flex gap-2 mt-1.5">
+ <Button size="sm" type="submit">Save</Button>
+ <Button size="sm" variant="ghost" type="button" onClick={cancelEdit}>Cancel</Button>
+ </div>
+ </form>
+ ) : (
+ <>
+ <div className="pl-10 text-sm leading-relaxed text-foreground/85">
+ <Markdown mode="minimal">{entry.content ?? ""}</Markdown>
+ </div>
+ {!isTemp && (
+ <ReactionBar
+ reactions={reactions}
+ currentUserId={currentUserId}
+ onToggle={(emoji) => onToggleReaction(entry.id, emoji)}
+ className="mt-1.5 pl-10"
+ />
+ )}
+ </>
+ )}
+ </div>
+
+ {/* Replies */}
+ {allNestedReplies.map((reply) => (
+ <div key={reply.id} className="border-t border-border/50 px-4">
+ <CommentRow
+ entry={reply}
+ currentUserId={currentUserId}
+ onEdit={onEdit}
+ onDelete={onDelete}
+ onToggleReaction={onToggleReaction}
+ />
+ </div>
+ ))}
+
+ {/* Reply input */}
+ <div className="border-t border-border/50 px-4 py-2.5">
+ <ReplyInput
++ issueId={issueId}
+ placeholder="Leave a reply..."
+ size="sm"
+ avatarType="member"
+ avatarId={currentUserId ?? ""}
+ onSubmit={(content) => onReply(entry.id, content)}
+ />
+ </div>
+ </CollapsibleContent>
+ </Collapsible>
</Card>
);
}
diff --cc apps/web/package.json
index fa89dc5776,1237d3dc71..21538d8b3d
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@@ -17,7 -17,7 +17,8 @@@
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@emoji-mart/data": "^1.2.1",
+ "@floating-ui/dom": "^1.7.6",
+ "@tiptap/extension-image": "^3.21.0",
"@tiptap/extension-link": "^3.20.5",
"@tiptap/extension-mention": "^3.20.5",
"@tiptap/extension-placeholder": "^3.20.5",
diff --cc pnpm-lock.yaml
index 83403b38cf,f2bc365fa1..c6c6a510df
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@@ -72,9 -72,9 +72,12 @@@ importers
'@emoji-mart/data':
specifier: ^1.2.1
version: 1.2.1
+ '@floating-ui/dom':
+ specifier: ^1.7.6
+ version: 1.7.6
+ '@tiptap/extension-image':
+ specifier: ^3.21.0
+ version: 3.21.0(@tiptap/[email protected](@tiptap/[email protected]))
'@tiptap/extension-link':
specifier: ^3.20.5
version: 3.20.5(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])