fix(file-list): align Previous and Next with visible Images
Author: wkentaroCreated Aug 6, 2026Updated Aug 25, 2026
Labelsneeds-triagetype:bug
This was generated by AI.
Problem
Previous and Next are enabled without regard to the current File List position. At a boundary their handlers only log and return, so enabled actions can do nothing. In-memory filtering also needs one explicit navigation contract.
Required behavior
- Previous and Next navigate only among Images visible under the active File List filter.
- If the active Image is hidden by the filter, Previous selects the nearest visible Image before it in the original directory order, and Next selects the nearest visible Image after it.
- Disable an action when no visible Image exists in that direction.
- Keep both actions disabled for an empty visible result set.
- Recompute action state after import, filtering, successful navigation, and clearing the filter.
- Apply the same behavior to menu, toolbar, and keyboard shortcut activation.
This builds on #2455, which changes search to an in-memory filter without navigating or replacing the active session.
Verification
Add end-to-end cases for the first and last visible Images, one visible Image, no visible Images, a hidden active Image with matches on both sides, and clearing the filter.
Source: wkentaro/labelme