Skip to content

Conversation

@andrewting19
Copy link
Contributor

Summary

  • Fixed bug where new external sessions appeared blank/black until clicked or page reloaded
  • Root cause: race condition between render cycle and useEffect that marks sessions as "new"
  • Only apply entry animation (opacity: 0 → 1) for items confirmed as new
  • Disable layout animations for new items to prevent animation conflicts

Test plan

  • Create new external tmux session with matching prefix
  • Verify session entry appears immediately with content visible
  • All lint, typecheck, and tests pass

🤖 Generated with Claude Code

When a new external session was detected, the session list entry would
appear completely blank/black until clicked or page reloaded. This was
caused by a race condition between React's render cycle and the
useEffect that marks sessions as "new":

1. Session added to state, component renders with isNew=false
2. motion.div mounts with initial={{ opacity: 0 }}
3. Animation to opacity: 1 fails to trigger properly
4. useEffect runs, sets isNew=true, but initial only applies at mount

The fix:
- Only apply opacity: 0 initial state when item is confirmed as new
- Disable layout animations for new items to prevent conflicts

Items now appear immediately on first render, and the entry animation
plays correctly once the useEffect confirms them as new.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gbasin gbasin merged commit b889c1a into gbasin:master Jan 21, 2026
1 check passed
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