sleap icon indicating copy to clipboard operation
sleap copied to clipboard

Fix status bar showing stale video info when switching videos

Open gitttt-1234 opened this issue 1 month ago • 0 comments

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:

  1. Be undefined (causing a NameError in Python), or
  2. Retain its value from a previous call to the function (causing stale info to be displayed)

Changes

  • Initialize index = None before 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

gitttt-1234 avatar Nov 21 '25 22:11 gitttt-1234