feat: add supporting data capture, PDF export, and branding settings UI
- API clients for supporting data CRUD and team branding - AddSupportingDataModal with text snippet and screenshot tabs (paste + upload) - SupportingDataPanel collapsible section integrated into both session runners - ExportPreviewModal updated with PDF format and server-side download flow - BrandingSettings component for company name and logo management - Expose team_id in UserResponse schema for branding endpoint access Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,7 @@ export function SessionDetailPage() {
|
||||
const [isLoading, setIsLoading] = useState(true)
|
||||
const [error, setError] = useState<string | null>(null)
|
||||
const [isExporting, setIsExporting] = useState(false)
|
||||
const [exportFormat, setExportFormat] = useState<'markdown' | 'text' | 'html' | 'psa'>(defaultExportFormat)
|
||||
const [exportFormat, setExportFormat] = useState<'markdown' | 'text' | 'html' | 'psa' | 'pdf'>(defaultExportFormat)
|
||||
const [exportContent, setExportContent] = useState<string | null>(null)
|
||||
const [showPreview, setShowPreview] = useState(false)
|
||||
const [copied, setCopied] = useState(false)
|
||||
@@ -51,6 +51,7 @@ export function SessionDetailPage() {
|
||||
const [redactionMode, setRedactionMode] = useState<'none' | 'mask'>('none')
|
||||
const [redactionSummary, setRedactionSummary] = useState<RedactionSummary | null>(null)
|
||||
const [isGeneratingFlow, setIsGeneratingFlow] = useState(false)
|
||||
const [pdfLoading, setPdfLoading] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
if (id) {
|
||||
@@ -223,6 +224,31 @@ export function SessionDetailPage() {
|
||||
}
|
||||
}
|
||||
|
||||
const handleDownloadPdf = async () => {
|
||||
if (!session) return
|
||||
setPdfLoading(true)
|
||||
try {
|
||||
const { apiClient } = await import('@/api/client')
|
||||
const response = await apiClient.post(
|
||||
`/sessions/${session.id}/export`,
|
||||
{ format: 'pdf' },
|
||||
{ responseType: 'blob' }
|
||||
)
|
||||
const url = URL.createObjectURL(response.data)
|
||||
const a = document.createElement('a')
|
||||
a.href = url
|
||||
a.download = `session-export-${session.id}.pdf`
|
||||
a.click()
|
||||
URL.revokeObjectURL(url)
|
||||
analytics.exportGenerated({ session_id: session.id, format: 'pdf' })
|
||||
} catch (error) {
|
||||
console.error('PDF export failed:', error)
|
||||
toast.error('Failed to generate PDF export')
|
||||
} finally {
|
||||
setPdfLoading(false)
|
||||
}
|
||||
}
|
||||
|
||||
const handleSaveAsTree = async (data: SaveAsTreeRequest) => {
|
||||
if (!session) return
|
||||
setIsSavingTree(true)
|
||||
@@ -478,6 +504,7 @@ export function SessionDetailPage() {
|
||||
<option value="text">Plain Text</option>
|
||||
<option value="html">HTML</option>
|
||||
<option value="psa">PSA / Ticket Note</option>
|
||||
<option value="pdf">PDF</option>
|
||||
</select>
|
||||
{session.decisions.length > 1 && (
|
||||
<select
|
||||
@@ -546,6 +573,8 @@ export function SessionDetailPage() {
|
||||
filename={getFilename()}
|
||||
format={exportFormat}
|
||||
onDownload={handleDownload}
|
||||
onDownloadPdf={handleDownloadPdf}
|
||||
pdfLoading={pdfLoading}
|
||||
includeSummary={includeSummary}
|
||||
onToggleSummary={handleToggleSummary}
|
||||
redactionEnabled={redactionMode === 'mask'}
|
||||
|
||||
Reference in New Issue
Block a user