You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LR-BEHAV-MULTISELECT: the model for choosing several sidebar rows with Cmd/Ctrl+click and Shift+click - #2707
The sidebars' lists (albums, folders, keywords, dates, the Keyword List) choose one row at a time. Choosing several with Cmd/Ctrl+click and Shift+click needs one rule that every list answers the same way, and that rule is the part that is easy to get wrong: which rows a Shift+click takes when a folder is closed, where a range starts from after a menu or an agent changed what is chosen, and which rows a context menu acts on. If each list works it out for itself, they drift apart.
Change
First of the parts of #1955 (the sidebar multi-select), split out so that each can be reviewed on its own. This one is the model only, and nothing calls it yet, so nothing changes on screen. Its module doc names the feature that will use it.
New crates/ui-egui/src/multi_select.rs: Click::of (the keys held: plain, Cmd/Ctrl, Shift, Cmd/Ctrl+Shift), click (what a click makes of the rows chosen), targets (what a context menu acts on: every row chosen when it is opened on one of several chosen, else that row alone) and ListRows (a list's rows as drawn in the last frame, and the anchor).
Rows are kept in the order chosen, the last of them being the one a single-row action takes (Rename…, Edit…).
A range runs from the row last clicked without Shift (else the row chosen last) to the clicked row, over the rows of open levels only, so a range never takes a row inside a closed folder. Without an anchor among the rows, Shift+click chooses the row alone, like a plain click.
Shift+click replaces what was chosen and Cmd/Ctrl+Shift+click adds the range to it (the Finder and Explorer rule). The photo grid's Shift+click, which adds, is untouched.
One line in ui-egui/src/lib.rs for the module.
Not in this PR: the sidebar UI that calls it (menus, drags, Delete, Cut / Copy / Paste on several rows, in every language); the batch commands it acts through (album.delete, keyword.delete and the others taking several ids); showing several albums or folders at once (library.source {ids, paths}, #1153); Synchronize several folders at once. No parity row or What's New entry changes, since there is nothing to see yet.
How it was checked
cargo xtask ci: all 8 steps passed (fmt, clippy, heif, test, parity, layers, assets, wasm) on this head.
8 unit tests in the module (the_keys_held_say_what_a_click_asks_for, a_plain_click_chooses_the_row_alone, cmd_click_adds_a_row_or_takes_it_away, shift_click_takes_the_rows_from_the_anchor, cmd_shift_click_adds_the_range_to_what_was_chosen, a_range_without_an_anchor_in_sight_chooses_the_row_alone, a_menu_acts_on_the_rows_chosen_only_when_opened_on_one_of_them, a_list_s_clicks_are_on_the_rows_of_the_frame_before). They cover a range up and down, a second range from the same anchor, an anchor folded away, a stale click, the anchor being the row clicked and an empty list. The module is new, so there is no earlier behavior for them to fail against.
Review: a fresh reviewer subagent read this head at 6ffa75d: no P1 or P2; two P3 notes on tests (a test comment that says more than its plain click asserts, and seen.clear() in begin_frame having no test of its own), left as they are.
Independent review of the first version: its findings (a doc that said "in sight" where scrolled-out rows must still count, the anchor described wrongly, a buffer reallocated every frame, three untested boundaries) are fixed in this commit.
No macOS-only path: the module has no platform code, and no hosted job beyond FreeBSD applies.
Added multi-select behavior for lists, including single-row selection, modifier-key toggling, range selection, and adding ranges to an existing selection.
Range selection follows the displayed row order and keeps the clicked row as the most recently selected item.
Context-menu actions can apply to the full selection when the clicked row is part of a multi-row selection; otherwise, they apply to that row alone.
Reviewing files that changed from the base of the PR and between 6ffa75d and 2529b79.
Files selected for processing: 1
crates/ui-egui/src/lib.rs
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
Walkthrough
Adds a public multi_select module with modifier-based row selection, range selection, context-menu targets, and frame-based row tracking.
Changes: Sidebar row selection
Layer / File(s)
Summary
Selection modes and range behavior crates/ui-egui/src/lib.rs, crates/ui-egui/src/multi_select.rs
Exports the new module. Adds plain, toggle, range, and additive-range selection. Range selection follows drawn row order. Tests cover modifier mapping and selection behavior.
Frame tracking and context-menu targets crates/ui-egui/src/multi_select.rs
Tracks rows across frames and selects a range anchor from the current selection. Defines context-menu target rules. Tests cover frame tracking and target selection.
The PR adds the intended reusable selection model without identified correctness or availability risks.
Architecture risk: Low · up to 2529b
The change affects 1 system.
Changed systems:crates
Architecture concerns
No architecture-level concerns identified.
Review details
Systems and components
observed — crates (service) was modified; 2 changed files map to changed impact.
Before / after behavior
observed — Modified behavior in crates/ui-egui/src/multi_select.rs: Adds module documentation and the Click enum, defining plain, toggle, range, and additive-range click modes.
observed — Modified behavior in crates/ui-egui/src/multi_select.rs: Adds Click::of, mapping Shift and command modifiers to range, additive-range, toggle, or plain selection; other modifiers alone do not change the plain-click result.
observed — Modified behavior in crates/ui-egui/src/multi_select.rs: Adds Chosen<K> to return selected keys in order together with an optional range anchor.
observed — Modified behavior in crates/ui-egui/src/multi_select.rs: Adds click, which selects only the clicked row for plain clicks; toggles it for command clicks; and, for range modes, selects rows between the anchor and clicked row in drawn order. Range mode replaces the selection, while additive range mode extends it without duplicates. If either endpoint is absent from rows, both range modes select only the clicked row and set it as anchor.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly identifies the main change: adding a model for sidebar multi-selection with Cmd/Ctrl-click and Shift-click. It is specific and related to the changeset.
Docstring Coverage
Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
Clippy (1.99.0)
Clippy execution timed out
Comment @coderabbitai help to get the list of available commands.
…lbums, folders, keywords or dates in the sidebars
The left panel's Albums, Folders, Keywords and By Date and the Keyword List call the model of storytold#2707: a click chooses a row alone, Cmd/Ctrl+click adds it or takes it away, Shift+click takes the rows between. What is chosen is what the grid shows (library.source ids/paths, library.filter keywords/dates of storytold#1153); the Keyword List's picks stay in the interface. Carries the act hunk of storytold#777 (a refused command says why), which this PR's clicks use.
Parents: storytold#1153792ebf1 and storytold#27076ffa75d.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lbums, folders, keywords or dates in the sidebars
The left panel's Albums, Folders, Keywords and By Date and the Keyword List call the model of storytold#2707: a click chooses a row alone, Cmd/Ctrl+click adds it or takes it away, Shift+click takes the rows between. What is chosen is what the grid shows (library.source ids/paths, library.filter keywords/dates of storytold#1153); the Keyword List's picks stay in the interface. Carries the act hunk of storytold#777 (a refused command says why), which this PR's clicks use.
Parents: storytold#1153792ebf1 and storytold#27076ffa75d.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lbums, folders, keywords or dates in the sidebars
The left panel's Albums, Folders, Keywords and By Date and the Keyword List call the model of storytold#2707: a click chooses a row alone, Cmd/Ctrl+click adds it or takes it away, Shift+click takes the rows between. What is chosen is what the grid shows (library.source ids/paths, library.filter keywords/dates of storytold#1153); the Keyword List's picks stay in the interface. Carries the act hunk of storytold#777 (a refused command says why), which this PR's clicks use.
Parents: storytold#1153792ebf1 and storytold#27076ffa75d.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aiongg
added a commit
to aiongg/lightcraft
that referenced
this pull request
Oct 31, 2026
The reason will be displayed to describe this comment to others. Learn more.
ReviewerA — source-read COMMENT (not an approval)
I read the head of the diff: a new multi_select module is the model for choosing several sidebar rows with Cmd/Ctrl+click and Shift+click (LR-BEHAV-MULTISELECT). The module comment states the rules: Cmd/Ctrl+click adds a row or takes it away, Shift+click takes every row from the row last clicked without Shift (else the row chosen last) to this one, the rows chosen are kept in the order chosen, and the last of them is the one an action for a single row applies to; one rule for all the sidebars' lists, so they answer alike. Putting the selection rules in a model separate from the drawing makes them unit testable, which is the right design, and the anchor rule (the row last clicked without Shift) is Lightroom's and Finder's. It is added to lib.rs as a public module, but the list says nothing uses it yet, so this is a model without callers and its value is only shown when the sidebars use it; the PR should say which follow-up wires it in. Ranges over a list that is filtered or re-sorted between clicks need the anchor to be stored as an id and not an index. I read the module comment, not the code or tests. I have not run it, and no exact-head CI result exists for this head. Nothing was run.
I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.
The multi-select stack is rebased onto current main (ebe2477) and ready as one unit; every conflict is resolved and each branch's own diff still carries only its own feature. Heads will follow in this comment's next edit.
Checks green at each head (check, lint, the multi-select, left-panel and engine tests, rebase-check, parity). A maintainer can take the five together.
Edit: the rebuild also fixes a latent compile defect the old sidebar-cut-copy-paste head carried (album_ids called with the widened signature's arguments in the wrong order); the fix is folded into the branch.
…lbums, folders, keywords or dates in the sidebars
The left panel's Albums, Folders, Keywords and By Date and the Keyword List call the model of storytold#2707: a click chooses a row alone, Cmd/Ctrl+click adds it or takes it away, Shift+click takes the rows between. What is chosen is what the grid shows (library.source ids/paths, library.filter keywords/dates of storytold#1153); the Keyword List's picks stay in the interface. Carries the act hunk of storytold#777 (a refused command says why), which this PR's clicks use.
Parents: storytold#1153792ebf1 and storytold#27076ffa75d.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closing as included: the engine part of this PR is on main via fbe1225202 (Integration r3); the model code that was dropped there as dead without its callers lives on in the stack that uses it — #3106, #3107, #3108 and #2757, all rebased onto current main and ready as one unit (heads named in my comment above). This branch itself is now empty (equal to main).
The 2 Nov restack closed this PR: its branch sidebar-multiselect-model was force-pushed to the main commit ebe2477108, which left it with no commit of its own. main had also dropped the model on 31 Oct (7b6e1114a0, "Integration: drop #2707 (multi-select model waits for its stack: #3106, #3107, #3108, #2757)"). The model, crates/ui-egui/src/multi_select.rs, is now part of #3106, unchanged apart from its module comment (it names its callers now), so the review of it continues there. @FredApps: anything you left on this PR about the model applies to the same file in #3106.
nledford
added a commit
to nledford/lightcraft
that referenced
this pull request
Nov 6, 2026
…lbums, folders, keywords or dates in the sidebars
The left panel's Albums, Folders, Keywords and By Date and the Keyword List call the model of storytold#2707: a click chooses a row alone, Cmd/Ctrl+click adds it or takes it away, Shift+click takes the rows between. What is chosen is what the grid shows (library.source ids/paths, library.filter keywords/dates of storytold#1153); the Keyword List's picks stay in the interface. Carries the act hunk of storytold#777 (a refused command says why), which this PR's clicks use.
Parents: storytold#1153792ebf1 and storytold#27076ffa75d.
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
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.
Off
main.Problem
The sidebars' lists (albums, folders, keywords, dates, the Keyword List) choose one row at a time. Choosing several with Cmd/Ctrl+click and Shift+click needs one rule that every list answers the same way, and that rule is the part that is easy to get wrong: which rows a Shift+click takes when a folder is closed, where a range starts from after a menu or an agent changed what is chosen, and which rows a context menu acts on. If each list works it out for itself, they drift apart.
Change
First of the parts of #1955 (the sidebar multi-select), split out so that each can be reviewed on its own. This one is the model only, and nothing calls it yet, so nothing changes on screen. Its module doc names the feature that will use it.
crates/ui-egui/src/multi_select.rs:Click::of(the keys held: plain, Cmd/Ctrl, Shift, Cmd/Ctrl+Shift),click(what a click makes of the rows chosen),targets(what a context menu acts on: every row chosen when it is opened on one of several chosen, else that row alone) andListRows(a list's rows as drawn in the last frame, and the anchor).ui-egui/src/lib.rsfor the module.Not in this PR: the sidebar UI that calls it (menus, drags, Delete, Cut / Copy / Paste on several rows, in every language); the batch commands it acts through (
album.delete,keyword.deleteand the others taking several ids); showing several albums or folders at once (library.source {ids, paths}, #1153); Synchronize several folders at once. No parity row or What's New entry changes, since there is nothing to see yet.How it was checked
cargo xtask ci: all 8 steps passed (fmt, clippy, heif, test, parity, layers, assets, wasm) on this head.the_keys_held_say_what_a_click_asks_for,a_plain_click_chooses_the_row_alone,cmd_click_adds_a_row_or_takes_it_away,shift_click_takes_the_rows_from_the_anchor,cmd_shift_click_adds_the_range_to_what_was_chosen,a_range_without_an_anchor_in_sight_chooses_the_row_alone,a_menu_acts_on_the_rows_chosen_only_when_opened_on_one_of_them,a_list_s_clicks_are_on_the_rows_of_the_frame_before). They cover a range up and down, a second range from the same anchor, an anchor folded away, a stale click, the anchor being the row clicked and an empty list. The module is new, so there is no earlier behavior for them to fail against.seen.clear()inbegin_framehaving no test of its own), left as they are.Screenshots
None: nothing on screen changes.
Merging
library.source {ids, paths}; engine only) #1153 (the engine part of showing several albums, folders, keywords or dates) and LR-BEHAV-MULTISELECT: Synchronize several folders at once, one after another (stacked on #1943 and #1153) #1955 (this model, the sidebar UI and Synchronize several folders, as one draft) are mine; the draft will drop this commit when it is rebased, and the UI part builds on this one. No other open or merged PR builds a multi-select of sidebar rows (searched for multi-select, several albums, Cmd+click, Shift+click). docs: add gap 30 — multi-select metadata editing UI #2622 adds a "gap 30" todocs/gaps.mdwhile Library: show several albums, folders, keywords or dates at once (library.source {ids, paths}; engine only) #1153 already names its sidebar multi-selection gap 30: whichever lands second renumbers. This PR touches neither file. LR-BEHAV-MULTISELECT: Cmd/Ctrl+click and Shift+click choose several albums, folders, keywords or dates in the sidebars (stacked on #1153) #3106 (open) is the part that calls this model: it builds on this PR and Library: show several albums, folders, keywords or dates at once (library.source {ids, paths}; engine only) #1153, and the menus, drags and Cut, Copy and Paste follow in LR-BEHAV-MULTISELECT: the menu, dragging and Delete key of several chosen sidebar rows act on all of them (stacked on #3106 and #2757) #3107 and LR-BEHAV-MULTISELECT: Cut, Copy and Paste for albums and keywords, and album.duplicate (stacked on #3107) #3108.unsafe, build scripts, network access, spawned processes, deleted files, CI orxtaskgate changes: none.Checklist
Summary by CodeRabbit