From 4f0119b2597cb1f72c3020e755f0c6ce965abeb6 Mon Sep 17 00:00:00 2001 From: Nuwan Date: Sun, 8 Feb 2026 19:20:28 +0530 Subject: [PATCH] fix(20): revise plan based on checker feedback - Task 2: Changed from 'auto' to 'checkpoint:pass' (no code changes needed) - Task 3: Explicitly state line 111 destructuring modification - Added VUMTR-01 deferral note in objective section - Updated files_modified to exclude VuContext.js (auto-exposes via pattern) Co-Authored-By: Claude Opus 4.5 --- .../phases/20-vumeter-fixes/20-01-PLAN.md | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.planning/phases/20-vumeter-fixes/20-01-PLAN.md b/.planning/phases/20-vumeter-fixes/20-01-PLAN.md index b3772b5b9..4fd000718 100644 --- a/.planning/phases/20-vumeter-fixes/20-01-PLAN.md +++ b/.planning/phases/20-vumeter-fixes/20-01-PLAN.md @@ -6,8 +6,8 @@ wave: 1 depends_on: [] files_modified: - jam-ui/src/hooks/useVuHelpers.js - - jam-ui/src/context/VuContext.js - jam-ui/src/hooks/useMixerHelper.js + # Note: VuContext.js not modified - it automatically exposes removeVuState via existing pattern autonomous: true must_haves: @@ -43,8 +43,10 @@ Purpose: Address HIGH priority memory leak (VUMTR-02, VUMTR-03) where vuStates o Output: - Modified useVuHelpers.js with removeVuState function -- Modified VuContext.js exposing removeVuState +- Modified VuContext.js exposing removeVuState (automatic via existing pattern) - Modified useMixerHelper.js calling removeVuState on mixer cleanup + +Note: VUMTR-01 (VU callback throttling) is intentionally deferred as a performance optimization, not a memory leak (per Phase 19 audit). @@ -122,13 +124,12 @@ removeVuState callback exists in useVuHelpers.js and is exported in the return o - - Task 2: Expose removeVuState through VuContext - jam-ui/src/context/VuContext.js - -The VuContext.js file already passes all of useVuHelpers return values through the context provider (line 7: `const vuHelpers = useVuHelpers()`), so removeVuState is automatically available. + + Task 2: Verify removeVuState is exposed through VuContext + +The VuContext.js file already passes all of useVuHelpers return values through the context provider (line 7: `const vuHelpers = useVuHelpers()`), so removeVuState is automatically available after Task 1 completes. -**Verification only** - No code changes needed. The existing pattern at lines 6-13 passes the entire vuHelpers object to the context, which now includes removeVuState: +The existing pattern at lines 6-13 passes the entire vuHelpers object to the context: ```javascript export const VuProvider = ({ children }) => { @@ -142,15 +143,15 @@ export const VuProvider = ({ children }) => { }; ``` -Consumers using `useVuContext()` will automatically have access to removeVuState. - +No code changes required - consumers using `useVuContext()` will automatically have access to removeVuState once Task 1 adds it to useVuHelpers. + 1. Read VuContext.js to confirm the pattern passes all useVuHelpers exports -2. Verify useVuHelpers() is called and spread into context value +2. Verify useVuHelpers() is called and its result is passed to context value 3. Confirm no changes are needed to VuContext.js -VuContext automatically exposes removeVuState through the existing vuHelpers spread pattern +VuContext automatically exposes removeVuState through the existing vuHelpers spread pattern - no modifications needed @@ -167,10 +168,7 @@ Implementation steps: import { useVuContext } from '../context/VuContext.js'; ``` - Update line 111 to destructure removeVuState alongside updateVU3: - ```javascript - const { updateVU3, removeVuState } = useVuContext(); - ``` + Modify line 111 from `const { updateVU3 } = useVuContext();` to `const { updateVU3, removeVuState } = useVuContext();` to destructure removeVuState alongside updateVU3. 2. **Add cleanup effect that watches for mixer removals** - After the existing `useEffect` that syncs `isReady` (around line 317), add a new effect that detects when mixers are removed and cleans up their VU state: