Repository navigation
Conversation
A new sidebar lists Albums, Folders, Local, By Date, Keywords. Settings saved in the old usual order get Folders moved above Local once, keeping hidden and folded flags; a version marker (sidebarOrderVersion) keeps a Folders dragged back from moving again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A settings file written by a newer build keeps its generation (the test pins it); the new field sits after collapsed_sidebar so it does not touch the lines beside the sidebar's other fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
vangel76
left a comment
There was a problem hiding this comment.
Reviewed 019ea2dc. No findings in the submitted change. I traced the one-time sidebar migration through settings load and checked default, manually ordered, and newer saved layouts. The submitted branch currently conflicts with main.
Source review only. I did not build the project, run tests, or check CI.
wanikhawar
left a comment
There was a problem hiding this comment.
This conflicts with main now. Please rebase so CI can run on the merged result.
Off
main.Problem
The sidebar lists Albums, Local, By Date, Folders, Keywords. Folders is the library's own tree of imported folders, the thing a person reaches for after Albums, but it sits below Local (a browser for any folder on the disk) and By Date. A new library should list it right under Albums. A person who already has the old order must not be left behind, and a person who arranged the sidebar themselves must not have it rearranged.
Change
SidebarSection::ALL).UiStatehas a newsidebarOrderVersion(absent in settings files saved before this: read as 0). On load,UiState::sanitizedcallsSidebarLayout::adopt_order_version: a layout that is exactly the old usual order (Albums, Local, By Date, Folders, Keywords; hidden and folded flags ignored when comparing) gets Folders put just above Local, every hidden and folded flag kept.sanitizedthen records the current version.sidebarOrderVersionthat is not a whole number reads as 0 instead of failing the whole settings file.docs/whats-new.mdhas an entry;docs/parity-checklist.mdrows LR-BEHAV-SIDEBAR-COLLAPSE, -SECTIONS, -HIDE, -REORDER and LRC-LIB-LIBFOLDERS name the new order and the one-time move. No new strings, so no locale catalog changes.Not in this PR: the sidebar's other section changes (an empty Folders offering the import, the "By Keyword" heading, the Local hover line); they are separate PRs. A layout that only looks like the old order (a partial list that is made whole into something else) is not moved: only the exact old usual order is. Someone who deliberately saved the old usual order before this version is moved once too, because a saved file cannot tell it from the old default; dragging Folders back keeps it.
How it was checked
cargo xtask cipasses on this branch, rebased on currentmain(a draft: the full run is the hosted gate's) (hosted CI gate passed at 019ea2d)an_old_default_order_moves_once,a_partial_or_damaged_list_does_not_panic_and_still_lists_every_section_once,a_sidebar_in_the_old_usual_order_gets_folders_above_local_once,an_arranged_or_new_sidebar_is_not_moved,the_sidebar_lists_folders_above_local); with a migration that ignores the saved order and version and a strict version reader, the other 2 and 3 of the same 5 failed (a_custom_order_is_left_alone,a_corrupt_order_version_or_list_does_not_lose_the_settings). The updateda_new_sidebar_shows_every_section_open_in_the_usual_order,a_section_moves_above_another_or_to_the_endanda_section_moves_one_place_among_the_shown_onesfailed on the old order before the change. The assertion that a newer saved version is kept failed whensanitizedset the version instead of keeping the larger one--memory, scratch settings, control channel only) and looked at the resultcargo check --workspace --all-targetsand the workspace clippy lints pass;cargo fmt --checkis clean;cargo xtask paritypasses; the wholelightcraft-ui-eguitest suite passed at the first commit (1919 unit tests and the 32 integration tests intests/it, 4 ignored measurements), and after the second commit the sidebar, header-drag and new tests (38 unit tests, 3 integration) pass again. One unrelated test (find_similar::stopping_leaves_the_view_alone_and_the_next_search_reads_only_the_rest) failed once under load in the first full run and passed alone and in the second full runScreenshots
Before and after, demo library (
--memory), scratch settings, 1280 × 1000 points. "Before" is the old usual order, set throughui.set, which is what a saved layout of an older version holds.Merging
sidebar.rs. A test merge of this branch with each open PR's head gave the same conflicts asmainalone with it, except LR-BEHAV-SIDEBAR-KEYS: the left sidebar from the keyboard (stacked on #3179) #3180: its keyboard-model parent LR-BEHAV-SIDEBAR-KEYS: the keys' model for the left sidebar: the mode, its cursor and its ring (no caller yet) #3179 also addsUiStatefields, so the new field sits aftercollapsed_sidebarto merge cleanly with it, and the one conflict left with LR-BEHAV-SIDEBAR-KEYS: the left sidebar from the keyboard (stacked on #3179) #3180 is the long LR-BEHAV-SIDEBAR-SECTIONS row ofdocs/parity-checklist.md. LR-BEHAV-SIDEBAR-COLLAPSE: the sidebar's trees open as they were left #1626 (open state of the trees), LRC-LIB-LIBFOLDERS: Folders skips the folders that only lead to your photos, with Show Parent Folder to list them #1243 and Sidebar: the row of what is shown has a bar, and a folded section says what it holds #1244 (Folders content,section_header) are unaffected. The sidebar PRs that follow (an empty Folders offering the import, the keyword heading) editsidebar.rsand the locale catalogs; each is offmainand the second to land rebases.docs/whats-new.mdhas the line. No photo renders differently, and the catalog is not touched.sidebarOrderVersionis a UI-settings field, not the catalogVERSION). Settings are checked both ways: an older build reading a file with the field ignores it (nodeny_unknown_fields) and then saves without it, so a person who goes back to this version afterwards and still has the old usual order is moved once more; this build reading a file without it reads 0.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.md(no new text, no new shortcut)docs/parity-checklist.mdand its entry indocs/gaps.mdare updated, honestly (rows updated;docs/gaps.mdhas no entry for the sidebar's order)assets/ATTRIBUTION.md; no font or media files addedSummary by CodeRabbit