Skip to content

fix: guard against duplicate teardown from repeated Stop toggles _fadeOutWrapThenStop() scheduled a new setTimeout(stopSplitScreen) on every call, but active doesn't flip false until that timeout fires — so a second toggle() while the fade was in flight queued a second stopSplitScreen()/teardownPanels() run against already-torn-down state. Track the pending timer and no-op repeat calls; stopSplitScreen clears it too, so a direct (non-fade) stop can't leave a stale timer to fire against a later session. Also strengthens two existing tests per review: the multi-panel layout test now asserts each grid's cols*rows actually covers its panel count, and the _bestFitLayout test adds the n=2 case. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NzB8E8ExunXPfJzNotqkx4 - #15

Merged
carochacs merged 1 commit into
mainfrom
claude/pr-23-review-fixes-jg0ysm
Aug 2, 2026

Conversation

@carochacs

Copy link
Copy Markdown
Collaborator

No description provided.

_fadeOutWrapThenStop() scheduled a new setTimeout(stopSplitScreen) on
every call, but active doesn't flip false until that timeout fires —
so a second toggle() while the fade was in flight queued a second
stopSplitScreen()/teardownPanels() run against already-torn-down
state. Track the pending timer and no-op repeat calls; stopSplitScreen
clears it too, so a direct (non-fade) stop can't leave a stale timer
to fire against a later session.

Also strengthens two existing tests per review: the multi-panel layout
test now asserts each grid's cols*rows actually covers its panel
count, and the _bestFitLayout test adds the n=2 case.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NzB8E8ExunXPfJzNotqkx4
@carochacs
carochacs merged commit a86713c into main Aug 2, 2026
@carochacs
carochacs deleted the claude/pr-23-review-fixes-jg0ysm branch August 2, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants