From be90deee04407dddd15453cfe7d8828e1a1da229 Mon Sep 17 00:00:00 2001 From: Sai Prakash Date: Thu, 16 Jul 2026 00:50:39 -0400 Subject: [PATCH 1/2] Render plan descriptions as markdown in the detail card MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since v0.3.26 plan descriptions are authored as markdown (rich text editor / MCP), but PlanDescriptionCard still rendered them as plain text — users saw literal **bold** and pipe-table syntax. Render with ReactMarkdown + remark-gfm using the same prose treatment as the asset content cards. The collapse switches from line-clamp to max-height + overflow-hidden: line-clamp is unreliable across markdown's mixed block children (tables, code blocks). Same expander behavior and overflow detection. Co-Authored-By: Claude Fable 5 --- .../plans/[id]/plan-description-card.tsx | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/app/(dashboard)/plans/[id]/plan-description-card.tsx b/app/(dashboard)/plans/[id]/plan-description-card.tsx index 3a6dc32..2098816 100644 --- a/app/(dashboard)/plans/[id]/plan-description-card.tsx +++ b/app/(dashboard)/plans/[id]/plan-description-card.tsx @@ -1,19 +1,21 @@ 'use client' import { useEffect, useRef, useState } from 'react' +import ReactMarkdown from 'react-markdown' +import remarkGfm from 'remark-gfm' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { AlignLeft, ChevronDown, ChevronUp } from 'lucide-react' import { cn } from '@/lib/utils' -/** Long-form plan description in its own card, clamped to ~5 lines with an expander. */ +/** Long-form plan description in its own card, collapsed to a preview with an expander. */ export function PlanDescriptionCard({ description }: { description: string }) { const [expanded, setExpanded] = useState(false) const [clamped, setClamped] = useState(false) - const textRef = useRef(null) + const contentRef = useRef(null) useEffect(() => { - const el = textRef.current + const el = contentRef.current if (el) setClamped(el.scrollHeight > el.clientHeight + 1) }, [description]) @@ -26,15 +28,17 @@ export function PlanDescriptionCard({ description }: { description: string }) { -

- {description} -

+ {description} + {(clamped || expanded) && (