From 484e74c295038e41cb815f2e08f450abe561d371 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Sun, 5 Apr 2026 11:21:42 +0200 Subject: [PATCH] refactor(web): migrate CommentBox to WritePreview (controlled) Replace inline write/preview tab rendering with WritePreview composition component in controlled mode, since CommentBox resets preview state after submitting. Co-Authored-By: Claude Opus 4.6 (1M context) --- webui2/src/components/bugs/CommentBox.tsx | 56 ++++++++--------------- 1 file changed, 18 insertions(+), 38 deletions(-) diff --git a/webui2/src/components/bugs/CommentBox.tsx b/webui2/src/components/bugs/CommentBox.tsx index 636cd43083a1d5f87eebd21d93cf03a6eaeaaf25..3ed7e189cea5c9f0f7b81a0f748314668de3f9ca 100644 --- a/webui2/src/components/bugs/CommentBox.tsx +++ b/webui2/src/components/bugs/CommentBox.tsx @@ -13,6 +13,7 @@ import { Markdown } from "@/components/content/Markdown"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Button } from "@/components/ui/button"; import { Textarea } from "@/components/ui/textarea"; +import * as WritePreview from "@/components/ui/write-preview"; import { useAuth } from "@/lib/auth"; interface CommentBoxProps { @@ -81,44 +82,23 @@ export function CommentBox({ bugPrefix, bugStatus, ref_ }: CommentBoxProps) {
- {/* Write / Preview tabs */} -
- - -
- - {preview ? ( -
- -
- ) : ( -