feat(web): improve comment panel and trigger UI

This commit is contained in:
CREDO23 2026-01-19 14:37:38 +02:00
parent d99722cfdc
commit f008acecfc
8 changed files with 56 additions and 24 deletions

View file

@ -17,7 +17,7 @@ export function CommentPanel({
onEditComment,
onDeleteComment,
isSubmitting = false,
maxHeight = 400,
maxHeight,
}: CommentPanelProps) {
const [isComposerOpen, setIsComposerOpen] = useState(false);
@ -44,13 +44,17 @@ export function CommentPanel({
const hasThreads = threads.length > 0;
const showEmptyState = !hasThreads && !isComposerOpen;
// Ensure minimum usable height for empty state + composer button
const minHeight = 180;
const effectiveMaxHeight = maxHeight ? Math.max(maxHeight, minHeight) : undefined;
return (
<div className="flex w-80 flex-col rounded-lg border bg-card">
<div
className="flex w-85 flex-col rounded-lg border bg-card"
style={effectiveMaxHeight ? { maxHeight: effectiveMaxHeight } : undefined}
>
{hasThreads && (
<div
className="overflow-y-auto"
style={{ maxHeight }}
>
<div className="min-h-0 flex-1 overflow-y-auto scrollbar-thin">
<div className="space-y-4 p-4">
{threads.map((thread) => (
<CommentThread

View file

@ -2,7 +2,6 @@ import type { CommentThreadData } from "../comment-thread/types";
import type { MemberOption } from "../member-mention-picker/types";
export interface CommentPanelProps {
messageId: number;
threads: CommentThreadData[];
members: MemberOption[];
membersLoading?: boolean;