feat: improve admin observability and translation-first summaries

This commit is contained in:
cesnimda
2026-03-22 21:37:30 +01:00
parent 8014c1e890
commit 4c49ffb0d6
8 changed files with 585 additions and 261 deletions
@@ -155,7 +155,10 @@ export default function JobDetailsDialog({ open, jobId, onClose }: Props) {
const title = job ? `${job.company?.name ?? ""} - ${job.jobTitle}` : "Job Application";
const checklist = [job?.hasResume ? "Resume" : null, job?.hasCoverLetter ? "Cover letter" : null, job?.hasPortfolio ? "Portfolio" : null, job?.hasOtherAttachment ? "Other" : null].filter(Boolean).join(", ") || "";
const summaryFirstText = job?.fullSummary ?? job?.shortSummary ?? "No summary yet.";
const rawDescriptionText = job?.translatedDescription || job?.description || "";
const translatedDescriptionText = job?.translatedDescription?.trim() || "";
const originalDescriptionText = job?.description?.trim() || "";
const showTranslatedText = translatedDescriptionText.length > 0;
const showOriginalText = originalDescriptionText.length > 0;
const fitLevel = useMemo(() => getFitLevel(candidateFit), [candidateFit]);
return (
@@ -219,7 +222,18 @@ export default function JobDetailsDialog({ open, jobId, onClose }: Props) {
</Box>
<Typography sx={{ whiteSpace: "pre-wrap" }}>{summaryFirstText}</Typography>
</Box>
{rawDescriptionText ? <Box sx={{ gridColumn: "1 / -1" }}><Typography variant="overline">Original role text</Typography><Typography sx={{ whiteSpace: "pre-wrap", color: "text.secondary" }}>{rawDescriptionText}</Typography></Box> : null}
{showTranslatedText ? (
<Box sx={{ gridColumn: "1 / -1" }}>
<Typography variant="overline">Translated role text</Typography>
<Typography sx={{ whiteSpace: "pre-wrap" }}>{translatedDescriptionText}</Typography>
</Box>
) : null}
{showOriginalText ? (
<Box sx={{ gridColumn: "1 / -1" }}>
<Typography variant="overline">Original role text</Typography>
<Typography sx={{ whiteSpace: "pre-wrap", color: "text.secondary" }}>{originalDescriptionText}</Typography>
</Box>
) : null}
<Box sx={{ gridColumn: "1 / -1" }}><Typography variant="overline">Notes</Typography><Typography sx={{ whiteSpace: "pre-wrap" }}>{job?.notes ?? ""}</Typography></Box>
</Box>
)}