Repository navigation
LR-IMP-LOCAL: browsing a Local folder keeps or picks the active photo (fixes #1447) - #1820
Merged
Merged
Conversation
…storytold#1447) library.browse (engine and the UI's background read) switched the source to the folder without touching the selection, so the previous view's photo stayed active: Photo Grid marked nothing, and Detail, the histogram and the info showed a photo the folder doesn't hold. Browsing now follows library.source's rule through a shared Session::keep_active_in_view: the active photo stays when the folder shows it, else the folder's first photo becomes active (also as the background read's batches arrive).
Member
|
Thank you @bitshiftza! This landed on main in integration batch 36 (#1843). If you haven't already, please join our Discord: https://discord.gg/artcraft. We'd love to have you there. |
pehonnet
pushed a commit
to pehonnet/lightcraft
that referenced
this pull request
Oct 15, 2026
Batches 36's doc conflicts kept main's side of rows both sides had touched; for some, main had not changed the row, so the PR's update was lost. Restored: LR-VIEW-FILMSTRIP (storytold#1482), KEYC-COMPARE (storytold#1491 + storytold#1555), LR-IMP-LOCAL (storytold#1547 + storytold#1820), LR-LIB-STACK (storytold#1556), gaps 28 (storytold#1555), 2 (storytold#1029) and 23 (storytold#1038), ROADMAP UI/UX (storytold#1038). The raw-parity by-maker and by-use tables are re-measured with coverage.py (545 verified, ~94% / ~85%). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1447
What was wrong
Photo Grid is a grid-only view by design, as Lightroom's Photo Grid is: there is no large preview above the grid in any source, so that part of the report is expected. The bug behind it was the active photo. Choosing an album or another source already keeps the active photo if the new view shows it, and otherwise makes the first photo active. Showing a Local folder didn't do this.
library.browseswitched the source without touching the selection, so the photo from the previous view stayed active even though the folder doesn't hold it. As a result:What changed
Session::keep_active_in_view(engine) holds the rule every source follows. The active photo stays if the view shows it. Otherwise the view's first photo becomes the active and only selected photo, or nothing is selected when the view is empty.library.sourcenow uses it instead of its own copy.library.browseapplies the rule in the engine command and in the UI's background folder read: once when the view switches to the folder, and again as each batch of the folder's photos arrives, but only while that folder is still on screen. A photo you click in the folder while it loads stays selected.This matches Lightroom: opening a folder or collection shows one of its photos as the active one, never a photo from another source.
Tests
tests_browse_active::browsing_a_local_folder_makes_its_first_photo_active(UI, headless): with a library photo active, browsing a folder of PNGs makes the folder's first photo active and selected, and Detail opens on it. Browsing back to the folder keeps a folder photo that was active. Fails before the fix.tests_browse_active::choosing_an_album_keeps_or_picks_the_active_photo: the reference rule for albums.tests_import::browsing_a_folder_keeps_or_picks_the_active_photo(enginelibrary.browse). Fails before the fix.