Execute the approved plan in the repository. Project directory:…
- User
Execute the approved plan in the repository.
codeProject directory: /Users/user_c042661f/Documents/reigh-workspace/reigh-app Idea:Fix editor pane snap/jump: allocator should pre-compute coexistence height even when pane is hidden, so no height change occurs on visibility toggle
codeExecution tracking source of truth (`finalize.json`): {"tasks": [ { "id": "T1", "description": "Run PanesContext tests to confirm baseline: exactly 3 failures (shrink-to-fit, keeps-generations, degraded-proportional) against the current 70:30 split code in
src/shared/contexts/PanesContext.tsx:87-127.", "depends_on": [], "status": "pending", "executor_notes": "", "files_changed": [], "commands_run": [ "npx vitest run src/shared/contexts/tests/PanesContext.test.tsx" ], "evidence_files": [ "src/shared/contexts/tests/PanesContext.test.tsx", "src/shared/contexts/PanesContext.tsx" ], "reviewer_verdict": "" }, { "id": "T2", "description": "Replace the body ofgetEffectivePaneHeights(PanesContext.tsx:87-127) with the new 3-tier algorithm. Keep the visibility gate (lines 102-106) for now.\n\nTier 1 \u2014 Ideal fit (unchanged): ifidealEditorPaneHeight + generationsPaneHeight <= viewportHeight, return both at ideal.\n\nTier 2 \u2014 Gens-preserving: ifviewportHeight >= generationsPaneHeight + MIN_EDITOR_HEIGHT, keep gens at configured height, editor = viewport - gens.\n\nTier 3 \u2014 Degraded proportional: when viewport < gens + MIN_EDITOR_HEIGHT. Formula (derived from test contract):\n\nconst denom = 2 * (idealEditorPaneHeight + generationsPaneHeight) - viewportHeight;\nconst effectiveGenerationsPaneHeight = Math.round(viewportHeight * generationsPaneHeight / denom);\nconst effectiveEditorPaneHeight = viewportHeight - effectiveGenerationsPaneHeight;\n\nVerification: viewport=250, ideal=225, gens=300 \u2192 denom=800, gens_eff=round(93.75)=94, editor_eff=156. Matches test expectation.", "depends_on": [ "T1" ], "status": "pending", "executor_notes": "", "files_changed": [ "src/shared/contexts/PanesContext.tsx" ], "commands_run": [], "evidence_files": [], "reviewer_verdict": "" }, { "id": "T3", "description": "Run full PanesContext test suite. All tests should pass \u2014 the 3 previously-failing algorithm tests now match, and the visibility-gate tests still pass because the gate is still in place.", "depends_on": [ "T2" ], "status": "pending", "executor_notes": "", "files_changed": [], "commands_run": [ "npx vitest run src/shared/contexts/tests/PanesContext.test.tsx" ], "evidence_files": [ "src/shared/contexts//PanesContext.test.tsx" ], "reviewer_verdict": "" }, { "id": "T4", "description": "Remove the visibility gate from (PanesContext.tsx):\n1. Delete the early-return block at lines 102-106 (the guard).\n2. Remove and from the function signature and params type.\n3. Update the call site (~line 172-178) to stop passing /. The / vars at lines 148-149 stay (used by context value).", "depends_on": [ "T3" ], "status": "pending", "executor_notes": "", "files_changed": [ "src/shared/contexts/PanesContext.tsx" ], "commands_run": [], "evidence_files": [], "reviewer_verdict": "" }, { "id": "T5", "description": "Update test assertions affected by visibility gate removal in . With the gate gone, effective heights ALWAYS flow through the allocator regardless of visibility.\n\n\n1. "provides initial pane states" (line 139): Both hidden. viewport=600, ideal=540, gens=300. 540+300=840>600 \u2192 Tier 2: editor=600-300=300, gens=300. Change: (line 152). stays.\n2. "keeps the editor at 90% height when it is the only visible top pane" (line 184): Only editor open. Same allocation as initial. Change: (line 196). stays.\n\n ideal-fit (line 200), shrink-to-fit (line 221), keeps-generations (line 243), degraded (line 264) \u2014 already use both-visible assertions that match the allocator.\n\n "effective heights remain stable across visibility toggle" \u2014 render with no panes open, record heights, open editor, assert heights unchanged, open gens, assert heights unchanged.", "depends_on": [ "T4" ], "status": "pending", "executor_notes": "", "files_changed": [ "src/shared/contexts//PanesContext.test.tsx" ], "commands_run": [], "evidence_files": [], "reviewer_verdict": "" }, { "id": "T6", "description": "Run full PanesContext test suite. All tests including the new stability test should pass.", "depends_on": [ "T5" ], "status": "pending", "executor_notes": "", "files_changed": [], "commands_run": [ "npx vitest run src/shared/contexts//PanesContext.test.tsx" ], "evidence_files": [], "reviewer_verdict": "" }, { "id": "T7", "description": "Run downstream consumer tests to verify no breakage: and . These test their own gating logic (padding gated on visibility, offset gated on gens visible) and should be unaffected since they don't assert on specific height values from the allocator.", "depends_on": [ "T6" ], "status": "pending", "executor_notes": "", "files_changed": [], "commands_run": [ "npx vitest run src/app/components/LayoutMainContent.test.tsx src/features/layout/hooks/useBottomOffset.test.ts" ], "evidence_files": [ "src/app/components/LayoutMainContent.tsx", "src/shared/hooks/layout/useBottomOffset.ts" ], "reviewer_verdict": "" } ], "watch_items": [ "Degraded tier formula: . Derived to match the single test fixture {250,225,300}\u2192{156,94}. If additional degraded-tier test cases are added later, verify the formula generalizes (e.g. denom must be >0, which holds when viewport>0 and both panes have positive heights).", "After removing the visibility gate, panes are ALWAYS at coexistence height even when solo. In a 600px viewport with default gens=300, the editor will be 300px instead of 540px when visible alone. This is the explicit trade-off: stable heights over maximal solo size.", "The and variables (PanesContext.tsx:148-149) must NOT be removed \u2014 they're consumed by the context value for UI gating (padding, slide targets). Only the function params and call-site args are removed.", "BottomPaneStrategy.ts and TopPaneStrategy.ts use effective heights for translateY targets. With stable heights, these should no longer jump, but verify visually that the slide animations start from the correct position.", "The initial-state test (line 139) asserts on effectiveEditorHeight. After the gate removal it must change from 540 to 300. Missing this update was flagged in critique as 'plan-misses-additional-test-fallout'.", "Flag plan-degraded-tier-underspecified: the degraded formula was reverse-engineered from a single test case. The formula is mathematically sound (compresses the larger pane more) but hasn't been validated against designer intent. Document it with a comment explaining the derivation." ], "sense_checks": [ { "id": "SC1", "task_id": "T1", "question": "Do exactly 3 tests fail (shrink-to-fit, keeps-generations, degraded-proportional), and do the failure messages show the expected 70:30 split outputs (e.g. editor=420 instead of 300)?", "executor_note": "", "verdict": "" }, { "id": "SC2", "task_id": "T2", "question": "Does the new algorithm preserve the Tier 1 ideal-fit path unchanged (returns ideal heights when combined <= viewport)?", "executor_note": "", "verdict": "" }, { "id": "SC3", "task_id": "T3", "question": "Do ALL PanesContext tests pass (not just the 3 that were failing)?", "executor_note": "", "verdict": "" }, { "id": "SC4", "task_id": "T4", "question": "After removing the visibility gate, does still type-check (no leftover references to /)?", "executor_note": "", "verdict": "" }, { "id": "SC5", "task_id": "T5", "question": "Are BOTH affected assertions updated (initial-state test line 152 AND solo-editor test line 196), and does the new stability test toggle visibility in both directions (none\u2192editor\u2192both)?", "executor_note": "", "verdict": "" }, { "id": "SC6", "task_id": "T6", "question": "Does the new stability test actually prove that effectiveEditorHeight and effectiveGensHeight are identical across all three visibility states (none, editor-only, both)?", "executor_note": "", "verdict": "" }, { "id": "SC7", "task_id": "T7", "question": "Do LayoutMainContent and useBottomOffset tests pass WITHOUT any changes to those test files?", "executor_note": "", "verdict": "" } ], "meta_commentary": " The plan flagged this as underspecified, but the formula is derivable: , then , . This compresses the larger pane (gens) more aggressively, preserving editor priority. Verified: {250, 225, 300} \u2192 denom=800, gensEff=round(93.75)=94, editorEff=156. Add a code comment explaining the derivation.\n\n Each task depends on the prior \u2014 the algorithm must pass tests before removing the gate, and the gate must be removed before updating test assertions.\n\n The new algorithm replaces a simple 70:30 split with a 3-tier system. If any test fails after T2, the formula likely needs adjustment. Phase 2 (T4-T7) is mechanical deletion.\n\n Solo editor at 300px instead of 540px in a 600px viewport is the explicit cost of stable heights. If this feels too aggressive visually, it's a design question \u2014 not a code bug. The plan accepted this trade-off.\n\n on the degraded tier formula. It's non-obvious and derived from a single test fixture. Future maintainers need to understand why is the denominator." } - Assistant