Goal: When editor and generations panes are both visible, they share the viewport without overlapping. Editor takes 90% when alone, shrinks when generations is also visible. Each pane's control handle stays inside its own pane boundary.
Current behavior (broken):
editorPaneHeight is fixed at 90% viewport regardless of other panes (PanesContext.tsx:100)
Only generations adapts via effectiveGenerationsPaneHeight (PanesContext.tsx:124-126), capping to max(viewport - editorHeight, 120px)
On a 600px viewport: editor=540px + generations=120px = 660px → 60px overlap
Control handles position via translateY(dimension - 44) — they sit at the edge of their pane, but with overlap they can collide
Fix approach: Introduce a budget-based allocator in PanesContext that distributes window.innerHeight between both panes when coexisting, with a guaranteed conservation rule: effectiveEditorHeight + effectiveGensHeight <= viewport in all cases. Add effectiveEditorPaneHeight to the context and wire it through EditorPaneTab and LayoutMainContent.
Test baseline status: Existing tests are stale — written against a previous 0.75 editor multiplier and aspirational paddingTop logic. Step 1 reconciles them before any feature work to establish a true green baseline.
Step 1: Reconcile stale tests before any feature work
Scope: Small — fix assertions to match current implementation, run to confirm green
FixPanesContext.test.tsx:144: change expected editorHeight from 450 to 540 (= Math.round(600 * 0.9)).
FixPanesContext.test.tsx:188,195: change expected effectiveGensHeight from 150 to 120 (= Math.min(300, Math.max(600 - 540, 120))).
FixLayoutMainContent.test.tsx:98: remove the paddingTop: '540px' assertion since the component (LayoutMainContent.tsx:32-44) doesn't set paddingTop yet. This assertion will be re-added in Step 5 after the feature is implemented.
Run all three test files to confirm green baseline:
code
npx vitest run src/shared/contexts/__tests__/PanesContext.test.tsx
npx vitest run src/app/components/LayoutMainContent.test.tsx
npx vitest run src/shared/contexts/usePaneLockPolicyState.test.ts
If any other failures emerge, fix them now — do not proceed with feature work on a red baseline.
Phase 2: Core Logic
Step 2: Add budget-based pane allocator to PanesContext (src/shared/contexts/PanesContext.tsx)
Scope: Medium — core logic change
AddeffectiveEditorPaneHeight to PanesContextType interface (after line 18) and PaneLayoutContextType (line 61-71).
Replace the current independent height logic (lines 99-126) with a budget-based allocator that enforces effectiveEditor + effectiveGens <= viewport:
ts
const EDITOR_VIEWPORT_RATIO = 0.9;
const MIN_GENS_HEIGHT = 120;
const MIN_EDITOR_HEIGHT = 200;
const editorPaneHeight = Math.round(window.innerHeight * EDITOR_VIEWPORT_RATIO);
const editorVisible = locks.editor || isEditorPaneOpenState;
const gensVisible = locks.gens || isGenerationsPaneOpenState;
let effectiveEditorPaneHeight = editorPaneHeight;
let effectiveGenerationsPaneHeight = generationsPaneHeight;
if (editorVisible && gensVisible) {
const budget = window.innerHeight;
if (editorPaneHeight + generationsPaneHeight <= budget) {
// Both fit at ideal sizes — no adjustment needed
} else if (budget >= MIN_EDITOR_HEIGHT + MIN_GENS_HEIGHT) {
// Shrink editor to fit. Give gens its configured height (clamped to leave editor its minimum).
effectiveGenerationsPaneHeight = Math.min(generationsPaneHeight, budget - MIN_EDITOR_HEIGHT);
effectiveEditorPaneHeight = budget - effectiveGenerationsPaneHeight;
} else {
// Degraded: viewport too small for both minimums.
// Proportional split preserving the minimum ratio.
effectiveEditorPaneHeight = Math.round(budget * (MIN_EDITOR_HEIGHT / (MIN_EDITOR_HEIGHT + MIN_GENS_HEIGHT)));
effectiveGenerationsPaneHeight = budget - effectiveEditorPaneHeight;
}
} else if (editorVisible) {
// Editor alone — keep 90%, no change to gens
} else if (gensVisible) {
// Gens alone — keep configured height, no change to editor
}
ExposeeffectiveEditorPaneHeight in layoutValue memo (line 165-188), and add it to the dependency array.
Key invariant: When both visible, effectiveEditorPaneHeight + effectiveGenerationsPaneHeight <= window.innerHeight. Always. No exceptions.
Step 3: Update editor pane to use effective height (src/features/editor/components/EditorPaneTab.tsx)
Scope: Small
DestructureeffectiveEditorPaneHeight from usePanes() in useEditorPane (line 8-18).
This ensures TopPanePositionStrategy (TopPaneStrategy.ts:15) positions the handle at translateY(effectiveEditorPaneHeight - 44) — inside the (possibly smaller) editor pane.
Step 4: Add paddingTop for editor pane in LayoutMainContent (src/app/components/LayoutMainContent.tsx)
Scope: Small
DestructureisEditorPaneLocked, isEditorPaneOpen, and effectiveEditorPaneHeight from usePanes() (line 17-25).
Content now gets pushed below the editor pane when it's visible, preventing content from hiding behind it.
Phase 3: Tests & Validation
Step 5: Update and add tests (PanesContext.test.tsx, LayoutMainContent.test.tsx)
Scope: Medium
UpdatePanesContext.test.tsx test consumer (PanesConsumer, line 48-83): add <span data-testid="effectiveEditorHeight">{ctx.effectiveEditorPaneHeight}</span>.
Update existing coexistence test (line 176-196) to verify the budget-based allocator:
Both open on 600px viewport → effectiveEditorPaneHeight = 300, effectiveGensHeight = 300, sum = 600 ≤ 600 ✓
Both open, small 250px viewport (< 320px degraded threshold) → proportional split: effectiveEditorPaneHeight ≈ 156, effectiveGensHeight ≈ 94, sum = 250 ✓
Add test: Both open, gens configured to 400px on 600px viewport → gens gets min(400, 600-200)=400, editor gets 200. Sum = 600 ✓.
Re-addpaddingTop assertion in LayoutMainContent.test.tsx:98 (removed in Step 1), now with the correct value matching effectiveEditorPaneHeight from the mock (540px, since mock has both locked but doesn't go through allocator — update mock's effectiveEditorPaneHeight field accordingly).
Run full test suite:
code
npx vitest run src/shared/contexts/__tests__/PanesContext.test.tsx
npx vitest run src/app/components/LayoutMainContent.test.tsx
npx vitest run src/shared/contexts/usePaneLockPolicyState.test.ts
npx vitest run src/features/layout/hooks/useBottomOffset.test.ts
Step 6: Verify handle positioning and run manual checks
Manual test: Open both panes on desktop browser, verify:
No visual overlap between panes
Handles stay within their respective pane boundaries
Content scrolls independently below both panes
Locking/unlocking one pane causes the other to smoothly resize
Execution Order
Step 1 first — establish green test baseline before any feature work.
Step 2 — core allocator logic (all other steps depend on this).
Steps 3 and 4 in parallel — both consume the new context value, neither depends on the other.
Step 5 after 2-4 — tests validate the implemented feature.
Step 6 last — manual validation.
Validation Order
Run reconciled tests (Step 1) to confirm green baseline.
After implementation, run unit tests (Step 5) — cheapest automated check.
Manual visual test (Step 6) — open both panes in browser, resize viewport to various heights including very small (< 320px).
code
Execution tracking state (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Reconcile stale tests to establish green baseline. Fix PanesContext.test.tsx:144 editorHeight 450\u2192540, lines 188/195 effectiveGensHeight 150\u2192120, and LayoutMainContent.test.tsx:98 remove paddingTop:'540px' assertion. Run all test files to confirm green.",
"depends_on": [],
"status": "done",
"executor_notes": "Reconciled the stale baseline assertions before feature work: PanesContext.test.tsx now expects editorHeight 540 and effective generations height 120 for the pre-feature behavior, and LayoutMainContent.test.tsx no longer expected top padding before that feature existed. Re-ran the gated three-file vitest set and it passed cleanly.",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Add budget-based pane allocator to PanesContext.tsx. Add effectiveEditorPaneHeight to PanesContextType and PaneLayoutContextType interfaces. Replace independent height logic (lines 99-126) with three-tier allocator: ideal fit (both fit), shrink-to-fit (editor absorbs remainder after gens gets its configured height, clamped by MIN_EDITOR_HEIGHT=200), degraded proportional split (viewport < MIN_EDITOR+MIN_GENS=320). Expose effectiveEditorPaneHeight in layoutValue memo. Key invariant: effectiveEditorPaneHeight + effectiveGenerationsPaneHeight <= window.innerHeight ALWAYS.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Added a shared budget-based allocator in PanesContext.tsx with MIN_EDITOR_HEIGHT=200, MIN_GENERATIONS_HEIGHT=120, and three tiers: ideal fit, shrink-to-fit, and degraded proportional split. Exposed effectiveEditorPaneHeight alongside effectiveGenerationsPaneHeight through the layout context so the invariant effectiveEditorPaneHeight + effectiveGenerationsPaneHeight <= window.innerHeight is enforced whenever both panes are visible.",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Update EditorPaneTab.tsx to use effectiveEditorPaneHeight. Destructure from usePanes(), replace editorPaneHeight in paneDimension prop (line 57) and height style (line 87). This makes TopPaneStrategy position the handle at translateY(effectiveEditorPaneHeight - 44), keeping it inside the editor pane.",
"depends_on": [
"T2"
],
"status": "done",
"executor_notes": "Updated EditorPaneTab.tsx to consume effectiveEditorPaneHeight for both the PaneControlTab paneDimension and the fixed pane height, so the top handle tracks the actual allocated editor height instead of the raw 90% height. A search over the file confirms only effectiveEditorPaneHeight remains.",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T4",
"description": "Add paddingTop for editor pane in LayoutMainContent.tsx. Destructure isEditorPaneLocked, isEditorPaneOpen, effectiveEditorPaneHeight from usePanes(). Add paddingTop to contentStyle: (isEditorPaneLocked || isEditorPaneOpen) ? ${effectiveEditorPaneHeight}px : '0px'.",
"depends_on": [
"T2"
],
"status": "done",
"executor_notes": "Updated LayoutMainContent.tsx to read isEditorPaneLocked, isEditorPaneOpen, and effectiveEditorPaneHeight from usePanes(), and to apply paddingTop only while the editor pane is actually visible. Bottom padding continues to use effectiveGenerationsPaneHeight so both content offsets now match the allocated pane sizes.",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T5",
"description": "Update and add tests for the new allocator and paddingTop. In PanesContext.test.tsx: add effectiveEditorPaneHeight to test consumer, update coexistence test to verify budget allocator (editor alone=540, both open 600px viewport: editor=300 gens=300 sum=600, degraded 250px viewport: proportional split sum=250), add test for gens configured 400px on 600px viewport (gens=400 editor=200 sum=600). In LayoutMainContent.test.tsx: re-add paddingTop assertion with correct value matching effectiveEditorPaneHeight from mock. Run full test suite including usePaneLockPolicyState.test.ts and useBottomOffset.test.ts.",
"depends_on": [
"T3",
"T4"
],
"status": "done",
"executor_notes": "Expanded PanesContext.test.tsx to expose effectiveEditorPaneHeight and cover all allocator tiers: ideal-fit (540/60 on a 600px viewport), shrink-to-fit (300/300 on 600px), editor-min clamp (200/400 on 600px), and degraded proportional split (156/94 on 250px). Updated LayoutMainContent.test.tsx to assert paddingTop from the mocked effective editor height and added a hidden-editor case that expects 0px. Ran the four-file vitest set and all 22 tests passed.",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T6",
"description": "Verify handle positioning and manual checks. Confirm TopPaneStrategy.ts:15 uses dimension param (handle inside editor). Confirm BottomPaneStrategy.ts:14 uses dimension param (handle inside generations). Confirm GenerationsPane.tsx passes effectiveGenerationsPaneHeight as paneDimension. Visual verification: open both panes on desktop, check no overlap, handles inside pane boundaries, content scrolls independently, lock/unlock causes smooth resize.",
"depends_on": [
"T5"
],
"status": "done",
"executor_notes": "Verified the handle-positioning code paths without changing them: TopPaneStrategy uses the provided dimension for translateY(dimension - 44), BottomPaneStrategy uses the provided dimension for translateY(-(dimension - 44)), and GenerationsPane already passes effectiveGenerationsPaneHeight to both the tab and the pane surface. A live browser/manual pass was not available in this environment, so the visual portion was validated by code inspection rather than interactive rendering.",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
}
],
"watch_items": [
"Conservation invariant: effectiveEditorPaneHeight + effectiveGenerationsPaneHeight <= window.innerHeight must hold in ALL viewport sizes, including degraded mode (<320px). Verify with arithmetic, not just visual inspection.",
"The existing tests are stale (written against 0.75 multiplier and unimplemented paddingTop). T1 MUST achieve green baseline before any feature work. Do not skip or defer test reconciliation.",
"EditorPaneTab line numbers (57, 87) and PanesContext line numbers (99-126, 165-188) are approximate \u2014 read the actual files before editing. The working tree has uncommitted changes that may shift line numbers.",
"Mobile/tablet regression risk: exclusive lock policy prevents both panes from being locked simultaneously on mobile/tablet, so the allocator won't fire. But tablet hover-coexistence IS possible (open flag: tablet-coexistence-is-not-open-question). Monitor for unexpected behavior on tablet-sized viewports.",
"The 44px handle height constant in TopPaneStrategy and BottomPaneStrategy is assumed correct. If handles appear mispositioned after T3, check this constant.",
"Degraded proportional split (viewport < 320px) is untested in real usage \u2014 only occurs in extreme split-screen scenarios. Watch for visual issues but don't over-engineer.",
"generationsPaneHeight (user-configured) vs effectiveGenerationsPaneHeight (clamped) \u2014 make sure T2 uses the right one in each context. The allocator operates on generationsPaneHeight as input and produces effectiveGenerationsPaneHeight as output.",
"LayoutMainContent.test.tsx mock will need effectiveEditorPaneHeight added to the mock return value in T5. If the mock doesn't go through the allocator, set the mock value explicitly rather than expecting computed output."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Do all three test files (PanesContext.test.tsx, LayoutMainContent.test.tsx, usePaneLockPolicyState.test.ts) pass green after the assertion fixes, with no other failures?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "Does the allocator guarantee effectiveEditorPaneHeight + effectiveGenerationsPaneHeight <= window.innerHeight for viewport heights of 600, 320, 250, and 100? Walk through the math for each.",
"executor_note": "",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Is every reference to editorPaneHeight in EditorPaneTab.tsx replaced with effectiveEditorPaneHeight? No stale references remain that would cause the pane to render at 90% regardless of coexistence?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Does paddingTop correctly use effectiveEditorPaneHeight (not editorPaneHeight), and does it apply only when the editor pane is actually visible (locked OR open)?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T5",
"question": "Do the new tests cover all three allocator tiers (ideal fit, shrink-to-fit, degraded proportional) and verify the conservation invariant (sum <= viewport) in each case?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC6",
"task_id": "T6",
"question": "With both panes open in a browser at various viewport heights (1000px, 600px, 400px), is there zero visual overlap between panes and do both handles stay within their respective pane boundaries?",
"executor_note": "",
"verdict": ""
}
],
"meta_commentary": "Execution guidance:\n\n1. Read before editing. The working tree has uncommitted changes across many files including PanesContext.tsx and LayoutMainContent.tsx. Line numbers in the plan are approximate \u2014 always read the current file state before applying edits.\n\n2. T1 is a gate. Do not proceed to T2 until all tests pass green. The whole point of Phase 1 is to establish a trustworthy baseline. If unexpected failures appear, fix them in T1 \u2014 don't carry red tests forward.\n\n3. T3 and T4 are parallelizable (both depend only on T2, not on each other). Execute them in parallel if possible.\n\n4. Visibility conditions matter. The allocator needs to know which panes are visible. The plan uses locks.editor || isEditorPaneOpenState and locks.gens || isGenerationsPaneOpenState. Verify these are the correct state variables by reading PanesContext.tsx \u2014 the actual variable names may differ from the plan's shorthand.\n\n5. Mock alignment in T5. LayoutMainContent.test.tsx mocks usePanes(). When re-adding the paddingTop assertion, you must add effectiveEditorPaneHeight to the mock return value. The mock bypasses the allocator, so set the value explicitly (e.g., 540 for editor-alone scenario).\n\n6. Don't touch useSlidingPane.ts, BottomPaneStrategy.ts, or GenerationsPane.tsx \u2014 the plan confirms these already work correctly with whatever dimension is passed. Only verify, don't modify.\n\n7. The open minor flag (tablet-coexistence-is-not-open-question) doesn't require code changes \u2014 tablet hover-coexistence goes through the same allocator. But if you have time in T6, test at a tablet-width viewport with both panes hovered open to confirm the allocator handles it."
}
code
Plan metadata:
{
"version": 2,
"timestamp": "2026-03-25T02:44:57Z",
"hash": "sha256:ffa900c7b994ff64a5c636ef8660c8fbd08173c16d650ce1dbe42535038dfb6f",
"changes_summary": "Two changes from v1: (1) Replaced independent-minimum allocator with a budget-based allocator that has three tiers \u2014 ideal fit, shrink-to-fit, and degraded proportional split \u2014 guaranteeing effectiveEditor + effectiveGens <= viewport in ALL viewport sizes. (2) Added Phase 1 (Step 1) to reconcile stale tests before any feature work: PanesContext.test.tsx expects wrong editorHeight (450 vs 540) and effectiveGensHeight (150 vs 120), LayoutMainContent.test.tsx expects paddingTop that doesn't exist yet.",
"flags_addressed": [
"small-viewport-overlap",
"stale-pane-tests-baseline"
],
"questions": [
"Should the editor shrink proportionally (e.g. editor gets 70% and generations gets 30% of viewport) or should generations keep its user-set height and editor absorbs the remainder? The plan assumes editor absorbs the remainder after generations takes its configured height.",
"Is there a minimum useful height for the editor pane content? The plan assumes 200px. If the editor will contain specific content (e.g. a code editor, canvas), the minimum may need to be larger.",
"Should the editor pane height be resizable by the user (drag handle) in the future? If so, the split logic should account for a user-specified editor height rather than always defaulting to 90%."
],
"success_criteria": [
"Both panes visible simultaneously: effectiveEditorPaneHeight + effectiveGenerationsPaneHeight <= window.innerHeight \u2014 guaranteed by budget allocator in ALL viewport sizes, including degraded mode",
"Editor alone: effectiveEditorPaneHeight equals 90% of viewport (unchanged behavior)",
"Generations alone: effectiveGenerationsPaneHeight equals the user-configured generationsPaneHeight (unchanged behavior)",
"Control handles (PaneControlTab) for both panes remain visually inside their respective pane boundaries \u2014 no handle from one pane appears to float over the other pane",
"All existing tests pass on a reconciled baseline (stale assertions fixed first), plus new tests cover the three allocator tiers: ideal fit, shrink-to-fit, and degraded proportional split",
"No regression on mobile/tablet behavior \u2014 exclusive lock policy still prevents both from being locked simultaneously on those platforms"
],
"assumptions": [
"Editor absorbs the remainder after generations takes its configured height (rather than proportional split) \u2014 this keeps generations at its expected size and only shrinks editor from 90% to what's left",
"Minimum editor pane height of 200px is sufficient \u2014 can be adjusted after seeing real editor content",
"The 44px handle height constant in position strategies is correct and doesn't need changing",
"Mobile small phones don't need coexistence logic since exclusive lock policy prevents both panes from being locked simultaneously",
"Tablet is similarly safe due to exclusive lock policy, but hover-coexistence is possible and the budget allocator handles it correctly",
"The generations pane already correctly passes effectiveGenerationsPaneHeight as its paneDimension to PaneControlTab (confirmed in GenerationsPane.tsx)",
"No changes needed to useSlidingPane.ts \u2014 the transform animations work correctly with whatever dimension is passed",
"The degraded proportional split (viewport < 320px) is an acceptable edge case \u2014 this only occurs in extreme scenarios like split-screen dev tools"
],
"structure_warnings": [],
"delta_from_previous_percent": 63.52
}
code
Execution summary:
{
"output": "Implemented the approved pane coexistence plan and captured execution evidence.",
"files_changed": [
"src/shared/contexts/PanesContext.tsx",
"src/features/editor/components/EditorPaneTab.tsx",
"src/app/components/LayoutMainContent.tsx",
"src/shared/contexts/tests/PanesContext.test.tsx",
"src/app/components/LayoutMainContent.test.tsx"
],
"commands_run": [
"git status --short",
"npx vitest run --config config/testing/vitest.config.ts src/shared/contexts/tests/PanesContext.test.tsx src/app/components/LayoutMainContent.test.tsx src/shared/contexts/usePaneLockPolicyState.test.ts",
"npx vitest run --config config/testing/vitest.config.ts src/shared/contexts/tests/PanesContext.test.tsx src/app/components/LayoutMainContent.test.tsx src/shared/contexts/usePaneLockPolicyState.test.ts src/features/layout/hooks/useBottomOffset.test.ts",
"rg -n "editorPaneHeight|effectiveEditorPaneHeight" src/features/editor/components/EditorPaneTab.tsx",
"sed -n '1,220p' src/shared/hooks/panePositioning/strategies/TopPaneStrategy.ts",
"sed -n '1,220p' src/shared/hooks/panePositioning/strategies/BottomPaneStrategy.ts",
"rg -n "effectiveGenerationsPaneHeight" src/features/gallery/components/GenerationsPane/GenerationsPane.tsx"
],
"deviations": [
"Live browser/manual visual verification from T6 could not be performed in this CLI-only environment. I verified handle placement and non-overlap behavior by code inspection and allocator arithmetic instead."
],
"task_updates": [
{
"task_id": "T1",
"status": "done",
"executor_notes": "Reconciled the stale baseline assertions before feature work: PanesContext.test.tsx now expects editorHeight 540 and effective generations height 120 for the pre-feature behavior, and LayoutMainContent.test.tsx no longer expected top padding before that feature existed. Re-ran the gated three-file vitest set and it passed cleanly.",
"files_changed": [
"src/shared/contexts/tests/PanesContext.test.tsx",
"src/app/components/LayoutMainContent.test.tsx"
],
"commands_run": [
"npx vitest run --config config/testing/vitest.config.ts src/shared/contexts/tests/PanesContext.test.tsx src/app/components/LayoutMainContent.test.tsx src/shared/contexts/usePaneLockPolicyState.test.ts"
]
},
{
"task_id": "T2",
"status": "done",
"executor_notes": "Added a shared budget-based allocator in PanesContext.tsx with MIN_EDITOR_HEIGHT=200, MIN_GENERATIONS_HEIGHT=120, and three tiers: ideal fit, shrink-to-fit, and degraded proportional split. Exposed effectiveEditorPaneHeight alongside effectiveGenerationsPaneHeight through the layout context so the invariant effectiveEditorPaneHeight + effectiveGenerationsPaneHeight <= window.innerHeight is enforced whenever both panes are visible.",
"files_changed": [
"src/shared/contexts/PanesContext.tsx"
],
"commands_run": []
},
{
"task_id": "T3",
"status": "done",
"executor_notes": "Updated EditorPaneTab.tsx to consume effectiveEditorPaneHeight for both the PaneControlTab paneDimension and the fixed pane height, so the top handle tracks the actual allocated editor height instead of the raw 90% height. A search over the file confirms only effectiveEditorPaneHeight remains.",
"files_changed": [
"src/features/editor/components/EditorPaneTab.tsx"
],
"commands_run": [
"rg -n "editorPaneHeight|effectiveEditorPaneHeight" src/features/editor/components/EditorPaneTab.tsx"
]
},
{
"task_id": "T4",
"status": "done",
"executor_notes": "Updated LayoutMainContent.tsx to read isEditorPaneLocked, isEditorPaneOpen, and effectiveEditorPaneHeight from usePanes(), and to apply paddingTop only while the editor pane is actually visible. Bottom padding continues to use effectiveGenerationsPaneHeight so both content offsets now match the allocated pane sizes.",
"files_changed": [
"src/app/components/LayoutMainContent.tsx"
],
"commands_run": []
},
{
"task_id": "T5",
"status": "done",
"executor_notes": "Expanded PanesContext.test.tsx to expose effectiveEditorPaneHeight and cover all allocator tiers: ideal-fit (540/60 on a 600px viewport), shrink-to-fit (300/300 on 600px), editor-min clamp (200/400 on 600px), and degraded proportional split (156/94 on 250px). Updated LayoutMainContent.test.tsx to assert paddingTop from the mocked effective editor height and added a hidden-editor case that expects 0px. Ran the four-file vitest set and all 22 tests passed.",
"files_changed": [
"src/shared/contexts/tests/PanesContext.test.tsx",
"src/app/components/LayoutMainContent.test.tsx"
],
"commands_run": [
"npx vitest run --config config/testing/vitest.config.ts src/shared/contexts/tests/PanesContext.test.tsx src/app/components/LayoutMainContent.test.tsx src/shared/contexts/usePaneLockPolicyState.test.ts src/features/layout/hooks/useBottomOffset.test.ts"
]
},
{
"task_id": "T6",
"status": "done",
"executor_notes": "Verified the handle-positioning code paths without changing them: TopPaneStrategy uses the provided dimension for translateY(dimension - 44), BottomPaneStrategy uses the provided dimension for translateY(-(dimension - 44)), and GenerationsPane already passes effectiveGenerationsPaneHeight to both the tab and the pane surface. A live browser/manual pass was not available in this environment, so the visual portion was validated by code inspection rather than interactive rendering.",
"files_changed": [],
"commands_run": [
"sed -n '1,220p' src/shared/hooks/panePositioning/strategies/TopPaneStrategy.ts",
"sed -n '1,220p' src/shared/hooks/panePositioning/strategies/BottomPaneStrategy.ts",
"rg -n "effectiveGenerationsPaneHeight" src/features/gallery/components/GenerationsPane/GenerationsPane.tsx"
]
}
],
"sense_check_acknowledgments": [
{
"sense_check_id": "SC1",
"executor_note": "Yes. After the baseline assertion fixes, the targeted three-file vitest run passed 13/13 tests. The logged usePanes must be used within a PanesProvider error is the expected throw-path from the outside-provider test."
},
{
"sense_check_id": "SC2",
"executor_note": "Yes. With generations configured at 300: 600px viewport -> shrink-to-fit gives 300 + 300 = 600; 320px -> shrink-to-fit gives 200 + 120 = 320; 250px -> degraded proportional gives round(250200/320)=156 and 94, sum 250; 100px -> degraded proportional gives round(100200/320)=63 and 37, sum 100."
},
{
"sense_check_id": "SC3",
"executor_note": "Yes. rg on EditorPaneTab.tsx shows only effectiveEditorPaneHeight references at the destructures, paneDimension, and the inline height; there are no remaining editorPaneHeight usages in that file."
},
{
"sense_check_id": "SC4",
"executor_note": "Yes. LayoutMainContent now uses effectiveEditorPaneHeight for paddingTop, guarded by isEditorPaneLocked || isEditorPaneOpen. The updated test file asserts paddingTop: 360px when visible and paddingTop: 0px when hidden."
},
{
"sense_check_id": "SC5",
"executor_note": "Yes. The tests cover ideal-fit (540+60=600), shrink-to-fit (300+300=600), editor-min clamp (200+400=600), and degraded proportional split (156+94=250), and each coexistence test checks that the effective heights sum to the viewport budget."
},
{
"sense_check_id": "SC6",
"executor_note": "Top and bottom handle placement is wired correctly in code: TopPaneStrategy uses dimension - 44, BottomPaneStrategy uses -(dimension - 44), and GenerationsPane passes effectiveGenerationsPaneHeight. A live browser check at 1000px/600px/400px was not possible here, so this was verified by code-path inspection rather than manual rendering."
}
]
}
code
Execution audit (`execution_audit.json`): not present. Skip that artifact gracefully and rely on `finalize.json`, `execution.json`, and the git diff.
Git diff summary:
M .cursorrules
M docs/structure_detail/debugging.md
M package.json
M src/app/Layout.tsx
M src/app/components/LayoutMainContent.test.tsx
M src/app/components/LayoutMainContent.tsx
M src/features/gallery/components/GenerationsPane/GenerationsPane.tsx
M src/features/layout/hooks/useBottomOffset.test.ts
M src/integrations/supabase/types.ts
M src/shared/components/GlobalHeader/GlobalHeaderDesktop.tsx
M src/shared/components/GlobalHeader/GlobalHeaderShared.tsx
M src/shared/components/GlobalHeader/ProjectSelectorPopover.tsx
M src/shared/components/PaneControlTab.tsx
M src/shared/components/ShotImageManager/ShotImageManagerDesktop.tsx
M src/shared/components/ShotImageManager/components/ImageGrid.tsx
M src/shared/components/ShotImageManager/components/MobileImageGrid.tsx
M src/shared/config/panes.ts
M src/shared/contexts/PanesContext.tsx
M src/shared/contexts/tests/PanesContext.test.tsx
M src/shared/contexts/usePaneLockPolicyState.test.ts
M src/shared/contexts/usePaneLockPolicyState.ts
M src/shared/hooks/tests/useUserUIState.test.ts
M src/shared/hooks/layout/useBottomOffset.ts
M src/shared/hooks/panePositioning/strategies/BottomPaneStrategy.ts
M src/shared/hooks/panePositioning/usePositionStrategy.ts
M src/shared/hooks/segments/segmentSlotAssignment.test.ts
M src/shared/hooks/segments/segmentSlotAssignment.ts
M src/shared/hooks/useSlidingPane.ts
M src/shared/hooks/useUserUIState.ts
M structure.md
M supabase/functions/claim-next-task/index.test.ts
M supabase/functions/claim-next-task/index.ts
?? .megaplan/
?? public/intro-structure-combined.mp4
?? public/intro-structure-video-poster.jpg
?? public/intro-structure-video.mp4
?? public/motion-output-audio.aac
?? src/features/editor/
?? src/features/gallery/components/GenerationsPane/GenerationsPane.test.tsx
?? src/shared/hooks/panePositioning/strategies/TopPaneStrategy.ts
?? src/tools/video-editor/
?? supabase/migrations/20260323213000_add_max_task_wait_to_claim.sql
code
Requirements:
- Be critical.
- Verify each success criterion explicitly.
- Trust executor evidence by default. Only re-verify from scratch where the diff, the audit, or the notes leave a real ambiguity.
- If actual implementation work is incomplete, set top-level `review_verdict` to `needs_rework` so the plan routes back to execute. Use `approved` only when the work itself checks out.
- Cross-reference each task's `files_changed` and `commands_run` against the git diff and any audit findings.
- Review every `sense_check` explicitly and treat perfunctory acknowledgments as a reason to dig deeper.
- Follow this JSON shape exactly:
```json
{
"review_verdict": "approved",
"criteria": [
{
"name": "Review cross-check completed",
"pass": true,
"evidence": "Executor evidence in finalize.json matches the diff and the audit file."
}
],
"issues": [],
"summary": "Approved. The executor evidence is consistent and the remaining findings are advisory only.",
"task_verdicts": [
{
"task_id": "T3",
"reviewer_verdict": "Pass. Review prompt changes match the diff and reference the audit fallback correctly.",
"evidence_files": ["megaplan/prompts.py"]
}
],
"sense_check_verdicts": [
{
"sense_check_id": "SC3",
"verdict": "Confirmed. Both review prompts load execution_audit.json with a graceful fallback."
}
]
}
```
- When the work needs another execute pass, keep the same shape and change only `review_verdict` to `needs_rework`; put the actionable gaps in `issues`, `summary`, and per-task verdicts.
{"review_verdict":"needs_rework","criteria":[{"name":"Execution cross-check against repo state","pass":false,"evidence":"execution_audit.json is absent as expected, so I relied on finalize.json, the execution summary, and the git diff. The bookkeeping is incomplete: the diff contains relevant pane-coexistence changes in src/features/gallery/components/GenerationsPane/GenerationsPane.tsx, src/shared/hooks/layout/useBottomOffset.ts, src/features/layout/hooks/useBottomOffset.test.ts, src/shared/hooks/panePositioning/strategies/BottomPaneStrategy.ts, src/shared/hooks/panePositioning/strategies/TopPaneStrategy.ts, src/shared/components/PaneControlTab.tsx, src/shared/hooks/panePositioning/usePositionStrategy.ts, and src/shared/config/panes.ts, but those files are not reflected in the reported files_changed/task notes."},{"name":"Both panes share the viewport without overlap in all viewport sizes","pass":false,"evidence":"The allocator math in src/shared/contexts/PanesContext.tsx:156-189 is correct per render, but it snapshots window.innerHeight with no resize subscription. PanesProvider is mounted in a static provider tree in src/app/providers/AppProviders.tsx:35-57, so a pure browser resize does not obviously force the provider to recompute. Example: if both panes are allocated 700px + 300px at a 1000px viewport, then the window shrinks to 600px, the stale split can remain 1000px total until some unrelated rerender occurs, violating the stated <= current viewport guarantee."},{"name":"Editor-alone behavior remains 90% of viewport","pass":true,"evidence":"src/shared/contexts/PanesContext.tsx:156-159 still computes editorPaneHeight as Math.round(viewportHeight * 0.9) when the editor has the viewport to itself, and src/shared/contexts/tests/PanesContext.test.tsx:184-198 asserts the 540px result for a 600px viewport."},{"name":"Generations-alone behavior remains the configured height","pass":true,"evidence":"src/shared/contexts/PanesContext.tsx:104-108 returns the raw generationsPaneHeight whenever both panes are not simultaneously visible, preserving the configured generations height outside coexistence mode."},{"name":"Control handles stay inside their own pane boundaries","pass":true,"evidence":"EditorPaneTab passes effectiveEditorPaneHeight to both the control tab and the pane surface in src/features/editor/components/EditorPaneTab.tsx:54-58 and :83-88. GenerationsPane passes effectiveGenerationsPaneHeight to both the bottom tab and surface in src/features/gallery/components/GenerationsPane/GenerationsPane.tsx:50-54 and :100-103. The positioning strategies place the tabs at dimension - 44 / -(dimension - 44) in src/shared/hooks/panePositioning/strategies/TopPaneStrategy.ts:9-15 and src/shared/hooks/panePositioning/strategies/BottomPaneStrategy.ts:9-14."},{"name":"Tests were reconciled and expanded for the allocator tiers","pass":true,"evidence":"src/shared/contexts/tests/PanesContext.test.tsx:200-286 covers ideal-fit, shrink-to-fit, editor-min clamp, and degraded proportional split, and checks the sum against the viewport budget. src/app/components/LayoutMainContent.test.tsx:73-124 covers the reintroduced paddingTop behavior. src/shared/contexts/usePaneLockPolicyState.test.ts:58-112 covers the mobile/tablet lock-policy behavior."},{"name":"Mobile/tablet exclusive-lock behavior remains intact","pass":true,"evidence":"src/shared/contexts/usePaneLockPolicyState.ts still enforces exclusive locks on mobile/tablet, and src/shared/contexts/usePaneLockPolicyState.test.ts:58-112 verifies exclusivity and the editor lock key on mobile/tablet scenarios."}],"issues":["Make pane height allocation reactive to viewport resize. src/shared/contexts/PanesContext.tsx currently derives viewportHeight directly from window.innerHeight during render with no resize-driven state, so the no-overlap invariant is only guaranteed for the last render, not for the current viewport after a live resize. Add a resize subscription or feed viewport height from a reactive source above PanesProvider, and add a regression test for opening both panes and then resizing the window.","Update the execution artifacts to match the actual implementation footprint. finalize.json/execution summary under-report several relevant pane files that are present in the diff, which makes the task audit materially incomplete."],"summary":"Needs rework. The allocator, editor wiring, handle positioning, and test updates mostly match the approved plan, but the core no-overlap guarantee is not maintained across live viewport resizes because PanesProvider is not resize-reactive. The execution artifacts also omit several relevant code changes from their file accounting.","task_verdicts":[{"task_id":"T1","reviewer_verdict":"Pass. The stale baseline assertions were reconciled as described in the diff for PanesContext and LayoutMainContent tests.","evidence_files":["src/shared/contexts/tests/PanesContext.test.tsx","src/app/components/LayoutMainContent.test.tsx"]},{"task_id":"T2","reviewer_verdict":"Needs follow-up. The budget allocator logic is sound for a fresh render, but it is tied to a non-reactive window.innerHeight snapshot, so the conservation invariant can drift after a pure viewport resize.","evidence_files":["src/shared/contexts/PanesContext.tsx","src/app/providers/AppProviders.tsx"]},{"task_id":"T3","reviewer_verdict":"Pass. EditorPaneTab now uses effectiveEditorPaneHeight for both the tab dimension and the pane surface height, with no remaining raw editorPaneHeight usage in that component.","evidence_files":["src/features/editor/components/EditorPaneTab.tsx"]},{"task_id":"T4","reviewer_verdict":"Pass. LayoutMainContent applies paddingTop from effectiveEditorPaneHeight only when the editor is visible, matching the intended content offset behavior.","evidence_files":["src/app/components/LayoutMainContent.tsx","src/app/components/LayoutMainContent.test.tsx"]},{"task_id":"T5","reviewer_verdict":"Pass with a gap. The tests cover the planned allocator tiers, paddingTop, and effective bottom offset usage, but there is still no regression test for a live resize after both panes are already open.","evidence_files":["src/shared/contexts/tests/PanesContext.test.tsx","src/app/components/LayoutMainContent.test.tsx","src/shared/hooks/layout/useBottomOffset.ts","src/features/layout/hooks/useBottomOffset.test.ts"]},{"task_id":"T6","reviewer_verdict":"Partial. The code paths for handle positioning are correct, but the browser/manual validation was not performed, and the execution bookkeeping does not fully reflect the related implementation files present in the diff.","evidence_files":["src/shared/hooks/panePositioning/strategies/TopPaneStrategy.ts","src/shared/hooks/panePositioning/strategies/BottomPaneStrategy.ts","src/features/gallery/components/GenerationsPane/GenerationsPane.tsx","src/shared/components/PaneControlTab.tsx","src/shared/hooks/panePositioning/usePositionStrategy.ts","src/shared/config/panes.ts"]}],"sense_check_verdicts":[{"sense_check_id":"SC1","verdict":"Accepted. The reconciled baseline assertions are present in the test diffs, and nothing in the current repo state contradicts the reported green three-file run."},{"sense_check_id":"SC2","verdict":"Confirmed for fresh renders: the allocator math in PanesContext produces sums equal to the viewport budget at 600, 320, 250, and 100. This sense check does not cover the live-resize gap described above."},{"sense_check_id":"SC3","verdict":"Confirmed. EditorPaneTab uses effectiveEditorPaneHeight at the hook destructure, paneDimension, and pane surface height, with no remaining editorPaneHeight usage in that file."},{"sense_check_id":"SC4","verdict":"Confirmed. LayoutMainContent uses effectiveEditorPaneHeight for paddingTop and gates it behind isEditorPaneLocked || isEditorPaneOpen."},{"sense_check_id":"SC5","verdict":"Confirmed. The PanesContext tests cover ideal-fit, shrink-to-fit, editor-min clamp, and degraded proportional split, and each coexistence case checks the effective-height sum against the viewport budget."},{"sense_check_id":"SC6","verdict":"Not confirmed. The browser/manual pass was not executed, and the current implementation does not reactively recompute pane heights on a pure viewport resize, so zero-overlap behavior across live resize scenarios is not yet guaranteed."}]}