Sprint 5.5 Clean FTD — triage 21→14 actives (cap 15)

fix(StatCards): replace plan === 'free' with !hasAccess(plan, 'dashboard') (FTD-39)
refactor(useAudioRecorder): move optionsRef assignment to useEffect (FTD-38)
docs(TECH_DEBT): v1.27 — freeze FTD-09/33/42, close FTD-14/35/38/39
This commit is contained in:
Hermann_Kitio 2026-04-26 18:57:50 +03:00
parent 3a3fa6272d
commit 5a31819bca
4 changed files with 78 additions and 106 deletions

View file

@ -15,7 +15,7 @@ import { Card } from '@/shared/ui/Card'
import { formatRelativeDate } from '@/shared/lib/date'
import { isEcrit } from '@/entities/production/lib'
import type { SimulationListItem } from '@/entities/production/types'
import type { Plan } from '@/entities/user/lib'
import { hasAccess, type Plan } from '@/entities/user/lib'
interface StatCardsProps {
plan: Plan
@ -87,7 +87,7 @@ function SimulationsRestantesCard({
style={{ width: `${pct}%` }}
/>
</div>
{plan === 'free' && (
{!hasAccess(plan, 'dashboard') && (
<p className="text-xs text-ink-tertiary">Renouvellement offert à l'upgrade</p>
)}
</StatShell>

View file

@ -76,10 +76,10 @@ export function useAudioRecorder(options: UseAudioRecorderOptions = {}): UseAudi
// Capture options dans une ref pour éviter de réabonner les effets sur
// chaque render (les callers fournissent souvent des fonctions inline).
// Refacto propre via useEffect tracé en FTD-38.
const optionsRef = useRef(options)
// eslint-disable-next-line react-hooks/refs
optionsRef.current = options
useEffect(() => {
optionsRef.current = options
})
const maxReachedFiredRef = useRef(false)
const cleanupTimer = useCallback(() => {