Skip to content

fix(ui): prevent visual flashing when switching tasks in detail view#311

Merged
bborn merged 1 commit intomainfrom
task/782-in-task-view-switching-tasks-is-very-jan
Jan 31, 2026
Merged

fix(ui): prevent visual flashing when switching tasks in detail view#311
bborn merged 1 commit intomainfrom
task/782-in-task-view-switching-tasks-is-very-jan

Conversation

@bborn
Copy link
Copy Markdown
Owner

@bborn bborn commented Jan 31, 2026

Summary

  • Fix janky/jarring visual flash when switching tasks using up/down arrows in task detail view
  • Add a 500ms grace period after task transitions to prevent focus state changes from causing style flashing
  • Skip focus checking during active transitions (while taskTransitionInProgress is true)

Problem

When switching tasks in the detail view, users experienced a jarring flash of text and style changes. This was caused by:

  1. The focus tick (every 300ms) checking tmux focus state
  2. During transitions, focus state could flip between focused/unfocused
  3. Each focus change invalidated the content cache and re-rendered with different styles (bright vs dimmed borders and text)

Solution

  • Added taskTransitionGraceUntil field to track when focus checks can resume
  • Skip RefreshFocusState() during active transitions and for 500ms after task loads
  • This gives the new detail view time to settle before focus is checked again

Test plan

  • Build passes (go build ./...)
  • All tests pass (go test ./...)
  • Manual testing: Switch between tasks using up/down arrows in detail view - should be smooth without flashing

🤖 Generated with Claude Code

Add a 500ms grace period after task transitions to prevent focus state
changes from causing the UI to flash between focused/unfocused styles.

The issue was that the focus tick (every 300ms) would check tmux focus
and potentially change the focused state during task switching, causing
rapid style changes that appeared as a jarring flash.

The fix:
- Skip RefreshFocusState() during active transitions
- Add a 500ms grace period after task loads before resuming focus checks
- This allows the new detail view to settle before focus is checked

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bborn bborn merged commit 2cb7ded into main Jan 31, 2026
3 checks 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.

1 participant