sleap
sleap copied to clipboard
Fix status bar showing stale video info when switching videos
Summary
Fixes a bug where the status bar would display information from the previously selected video instead of the currently selected video.
Problem
When selecting a video from the video list (e.g., selecting video 27), the bottom status bar would sometimes show information from the previously selected video (e.g., video 26).
Root Cause
In updateStatusMessage() at sleap/gui/app.py:1314-1325, the index variable was never initialized before the loop that searches for the current video. If the video matching logic failed (e.g., when same_dataset was False), the index variable would:
- Be undefined (causing a NameError in Python), or
- Retain its value from a previous call to the function (causing stale info to be displayed)
Changes
- Initialize
index = Nonebefore the video search loop - Only display video number information if
index is not None - This ensures the status bar always shows correct info for the selected video
Testing
- Select different videos from the video list
- Verify the status bar shows the correct video number and information
- Test with projects containing multiple videos with similar filenames
🤖 Generated with Claude Code