From c5864dbefdfb801d10e2f4051893edc3c90d6c2b Mon Sep 17 00:00:00 2001 From: esdrasrenan Date: Sun, 5 Oct 2025 03:12:53 -0300 Subject: [PATCH] feat: refine ticket creation and comments experience Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- web/src/app/globals.css | 10 + .../components/tickets/category-select.tsx | 6 +- .../components/tickets/new-ticket-dialog.tsx | 323 ++++++++++-------- .../tickets/ticket-comments.rich.tsx | 2 +- web/src/components/tickets/tickets-table.tsx | 34 +- 5 files changed, 216 insertions(+), 159 deletions(-) diff --git a/web/src/app/globals.css b/web/src/app/globals.css index 400c7d2..fcd5555 100644 --- a/web/src/app/globals.css +++ b/web/src/app/globals.css @@ -138,6 +138,16 @@ .rich-text code { @apply rounded bg-muted px-1 py-0.5 text-xs; } .rich-text pre { @apply my-3 overflow-x-auto rounded bg-muted p-3 text-xs; } + .rich-text .ProseMirror.is-editor-empty::before, + .rich-text .ProseMirror p.is-editor-empty:first-child::before { + color: #94a3b8; + content: attr(data-placeholder); + pointer-events: none; + height: 0; + float: left; + font-weight: 400; + } + @keyframes recent-ticket-enter { 0% { opacity: 0; diff --git a/web/src/components/tickets/category-select.tsx b/web/src/components/tickets/category-select.tsx index 522fdcf..679e860 100644 --- a/web/src/components/tickets/category-select.tsx +++ b/web/src/components/tickets/category-select.tsx @@ -25,6 +25,7 @@ interface CategorySelectProps { subcategoryLabel?: string className?: string secondaryEmptyLabel?: string + layout?: "grid" | "stacked" } function findCategory(categories: TicketCategory[], categoryId: string | null) { @@ -44,6 +45,7 @@ export function CategorySelectFields({ subcategoryLabel = "Secundária", secondaryEmptyLabel = "Selecione uma categoria primária", className, + layout = "grid", }: CategorySelectProps) { const { categories, isLoading } = useTicketCategories(tenantId) const activeCategory = useMemo(() => findCategory(categories, categoryId), [categories, categoryId]) @@ -74,8 +76,10 @@ export function CategorySelectFields({ } }, [categoryId, secondaryOptions, subcategoryId, onSubcategoryChange]) + const containerClass = layout === "stacked" ? "flex flex-col gap-3" : "grid gap-3 sm:grid-cols-2" + return ( -
+