From 87aae6eefcc54dc72a878175f65c6d34b0687346 Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Thu, 19 Mar 2026 20:00:27 -0700 Subject: [PATCH] feat(signals): add Unrelated and Digest reclassify chips to InterviewCard --- web/src/components/InterviewCard.vue | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/web/src/components/InterviewCard.vue b/web/src/components/InterviewCard.vue index 23bb944..e2f6d81 100644 --- a/web/src/components/InterviewCard.vue +++ b/web/src/components/InterviewCard.vue @@ -63,31 +63,34 @@ function toggleBodyExpand(sigId: number) { expandedSignalIds.value = next } -// Re-classify chips — neutral triggers two-call dismiss path +// Re-classify chips — neutral/unrelated/digest trigger two-call dismiss path const RECLASSIFY_CHIPS = [ { label: '🟡 Interview', value: 'interview_scheduled' as const }, { label: '✅ Positive', value: 'positive_response' as const }, { label: '🟢 Offer', value: 'offer_received' as const }, { label: '📋 Survey', value: 'survey_received' as const }, { label: '✖ Rejected', value: 'rejected' as const }, - { label: '— Neutral', value: 'neutral' }, + { label: '🚫 Unrelated', value: 'unrelated' }, + { label: '📰 Digest', value: 'digest' }, + { label: '— Neutral', value: 'neutral' }, ] as const -async function reclassifySignal(sig: StageSignal, newLabel: StageSignal['stage_signal'] | 'neutral') { - if (newLabel === 'neutral') { - // Optimistic removal — neutral signals are dismissed +const DISMISS_LABELS = new Set(['neutral', 'unrelated', 'digest'] as const) + +async function reclassifySignal(sig: StageSignal, newLabel: StageSignal['stage_signal'] | 'neutral' | 'unrelated' | 'digest') { + if (DISMISS_LABELS.has(newLabel)) { + // Optimistic removal const arr = props.job.stage_signals const idx = arr.findIndex(s => s.id === sig.id) if (idx !== -1) arr.splice(idx, 1) - // Two-call path: persist corrected label then dismiss (Avocet training hook) + // Two-call path: persist label (Avocet training hook) then dismiss await useApiFetch(`/api/stage-signals/${sig.id}/reclassify`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ stage_signal: 'neutral' }), + body: JSON.stringify({ stage_signal: newLabel }), }) await useApiFetch(`/api/stage-signals/${sig.id}/dismiss`, { method: 'POST' }) } else { - // Optimistic local re-label — Vue 3 proxy tracks the mutation const prev = sig.stage_signal sig.stage_signal = newLabel const { error } = await useApiFetch(`/api/stage-signals/${sig.id}/reclassify`, {