feat: F015 shortlist management
3-panel Shortlists page with left list, center detail, right decision brief panel. AddToShortlistDialog wired into result feed cards and match detail. Full DRAFT→REVIEW_READY→FINALIZED workflow, AI-generated decision brief draft, duplicate prevention, and compare-view integration. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import { useNavigate } from 'react-router'
|
||||
import { MatchCardCompact } from '../match-card/MatchCardCompact'
|
||||
import { buildMatchCardViewModel } from '../../features/matching/matchCardAdapter'
|
||||
import { useCompareStore } from '../../stores/compareStore'
|
||||
import { useShortlistStore } from '../../stores/shortlistStore'
|
||||
import type { UnifiedMatchResult } from '../../domain/unifiedResult'
|
||||
import type { MatchCardAction } from '../match-card/MatchCardViewModel'
|
||||
|
||||
@@ -9,9 +10,17 @@ interface Props {
|
||||
result: UnifiedMatchResult
|
||||
}
|
||||
|
||||
function getResultTitle(result: UnifiedMatchResult): string {
|
||||
if (result.resultType !== 'FUTURE_AVAILABILITY') {
|
||||
return (result as any).property?.title ?? result.matchId
|
||||
}
|
||||
return (result as any).signal?.companyName ?? result.matchId
|
||||
}
|
||||
|
||||
export function UnifiedResultCard({ result }: Props) {
|
||||
const navigate = useNavigate()
|
||||
const { addToCompare, removeFromCompare, isInCompare, isFull } = useCompareStore()
|
||||
const { openAddDialog } = useShortlistStore()
|
||||
const inCompare = isInCompare(result.matchId)
|
||||
|
||||
const actions: MatchCardAction[] = [
|
||||
@@ -20,8 +29,15 @@ export function UnifiedResultCard({ result }: Props) {
|
||||
label: 'Shortlist',
|
||||
actionType: 'SAVE_SHORTLIST',
|
||||
variant: 'secondary',
|
||||
disabled: true,
|
||||
onClick: () => {},
|
||||
onClick: () => openAddDialog({
|
||||
resultId: result.matchId,
|
||||
resultType: result.resultType,
|
||||
title: getResultTitle(result),
|
||||
matchScore: result.matchScore,
|
||||
confidenceScore: result.match.confidenceLevel,
|
||||
sourceLabel: result.resultType,
|
||||
addedBy: 'admin@ideal-sharing.ch',
|
||||
}),
|
||||
},
|
||||
{
|
||||
id: 'compare',
|
||||
|
||||
Reference in New Issue
Block a user