From 3aff628f52319b009f93d5643129a12b2390e50d Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 1 Jul 2026 15:21:58 +0800 Subject: [PATCH] feat: redesign ticket detail experience --- .../src/features/tickets/TicketComments.tsx | 22 +++- .../src/features/tickets/TicketDetailPage.tsx | 110 +++++++++++------- .../src/features/tickets/TicketMetaPanel.tsx | 59 ++++++++++ .../features/tickets/TicketStatusTimeline.tsx | 40 +++++-- .../tickets/TicketTransitionDialog.tsx | 92 +++++++++++++++ frontend/src/features/tickets/api.ts | 12 +- 6 files changed, 282 insertions(+), 53 deletions(-) create mode 100644 frontend/src/features/tickets/TicketMetaPanel.tsx create mode 100644 frontend/src/features/tickets/TicketTransitionDialog.tsx diff --git a/frontend/src/features/tickets/TicketComments.tsx b/frontend/src/features/tickets/TicketComments.tsx index c2ae4e1..6661187 100644 --- a/frontend/src/features/tickets/TicketComments.tsx +++ b/frontend/src/features/tickets/TicketComments.tsx @@ -2,6 +2,7 @@ import * as React from 'react' import { AppSection } from '@/components/app/AppSection' import { Button } from '@/components/ui/button' +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' import { Textarea } from '@/components/ui/textarea' import { addTicketComment } from './api' @@ -9,20 +10,33 @@ import { addTicketComment } from './api' export function TicketComments({ ticketId }: { ticketId: number }) { const [content, setContent] = React.useState('') const [lastComment, setLastComment] = React.useState('') + const [commentMode, setCommentMode] = React.useState('internal') async function handleSubmit(event: React.FormEvent) { event.preventDefault() if (!content.trim()) return - const comment = await addTicketComment(ticketId, content) + const comment = await addTicketComment(ticketId, content, { + comment_type: commentMode === 'public' ? 'user_reply' : 'internal_note', + visibility: commentMode === 'public' ? 'public' : 'internal' + }) setLastComment(comment.content) setContent('') } return ( - +
+