mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-24 17:07:08 +08:00
Follow-up cleanup on top of the badge + toast change. Addresses the
B-grade items I called out in self-review:
- Extract MemoryAutoCaptureToggle component. MemoryDetailsHeader was
inlining a 20-line Tailwind blob; pull it into a small presentational
component with prop-level JSDoc and a single accessible button.
Header now reads as orchestration only.
- Replace the hand-rolled status pill with the existing Badge primitive
(variant=successStatic / secondaryStatic, size=sm). One source of
truth for badge tokens across the app — no more drifting Tailwind
blobs.
- Route all user-visible Auto-capture copy through i18n
(memories.autoCapture.{label,stateOn,stateOff,ariaEnable,ariaDisable,
toastEnabled,toastDisabled} in en.json). No more hardcoded English
in TS.
- Export NextIsActive from useAutoCaptureDebouncedToggle so the
toggle component can type its onToggle prop precisely.
- Add focused unit tests for useAutoCaptureDebouncedToggle in
isolation (debounce, on→off→on collapse, success/error callbacks,
memory-id cleanup, no-memory no-op). Previously only covered through
useMemoriesData integration tests.
- Update MemoryDetailsHeader.test.tsx to assert against the new
state-aware aria-labels and the badge testid.
74/74 memories suite green, 841/841 across FlowPage + createMemoryModal.