Skip to content

Conversation

@engrzani
Copy link

Description

This PR fixes issue #12612 by preserving the current sort order when switching to "custom sort" mode.

Problem

Previously, when users selected "custom sort" from the sorting dropdown, the image order would reset to filename order. This made it impossible to:

  • Sort by capture time first, then make minor adjustments
  • Use any other sort criteria as a starting point for custom ordering

Solution

When switching to custom sort, the current sort order is now captured and stored in the position field, so users can make adjustments to the existing order rather than starting from scratch.

Implementation

  • Added dt_collection_sync_custom_order() function to capture current order
  • Hook in sort combobox change handler to call sync when switching TO custom sort
  • Uses database transaction to ensure atomic updates
  • Supports both regular and tagged collections

Testing

  • Tested switching from various sort modes (filename, capture time, etc.) to custom sort
  • Verified order is preserved correctly
  • Tested with both regular collections and tagged collections
  • No regression in existing custom sort functionality

Fixes #12612

When users switch to custom sort mode, preserve the current sort order instead of resetting to filename order. This allows users to sort by capture time (or any other criterion) first, then switch to custom sort to make fine adjustments without losing their work.

Fixes darktable-org#12612
@dterrahe
Copy link
Member

Did you read any of the comments on #20162?

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.

Allow 'custom sort' based on current sorting

2 participants