Skip to content

LR-FILT-SORT: the header's Reshuffle reads as a button beside the Shuffled label (stacked on #3290) - #3306

Closed
nledford wants to merge 3 commits into
storytold:mainfrom
nledford:shuffle-chip-polish
Closed

nledford wants to merge 3 commits into
storytold:mainfrom
nledford:shuffle-chip-polish

Conversation

@nledford

@nledford nledford commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #3290. Its one commit here is 5a0eb38c3c; the two commits below it are #3290's own (afa25ebf56, 048546c08b).

Problem

In the grid header of a shuffled view (#3290) "Shuffled" (quiet text) and "Reshuffle" (a ghost button, which draws nothing until hovered) sit side by side as plain text: "Shuffled Reshuffle 24 photos". Nothing says the second word is a button, so the pair reads as one phrase instead of a state plus an action.

Change

  • LR-FILT-SORT: the header's Reshuffle is a Secondary small Button instead of a Ghost one, so it shows its fill and border at rest (the button kind the interface already uses for ordinary actions, in every theme); the label stays plain text.
  • The gap between "Shuffled" and the button grows from 4 to 8 pt (LABEL_GAP), so the state and the action read as two things. chip_width and shuffle_chip use the same constant. The button's width is unchanged (Secondary and Ghost share the font and padding), so the compact and drop rules of chip_plan are unchanged: the full chip is 4 pt wider, so a header switches to the button alone 4 pt sooner, and the narrowest header that keeps a chip is the same.
  • Docs: the existing 2026-10-28 What's New entry and the LR-FILT-SORT row mention the bordered button; one revision row.
  • No new string, icon or asset. I looked at a shuffle glyph on the button and left it out: it would need a new vector icon and widen the chip, and the border already gives the affordance.

Not in this PR: the sort menus' note styling (#3288), menus, the engine, scrolling, and any change to chip_plan's rules.

How it was checked

  • cargo xtask ci passes on this branch: all 8 steps (fmt, clippy, heif, test with 5,253 tests passed, parity, layers, assets, wasm) at 5a0eb38c3c. It ran with MENU-BAR: clippy passes on macOS again (Quit, About and Settings share one branch) #2973's one-file clippy fix for native_menu.rs applied uncommitted (main fails clippy there), since reverted. 147 tests skipped for missing corpus, model and font files, none in code this PR touches.
  • A test that fails without this change: reshuffle_reads_as_a_button_beside_the_label (crates/ui-egui/src/tests/shuffle_chip.rs) checks in all four themes that Reshuffle paints a bordered rectangle on its own rectangle at rest, that the label does not, and that the gap between them is at least 8 pt. It was run against LR-FILT-SORT: a shuffled grid says so in its header, with Reshuffle beside it #3290's code (before the fix was applied) and fails by assertion: "midnight: Reshuffle shows its border at rest", 0 bordered rectangles, expected 1 (the run stops at the first failing assertion). The six LR-FILT-SORT: a shuffled grid says so in its header, with Reshuffle beside it #3290 tests, including the narrow-window and long-count ones, and local_folder_header_text_and_controls_do_not_overlap still pass.
  • User-visible change: ran the release app on the procedural demo library (--memory) at LR-FILT-SORT: a shuffled grid says so in its header, with Reshuffle beside it #3290's head and at this branch through the control channel and read the screenshots below, in the dark Midnight and the light Paper theme, at 1400 pt and 520 pt wide.
  • macOS evidence: the screenshots and headless tests ran on this Mac (Apple M1 Max, Metal). Hosted checks don't build macOS-only paths, and this change has none.
  • Review: fresh reviewer subagent at 5a0eb38

Screenshots

Demo photos only, scratch settings, cropped to the header. The 520 pt window shows the button alone, as before.

Before (#3290) After
Midnight, wide before after
Paper, wide before after
Midnight, 520 pt before after
Paper, 520 pt before after

Merging

Checklist

  • No new panic path in non-test code: no 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)
  • New text on screen goes through tr() and has its key in crates/ui-egui/locales/*.json; a new shortcut is free in docs/library-shortcuts.md (no new text, no new shortcut)
  • The feature's rows in docs/parity-checklist.md and its entry in docs/gaps.md are updated, honestly (🟡 when it is partial), in the same commit (LR-FILT-SORT; docs/whats-new.md too)
  • New code has a caller, or is a tested core whose caller comes in the next pull request, named here
  • Every new image, icon or other asset has its entry in assets/ATTRIBUTION.md; no font or media files added (none added)
  • Ready to merge (otherwise open it as a draft)

Summary by CodeRabbit

  • New Features
    • Randomly sorted photo grids now show a “Shuffled” indicator and a one-click Reshuffle button, including in local folders. The controls adapt to narrow layouts, and the indicator is hidden when needed to keep the photo count visible.
    • Sort-button tooltips and screen-reader labels now identify the active sort and direction.
  • Documentation
    • Updated the “What’s New” and feature checklist to describe shuffled-grid controls and sort labels.
  • Localization
    • Added translations for shuffle guidance, status labels, and sort summaries across supported languages.

…eside it

A view sorted at random shows a quiet "Shuffled" chip beside the photo count (and a Reshuffle button that runs library.shuffle), except in Recently Added and Recently Deleted, which keep their own order. In a narrow header the button stands alone so the count stays in view. The sort button's tooltip and accessible name now name the sort.
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 77c0a6a and 5a0eb38.

Files selected for processing: 41
  • crates/ui-egui/locales/cs-formats.json
  • crates/ui-egui/locales/cs.json
  • crates/ui-egui/locales/de-formats.json
  • crates/ui-egui/locales/de.json
  • crates/ui-egui/locales/es-formats.json
  • crates/ui-egui/locales/es.json
  • crates/ui-egui/locales/fi-formats.json
  • crates/ui-egui/locales/fi.json
  • crates/ui-egui/locales/fr-formats.json
  • crates/ui-egui/locales/fr.json
  • crates/ui-egui/locales/id-formats.json
  • crates/ui-egui/locales/id.json
  • crates/ui-egui/locales/it-formats.json
  • crates/ui-egui/locales/it.json
  • crates/ui-egui/locales/ja-formats.json
  • crates/ui-egui/locales/ja.json
  • crates/ui-egui/locales/ka-formats.json
  • crates/ui-egui/locales/ka.json
  • crates/ui-egui/locales/pl-formats.json
  • crates/ui-egui/locales/pl.json
  • crates/ui-egui/locales/pt-br-formats.json
  • crates/ui-egui/locales/pt-br.json
  • crates/ui-egui/locales/ru-formats.json
  • crates/ui-egui/locales/ru.json
  • crates/ui-egui/locales/sv-formats.json
  • crates/ui-egui/locales/sv.json
  • crates/ui-egui/locales/uk-formats.json
  • crates/ui-egui/locales/uk.json
  • crates/ui-egui/locales/vi-formats.json
  • crates/ui-egui/locales/vi.json
  • crates/ui-egui/locales/zh-hans-formats.json
  • crates/ui-egui/locales/zh-hans.json
  • crates/ui-egui/locales/zh-hant-formats.json
  • crates/ui-egui/locales/zh-hant.json
  • crates/ui-egui/src/panels/bottombar.rs
  • crates/ui-egui/src/panels/grid.rs
  • crates/ui-egui/src/panels/grid/header_tests.rs
  • crates/ui-egui/src/tests.rs
  • crates/ui-egui/src/tests/shuffle_chip.rs
  • docs/parity-checklist.md
  • docs/whats-new.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

The grid now identifies eligible random-sorted views with a shuffled status and Reshuffle control. The sort button tooltip identifies the active sort. Translations, UI tests, and documentation cover these additions.

Changes: Shuffled grid controls

Layer / File(s) Summary
Shuffled grid header
crates/ui-egui/src/panels/grid.rs, crates/ui-egui/src/panels/grid/header_tests.rs, crates/ui-egui/src/tests.rs, crates/ui-egui/src/tests/shuffle_chip.rs, crates/ui-egui/locales/*.json, docs/parity-checklist.md, docs/whats-new.md
Eligible randomly sorted views show a “Shuffled” label and a Reshuffle button. Clicking the button calls library.shuffle. The chip is omitted or reduced to a button when header width is limited. Local folder headers also support the control. Tests cover visibility, layout, styling, and reshuffling; documentation records the controls.

Sort-aware tooltip

Layer / File(s) Summary
Sort-aware tooltip
crates/ui-egui/src/panels/bottombar.rs, crates/ui-egui/src/tests/shuffle_chip.rs, crates/ui-egui/locales/*-formats.json
The sort button tooltip shows the active sort key and, except for Random, its direction. Translations retain the {key} and {direction} placeholders. Tests cover capture-date, file-name, and random sorts.

Priority: Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant GridHeader
  participant Library
  GridHeader->>Library: Read sort and view state
  GridHeader-->>User: Show shuffle controls when applicable
  User->>GridHeader: Click Reshuffle
  GridHeader->>Library: Call library.shuffle
Loading

Suggested reviewers: emmertex, claude

Merge Risk: Minimal · up to 5a0eb

The shuffled controls and sort labels are ready to merge after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: presenting Reshuffle as a button beside the Shuffled label in the header. It also identifies the related stacked pull request.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 12 functions across 5 files. (36 skipped: 36 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

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.

nledford added a commit to nledford/lightcraft that referenced this pull request Oct 29, 2026
@nledford

Copy link
Copy Markdown
Contributor Author

Folded into #3290 as one commit, c06e0d3c25 (fast-forward on top of 048546c08b): the same code and test, with its docs merged into #3290's What's New entry and revision row. The description of #3290 now has this change, its test and its screenshots. Closing in favor of #3290.

@nledford nledford closed this Oct 29, 2026
emmertex referenced this pull request in emmertex/chromaforge Nov 2, 2026
Every open PR above the #3306 boundary, the merged PRs since 2026-10-29 and the
closed ones updated since now have a row. Three were ported in this round
(#3470, #3443, #3574); the small shared fixes that an earlier port batch had
already landed are recorded as duplicates with the fork commit, and the rest are
PENDING with what is missing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
nledford added a commit to nledford/lightcraft that referenced this pull request Nov 6, 2026
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.

1 participant