feat: Corrections tab — SFT candidate import, review, and JSONL export #15

Merged
pyr0ball merged 99 commits from feat/sft-corrections into main 2026-04-08 22:19:01 -07:00
3 changed files with 24 additions and 2 deletions
Showing only changes of commit ce1b8c2215 - Show all commits

View file

@ -9,6 +9,7 @@ vi.mock('../composables/useCardAnimation', () => ({
snapBack: vi.fn(), snapBack: vi.fn(),
animateDismiss: vi.fn(), animateDismiss: vi.fn(),
updateAura: vi.fn(), updateAura: vi.fn(),
reset: vi.fn(),
})), })),
})) }))

View file

@ -54,12 +54,18 @@ const motion = useMotion()
const cardEl = ref<HTMLElement | null>(null) const cardEl = ref<HTMLElement | null>(null)
const isExpanded = ref(false) const isExpanded = ref(false)
const { pickup, setDragPosition, snapBack, animateDismiss, updateAura } = useCardAnimation(cardEl, motion) const { pickup, setDragPosition, snapBack, animateDismiss, updateAura, reset } = useCardAnimation(cardEl, motion)
watch(() => props.dismissType, (type) => { watch(() => props.dismissType, (type) => {
if (type) animateDismiss(type) if (type) animateDismiss(type)
}) })
// When a new card loads into the same element, clear any inline styles left by the previous animation
watch(() => props.item.id, () => {
reset()
isExpanded.value = false
})
// Toss gesture state // Toss gesture state
const isHeld = ref(false) const isHeld = ref(false)
const pickupX = ref(0) const pickupX = ref(0)

View file

@ -80,5 +80,20 @@ export function useCardAnimation(
utils.set(cardEl.value, { background: color }) utils.set(cardEl.value, { background: color })
} }
return { pickup, setDragPosition, snapBack, animateDismiss, updateAura } function reset() {
if (!cardEl.value) return
// Instantly restore initial card state — called when a new item loads into the same element
utils.set(cardEl.value, {
x: 0,
y: 0,
scale: 1,
opacity: 1,
rotate: 0,
borderRadius: CARD_RADIUS,
background: 'transparent',
filter: 'none',
})
}
return { pickup, setDragPosition, snapBack, animateDismiss, updateAura, reset }
} }