Repository navigation
Conversation
Recently Added is always newest import first: its keys, direction and Reshuffle are off, nothing is checked as the order shown, and a dim line says why. Under Random and in Recently Deleted the date groups are off and unchecked. Reshuffle is listed in both menus under its own separator below the keys. The bottom bar's popup and View > Sort read one model (menus/sort_menu.rs).
There was a problem hiding this comment.
🔇 Additional comments: 1
crates/engine/src/cmd/library/specs.rs-55-58: 1
55-58:Minor · Functional Correctness · Quick win
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Disable Previous Shuffle in Recently Added at the engine boundary.
If a user reshuffles under Random and then opens Recently Added,
can_go_backstill enableslibrary.previousShufflefor direct engine clients. The command pops a history entry without changing the order shown in Recently Added. When the user returns to another source, that entry is no longer available. Reject Recently Added incan_go_back, as the Sort menus already do. (raw.githubusercontent.com)

Review info
-
Run configuration-
- Source mode: Auto
- Repository: storytold/lightcraft
- Branch: main
- File: .coderabbit.yaml
- Commit: 77c0a6a
- Layers: Repository YAML
- Review profile: CHILL
- Plan: Advanced
- Run ID:
9bdbb7d2-273f-4f80-9752-d9d57a297ed8
Files selected for processing: 33-
crates/engine/src/cmd/library/specs.rscrates/engine/src/lib.rscrates/engine/src/library.rscrates/engine/src/tests/libops.rscrates/ui-egui/locales/cs.jsoncrates/ui-egui/locales/de.jsoncrates/ui-egui/locales/es.jsoncrates/ui-egui/locales/fi.jsoncrates/ui-egui/locales/fr.jsoncrates/ui-egui/locales/id.jsoncrates/ui-egui/locales/it.jsoncrates/ui-egui/locales/ja.jsoncrates/ui-egui/locales/ka.jsoncrates/ui-egui/locales/pl.jsoncrates/ui-egui/locales/pt-br.jsoncrates/ui-egui/locales/ru.jsoncrates/ui-egui/locales/sv.jsoncrates/ui-egui/locales/uk.jsoncrates/ui-egui/locales/vi.jsoncrates/ui-egui/locales/zh-hans.jsoncrates/ui-egui/locales/zh-hant.jsoncrates/ui-egui/src/menus.rscrates/ui-egui/src/menus/menubar.rscrates/ui-egui/src/menus/menubar/tests.rscrates/ui-egui/src/menus/sort_menu.rscrates/ui-egui/src/panels/bottombar.rscrates/ui-egui/src/shortcuts.rscrates/ui-egui/src/tests.rscrates/ui-egui/src/tests/keymap.rscrates/ui-egui/src/tests/sort_menu.rsdocs/library-shortcuts.mddocs/parity-checklist.mddocs/whats-new.md
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
vangel76
left a comment
There was a problem hiding this comment.
Reviewed cc6fe89e. I traced the Previous Shuffle action, stored history, and the sort direction. I found one case where it restores a different order. The submitted branch currently conflicts with main.
Source review only. I did not build the project, run tests, or check CI.
| can_go_back, | ||
| |s, _| { | ||
| let seed = s.shuffle_history.pop().ok_or_else(|| bad("library.previousShuffle", "no earlier shuffle"))?; | ||
| s.sort = Sort { seed, ..s.sort }; |
There was a problem hiding this comment.
P2. Restore the sort direction with the previous shuffle seed. Random order also honors ascending, but this history saves only the seed. Shuffle while ascending, reshuffle, change direction, then use Previous Shuffle: it restores the old seed under the new direction. Store both values or clear the history on a direction change. Cover that sequence in the shuffle regression.
wanikhawar
left a comment
There was a problem hiding this comment.
This edits translation files in crates/ui-egui/locales. Translations go to storytold/craft-i18n, and feature PRs add English only (rule 16). Please move the locale edits there and keep English only here. It is stacked on #3288, which needs the same change, and it conflicts with main.
Stacked on #3288.
Problem
Reshuffle replaces the random order for good: if the new shuffle is worse than the one before, there is no way back, and nothing in either Sort menu or on the keyboard offers a Reshuffle or a way to undo one. Undo is for edits only, so it can't help.
Change
library.previousShuffle("Previous Shuffle"), goes back to the exact order the last Reshuffle replaced, by its seed, and again for the one before it, up to 32 steps. It is on only while the Reshuffle row is on (sorting at random, not in Recently Added) and an earlier shuffle exists.seedgiven while shuffling) replaces are kept in the session only: never saved with the view, never an undo step. They are forgotten when the sort leaves Random and when another library opens. Going back is not itself kept, so a Reshuffle after it makes a new order.library.shuffleandlibrary.sortaccept what they did; only their help text mentions the history.docs/library-shortcuts.md,docs/whats-new.md,docs/parity-checklist.md(LR-FILT-SORT, MENU-VIEW-SORT, revision row).Not in this PR: a visible chip or header for the current shuffle, the grid's scroll position after a reshuffle, and a Custom Order key (#1155).
How it was checked
cargo xtask cipasses on this branch (all 8 steps: fmt, clippy, heif, test, parity, layers, assets, wasm; 5,260 tests passed, 42 ignored; run on 755f858, the head's one later commit changes only a doc comment, and clippy passed on it), onmainat 77c0a6a with MENU-VIEW-SORT: the Sort menus offer only what the view uses #3288 below it. It ran with the one-file clippy fix of MENU-BAR: clippy passes on macOS again (Quit, About and Settings share one branch) #2973 applied uncommitted, becausemainfails clippy atapps/lightcraft/src/native_menu.rs:492on macOS ("thisifhas identical blocks"); the diff was reverted before the commit.crates/engine/src/tests/libops.rs(the exact earlier order, a bounded history, off unless sorting at random) fail with assertion failures against a stub command. In the UI crate,previous_shuffle_follows_reshuffle_and_both_show_their_shortcuts(menu model) andthe_popups_previous_shuffle_brings_back_the_order_a_reshuffle_replaced(the popup's rows) fail with that push removed;the_shuffle_keys_follow_the_sort_menus_rules(keymap) fails without the guard (Reshuffle switched a date sort to Random);opening_a_library_forgets_the_earlier_shufflesand the added assertion inprevious_shuffle_restores_…(a Reshuffle after going back is not the order just left) fail before their fixes.ui.menu.treeand the menu tests read it), including the keys.Screenshots
The bottom bar's Sort popup, demo library, sorted at random after a Reshuffle. Before (#3288): Reshuffle without a key and nothing to go back with. After: Reshuffle shows ⌘⌥⇧R and Previous Shuffle ⌘⌥⇧P is on.
Merging
docs/whats-new.md/docs/parity-checklist.md; whichever lands second resolves those. LR-FILT-SORT: Custom Order — drag to reorder an album's photos #1155 (Custom Order) conflicts incrates/engine/src/lib.rs,crates/engine/src/cmd/library.rs,menubar.rs,bottombar.rs,headless.rsandleft.rs(it adds its own key and state to the same menus andSession): the second to land adds its rows next to these. MENU-BAR: one menu row and shortcut component for every menu #2080 (one menu row component) conflicts inbottombar.rs(it rewrites the popup's rows, including the key text added here), the locale catalogs and docs. This PR is stacked on MENU-VIEW-SORT: the Sort menus offer only what the view uses #3288, which it needs for the Sort menu model.unsafe, build scripts, network access, spawned processes, deleted files, CI orxtaskgate changes: none.Checklist
unwrap/expect/panic!, no indexing or unchecked arithmetic on a number from a file, a person or an agent (get,checked_mul, NaN and char boundaries handled)tr()and has its key incrates/ui-egui/locales/*.json; a new shortcut is free indocs/library-shortcuts.mddocs/parity-checklist.mdand its entry indocs/gaps.mdare updated, honestly (🟡 when it is partial), in the same commit (docs/gaps.mdhas no entry for the Sort menus)Summary by CodeRabbit