Repository navigation
LRC-LIB-LIBFOLDERS: the sidebar trees narrow their indent step before names are cut (#2298) - #2349
Conversation
… names are cut (storytold#2298) Every level of Albums, Local, By Date, Folders and Keywords still steps one level right of its parent, but the step is chosen each frame from the panel's width and the deepest open row: 16 pt while that row keeps about 80 pt for its name and room for its count, else 14, 12, 10 or 8 pt. Past 8 pt the sidebar scrolls sideways as before. Callers keep passing indents in 16 pt steps; `indent_x` maps them to the drawn step for the icon, name, chevron, album drop line and the width a row asks for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
rahul05ranjan
left a comment
There was a problem hiding this comment.
The thing I most wanted to check in this diff was the indent flow, because there are now two scaling paths (drawn_indent inside the row functions, indent_x inside the chevron/drop-indicator functions) and a double-scale would have made chevrons drift left of their rows. It's clean: row_sensed and out_of_sight scale their own local copy, while disclosure_chevron, tree_toggle and album_drag_over all receive the raw caller indent and scale once internally. The row_need inside row_sensed also uses the scaled value, so the measured content width matches what is actually drawn — which is why the 26-level test can assert the scrollbar appears exactly when the 8 pt floor is reached.
I verified step_for's arithmetic against the band test values and they all agree: at a 268 pt panel, room is 88 pt, so 5 levels keep 16 (80 ≤ 88), 7 land on 12 (84 ≤ 88), 9 drop to 8 (90 > 88 at 10 pt), and 30 stay at 8 with scrolling taking over. The discrete-band choice is the right one — a continuous step would make every row slide sideways while the panel is being dragged.
Two observations, neither blocking:
- Since the step is global across all sidebar trees, a deep Keywords or By Date section narrows the Folders and Album steps too. The parity row documents this ("the same for every tree"), and the out-of-sight rows counting toward the deepest indent means it doesn't twitch while scrolling — but it does mean opening one very deep tree reflows every other tree in the panel. If that ever feels jarring in practice, per-tree steps would be the knob — though the shared rule is simpler and matches the shared scrollbar, so I'd only change it on evidence.
date_rowsstill uses the literal32.0for the day level while the neighboring16.0literals becameINDENT_STEP. It's correct while the constant is 16, just one step off the pattern the rest of the diff establishes.
The tests do the heavy lifting nicely: the headless before/after renders in the issue, the band table, the wide-panel restore, and the shallow-tree untouched case cover the whole decision space of step_for.
…t a literal 32 pt Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the careful read, @rahul05ranjan.
🤖 Addressed by Claude Code |
…idebar-adaptive-indent # Conflicts: # docs/parity-checklist.md
|
Hi @helgehelge123, thanks for this. It touches the same spots as #1243 (Folders: a disk opens at the first folder that holds photos, and Show Parent Folder): |
…(ready for storytold#1243) The two deep-chain tests now build their library with `deep_folders_app`, as storytold#1243 does: every level holds a photo, so it has a row of its own and starts closed, and the test opens it. They pass the same whether or not the sidebar passes over folders that only lead on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @nledford, that plan works for me. I've already made the deep-chain tests independent of the order the two land in (e07c2bd): both now build their library with a 🤖 Addressed by Claude Code |
…g it On the FreeBSD runner a click's synthetic input can arrive a frame or two late, so after opening `/a/b/c/d` the row of `/a/b/c/d/e` was not drawn yet when the next click asked for it. The fixture now steps until each level's chevron is drawn before clicking it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… their indent step before names are cut (storytold#2298) docs/parity-checklist.md: header and revision rows from both sides
Closes #2298.
A library below a deep path (
/Users/<me>/Library/CloudStorage/<cloud>/RAW/<club>/<date>/RAW) puts its folders nine or ten levels down. At 16 pt per level the deepest names were cut to2026-0…in the default panel and to…in a narrow one, and their counts went past the edge.Headless renders of the same library before and after this change.
What it does
out_of_sight), so the step depends on what is open, not on what is scrolled into view. Like the content width, it is taken from the last frame.How
Callers keep passing indents in 16 pt steps (
INDENT_STEP), so the tree walks, the Local depth limit and theindent == 0checks are unchanged.indent_xmaps a nominal indent to the drawn one. It is used for the icon, name, chevron, album drop line androw_need.drawn_indentalso records the deepest indent of the frame, andstep_for(panel width, deepest)picks the next frame's step.Decisions worth a look
left.rs(LRC-LIB-LIBFOLDERS: Folders skips the folders that only lead to your photos, with Show Parent Folder to list them #1243:folder_rows/folder_row/ the end offolder_tree; here:row_sensed,out_of_sight,disclosure_chevron, the end of the scroll area and theindent + 16.0steps), so a rebase of either should be mechanical.Verification
tests_panels.rs:a_deep_library_path_narrows_the_indent_instead_of_cutting_the_names: the default panel narrows, levels are evenly spaced, the deepest name shows left of its count, nothing scrolls sideways, a 480 pt panel goes back to 16 pt, and a shallow tree keeps 16 pt.the_indent_step_narrows_in_bands: the band choice.a_deep_chain_keeps_its_nesting_and_the_sidebar_scrolls_sidewaysnow uses a 26-level chain that doesn't fit even at 8 pt. It asserts the same things as before at the narrow step.cargo xtask cion macOS (M4 Pro): all 8 steps pass (fmt, clippy-D warnings, heif, test, parity, layers, assets, wasm).docs/parity-checklist.md: LRC-LIB-LIBFOLDERS describes the step, plus a changelog row.🤖 Generated with Claude Code
Summary by CodeRabbit