Skip to content

Fix for #20899 (darkroom browsing broken when developed image is removed from collection)#20906

Open
masterpiga wants to merge 1 commit intodarktable-org:masterfrom
masterpiga:fix_20899
Open

Fix for #20899 (darkroom browsing broken when developed image is removed from collection)#20906
masterpiga wants to merge 1 commit intodarktable-org:masterfrom
masterpiga:fix_20899

Conversation

@masterpiga
Copy link
Copy Markdown
Contributor

@masterpiga masterpiga commented Apr 30, 2026

Handles the general case of "active image no longer matches the filter".

  • _active_image_rowid is seeded at darkroom entry (enter()) and on every navigation (_dev_change_image).

  • A new collection-changed callback (_darkroom_collection_changed_callback) hooks DT_SIGNAL_COLLECTION_CHANGED. On every collection change:

    • If the active image is still in the rebuilt memory.collected_images, the stored rowid is refreshed to its new position.
    • If the active image was filtered out, the stored rowid is left untouched — preserving the slot it last occupied, which is now held by whatever image came after it.
  • _dev_jump_image uses current_rowid + diff when the image is still present, otherwise falls back to _active_image_rowid + (diff - 1) for forward jumps and _active_image_rowid + diff for backward jumps.

Fixes #20899. Co-authored with Claude.

Screen.Recording.2026-04-30.at.20.49.33.mp4

Handles the general case of "active image no longer matches the filter".

`_active_image_rowid` is seeded at darkroom entry (`enter()`) and on every navigation (`_dev_change_image`).

A new collection-changed callback (`_darkroom_collection_changed_callback`) hooks `DT_SIGNAL_COLLECTION_CHANGED`. On every collection change:

* If the active image is still in the rebuilt `memory.collected_images`, the stored rowid is refreshed to its new position.
* If the active image was filtered out, the stored rowid is left untouched — preserving the slot it last occupied, which is now held by whatever image came after it.

`_dev_jump_image` uses `current_rowid + diff` when the image is still present, otherwise falls back to `_active_image_rowid + (diff - 1)` for forward jumps and `_active_image_rowid + diff` for backward jumps.
@masterpiga
Copy link
Copy Markdown
Contributor Author

@TurboGit @wpferguson @jsmucr

@masterpiga masterpiga changed the title Fix for #20899 Fix for #20899 (darkroom browsing broken when developed image is removed from collection) Apr 30, 2026
@jsmucr
Copy link
Copy Markdown
Contributor

jsmucr commented Apr 30, 2026

What happens if you go to the first image, remove it with R, and then press backspace? Similarly, what happens if you go to the last image, remove it, and then press space?

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.

Filtered darkroom browsing broken

2 participants