Skip to content

LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched - #2054

Merged
aiongg merged 2 commits into
storytold:mainfrom
nledford:grid-follows-batches
Oct 22, 2026
Merged

aiongg merged 2 commits into
storytold:mainfrom
nledford:grid-follows-batches

Conversation

@nledford

@nledford nledford commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Off main.

Part of #1130: the grid reads only the photos a batch added, so they appear sooner.

Problem

Every catalog change gives the grid a new list of photos. It then read every photo of the list again:

  • each photo's date group, for the date headers: a catalog lookup, a date parse and a new string;
  • each cell's shape: crop and orientation.

At 181,749 photos that took about 100 ms. An import or Synchronize Folder adds photos about 16 at a time, so the window lost a tenth of a second for every batch, for as long as the import ran.

Change

  • crates/catalog/src/dates.rs: Catalog::date_runs is split in two, and date_runs now calls both:

    • Catalog::date_group gives one photo's own group.
    • date_runs_of applies the stack rule (a stack's photos take the group of its first photo in the list) and makes the runs.

    The grid uses the same two functions, so its headers are the same as library.groups.

  • crates/ui-egui/src/panels/grid.rs: GridCache keeps what it read of each photo of the list, position by position: its date group and its cell's shape. For a new list, the photos the catalog says changed since (touched_since, at most 4,096) are read again wherever they are now. The other photos are taken over, after checking that they are still in the same order with none added or removed. Otherwise the whole list is read, as before:

    • another view, sort or grouping;
    • a filter that widens or narrows the list;
    • an edit to more than photos (a stack, an album).

    The runs are made again from the groups and the stack index every time. The square grid reads no shapes. A new counter, GridStats::photos_read, counts the photos read.

  • Docs: docs/whats-new.md, and a revision-history line for LR-VIEW-PHOTOGRID in docs/parity-checklist.md.

Not in this PR:

How it was checked

  • cargo xtask ci passes on this branch, which is on current main: all 8 steps.

  • Tests that fail without this change:

    • tests_grid::a_batch_of_new_photos_or_an_edit_to_one_is_read_photo_by_photo:

      • a 16-photo batch, on days already shown, a new day and no date, reads 16 photos, not 3,016;
      • a capture time moved to another day reads 1 photo;
      • both show what a grid made afresh shows.

      I checked that a version that skips re-reading touched photos fails it.

    • tests_grid::a_grid_followed_through_edits_shows_what_a_grid_made_afresh_shows: 120 random edits, each followed by a check that the grid's date runs and cell shapes equal a fresh computation. The edits are imports, deletes, capture times, rotations, crops, ratings, picks, sorts, stacks, undo, the Picks filter, and switching between the photo and square grids.

  • Measured with a throwaway headless test, not committed. Release build, 181,749 photos with dates in 900 folders, photo grid; first frame after a 16-photo batch, median of 20:

    main this PR this PR with LRC-LIB-LIBFOLDERS: importing into a large library keeps the window responsive #2047
    sidebar hidden 101 ms 6.7 ms 7.0 ms
    sidebar shown 194 ms 86 ms 8.4 ms

    The sidebar shown on this PR alone is LRC-LIB-LIBFOLDERS: importing into a large library keeps the window responsive #2047's part: the sidebar counting every photo after each batch.

  • An independent review pass found no blocker. Its three follow-ups are done here:

    • the square grid no longer reads shapes;
    • following moves the group names instead of copying them;
    • the random-edit test now flags photos, so the Picks filter shows some, and it switches between grids.

Screenshots

None: the grid looks the same. What changes is how long a frame takes during an import.

Merging

Checklist

  • No new panic path in non-test code: every index is a get, and a read that doesn't line up falls back to reading the whole list.
  • No new text on screen.
  • docs/whats-new.md and the docs/parity-checklist.md revision history are updated.
  • New code has callers (grid::show_inner, Catalog::date_runs).
  • No assets added.
  • Ready to merge.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Performance
    • The photo grid now updates only affected photos after imports and edits, rather than rereading the entire view when possible.
    • Import batches and capture-time or crop edits can appear more quickly in large libraries.
    • Cached photo dates, grouping, and layout information help keep grid updates responsive during ongoing library changes.

@nledford
nledford force-pushed the grid-follows-batches branch from 1d7c66e to 6ab5bcb Compare October 18, 2026 19:21
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: storytold/lightcraft/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4900d19c-60c4-410d-acee-4313e088d645
📥 Commits

Reviewing files that changed from the base of the PR and between 2bf118c and 53ee384.

📒 Files selected for processing: 3
  • crates/ui-egui/src/tests_grid.rs
  • docs/parity-checklist.md
  • docs/whats-new.md
🚧 Files skipped from review as they are similar to previous changes: 2
  • docs/whats-new.md
  • docs/parity-checklist.md

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

📝 Walkthrough

The catalog now builds date runs through reusable date-group logic. The photo grid caches date groups and shapes, rereads only eligible changes, and falls back to full reads when reuse checks fail. Tests and documentation cover the update.

Changes: Incremental grid updates

Layer / File(s) Summary
Date grouping and run construction
crates/catalog/src/dates.rs
Date runs now validate supported date-sort and grouping combinations. Per-photo date groups and stack-aware consecutive runs use reusable helpers.
Cached per-photo data and incremental reuse
crates/ui-egui/src/panels/grid.rs
GridCache stores date groups and optional shapes. It rereads touched photos when compatibility and touch-count checks allow reuse. Otherwise, it rereads the full list.
Grid layout and update validation
crates/ui-egui/src/panels/grid.rs, crates/ui-egui/src/tests_grid.rs, docs/parity-checklist.md, docs/whats-new.md
Layouts use cached shapes or square-grid unit shapes. Tests compare incremental results with fresh calculations across imports and varied edits. Documentation records the update and the reported 16-photo batch measurement of 7 ms instead of 101 ms.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Grid
  participant GridCache
  participant ListRead
  participant Catalog
  Grid->>GridCache: Request date runs and layout data
  GridCache->>ListRead: Reuse compatible cached photo data
  ListRead->>Catalog: Read touched photos or the full list
  Catalog-->>ListRead: Return date groups and shapes
  ListRead-->>GridCache: Return updated cached data
  GridCache-->>Grid: Provide date runs and cached shapes
Loading

Suggested reviewers: fredapps

Merge Risk: ⚪ Minimal · up to 53ee3

No actionable issue remains in the reviewed grid update; it is ready to merge after normal checks.

Architecture risk: 🟡 Medium · up to 53ee3

The change affects 2 systems.

Changed systems: crates, docs

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 3 changed files map to changed impact.
  • observed — docs (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/catalog/src/dates.rs: date_runs now uses groups_by_date to reject unsupported sort/group combinations and delegates run construction to date_runs_of. The new date_group method returns the selected date prefix for capture, import, or edit sorting, or an empty key when the photo, date, or sort key is unusable. The previous inline date lookup and stack-aware run-building logic was removed.
  • observed — Modified behavior in crates/catalog/src/dates.rs: Added groups_by_date, which enables runs only when grouping is not None and the sort key is capture, import, or edit date.
  • observed — Modified behavior in crates/catalog/src/dates.rs: Added generic date_runs_of to build consecutive date runs from a callback-provided key and stack index. The first encountered member’s key is retained for each stack; matching adjacent keys extend the current run, and differing keys start a run with a label, starting index, and count.
  • observed — Modified behavior in crates/ui-egui/src/panels/grid.rs: Added cumulative GridStats::photos_read, counting catalog photo date/shape reads.

Reliability and maintainability

  • inferred — Risk-relevant change factors for crates: blast_radius_2; direct_dependents_2
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. Analyzed 20 functions across 3 files. (2 skipped: … 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 and concisely describes the main change: the grid rereads only photos affected by an import batch or edit.
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. Analyzed 20 functions across 3 files. (2 skipped: 2 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.

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a comment rather than an approval only because one hosted job did not finish. I found no defect in the change. I have not built or run it.

Hosted result at 6ab5bcb7. freebsd / FreeBSD 15 x86_64 (build + test) passed (it runs cargo test --workspace --locked; I checked its log: 1,147 tests passed in the UI crate, and both new tests, a_batch_of_new_photos_or_an_edit_to_one_is_read_photo_by_photo and a_grid_followed_through_edits_shows_what_a_grid_made_afresh_shows, ran and passed). windows-arm64 / package and install and run on ARM64 passed. freebsd / FreeBSD 15 aarch64 (build + test) was cancelled after running from 19:21 to 00:21 (about five hours, so it looks like a runner or timeout cancel, not a test result), and CodeRabbit reports nothing. Please re-run the aarch64 job; once it is green I have nothing further to ask for.

What I read. The whole code diff: catalog/src/dates.rs, ui-egui/src/panels/grid.rs and ui-egui/src/tests_grid.rs. I did not read the docs edits beyond the file names, or the catalog's touched_since/revision implementation that follow depends on (it is not in this diff).

What I checked, and it holds.

  • Refactor of date_runs. date_group is the old date_of closure unchanged (same key choice, same ISO check, same prefix), groups_by_date is the old early returns, and date_runs_of keeps the stack rule: a stack's members take the group of the first photo of the stack met in the list. Catalog::date_runs now calls the two, so the catalog tests keep covering the old behaviour.
  • Following a list. ListRead::follow reuses a photo's stored group and shape only when it is untouched since the last read and is where it was among the other untouched photos; it falls back to a whole read when the grouping, shape mode or order changed, when touched_since returns None, when more than 4,096 photos were touched, or when an untouched photo left the list. Photos touched are read again wherever they are now, so a changed capture date or crop lands correctly.
  • Cache keys. The old runs cache is kept but now also requires that the shape data matches the mode (shapes.is_some() == shaped), so toggling Photo grid and Square grid rebuilds instead of showing stale shapes.
  • Tests. The first test pins the cost (16 photos read for a 16-photo batch, 1 for a capture-time edit) and the visible result (new day header). The second runs 120 seeded random edits (import, delete, capture time, rotate, crop, rating, sort, stack, undo, flag, view toggle, filter) and after each compares the cache's runs and shapes with a grid built afresh from the catalog, which is the right check for this kind of cache.

Non-blocking points.

  • The group names are never pruned. names and named carry over on every follow and are only reset by a whole read, so a long session of capture-time edits to many different days grows them. The cost is a short string per distinct day or month, so I mention it only because the code comment says an import adds "a day or two at most" and edits can add more.
  • Switching grid mode rereads everything. A change from Photo grid to Square grid (or back) makes follow return None at once and reads every photo again, about the 100 ms the PR is removing, on each toggle. That is rare, but a note would save a reader wondering.
  • One seed. The random test uses a fixed seed (dice = 11), so it checks one 120-step path. Running a few seeds in a loop would make it a broader regression net at no real cost.

Not covered. FreeBSD aarch64 (cancelled), macOS, and x64 Windows tests.

@nledford

Copy link
Copy Markdown
Contributor Author

@FredApps thank you, these were good suggestions.

  • Seeds: in 2bf118c04 the follow test now runs seeds 11–15, each with a fresh grid and the seed in the failure message. All five pass, about 3.5 s in total.
  • Mode switch: there's now a comment where follow gives up on a Photo grid ↔ Square grid switch. That re-reads every photo once on purpose, since the other mode's shapes were never read.
  • Names: I kept them unpruned and corrected the comment instead. Pruning would renumber every photo's group on each follow, which is the full pass following exists to avoid. The growth is one short string per new day or month, and a whole read resets it.
  • FreeBSD aarch64: this push started a fresh run, since I can't restart the cancelled one myself.

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the whole diff at this head. The incremental read is sound.

  • ListRead::follow re-reads only the photos touched_since reports, takes the rest over by position, and falls back to a whole read whenever an untouched photo is not where it was, an untouched photo left the list, the sort/grouping/mode changed, or more than MAX_FOLLOWED photos were touched. Stack edits return None from touched_since, so they read whole, and stack members still take their first photo's group because the runs are built through date_runs_of.
  • date_runs now goes through the same date_group/date_runs_of path, so there is one definition of a group.
  • The randomized test compares the followed grid with a grid made afresh across imports, deletes, capture times, rotation, crops, sorts, stacks, undo, filters and view switches. That is the right check for this kind of cache.

Nit, no change needed: names only grows between whole reads. The comment says so and the growth is a short string per new day, so that is fine.

FreeBSD x86_64 build + test and the Windows ARM64 jobs are green at this head.

nledford and others added 2 commits October 21, 2026 13:17
…an edit touched

Every catalog change gave the grid a new list of photos, and it read every
photo of it again: each one's date group (a lookup, a date parse and a
string) and its cell's shape. At 180,000 photos that was a 100 ms frame for
every batch an import added.

- catalog: Catalog::date_runs is split into date_group (one photo's own
  group) and date_runs_of (the stack rule and the runs), which the grid
  uses too.
- ui: GridCache keeps what it read of each photo of the list, position by
  position. A new list that differs by the photos the catalog says an edit
  touched is read again only for those; anything else (another view,
  order or grouping, a stack) is read whole. The square grid reads no
  shapes. A 16-photo batch at 181,749 photos: 101 ms -> 7 ms.

Co-Authored-By: Claude <noreply@anthropic.com>
…ch and the names

The random-edit test now runs five seeds instead of one. A grid-mode change
re-reading every photo, and the group names growing unpruned, are now said in
the comments (the "a day or two at most" claim was wrong for capture-time edits).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nledford

Copy link
Copy Markdown
Contributor Author

Rebased onto main (e142e2f) after the integration round; the conflicts were in crates/ui-egui/src/tests_grid.rs, docs/parity-checklist.md and docs/whats-new.md. In tests_grid.rs main added the double-click-on-a-stack-badge test at the same spot as this PR's assert_as_made_afresh test; both tests are kept. just ci passes.

@nledford
nledford force-pushed the grid-follows-batches branch from 2bf118c to 53ee384 Compare October 21, 2026 21:37
aiongg added a commit to aiongg/lightcraft that referenced this pull request Oct 22, 2026
The PR's branch carried a second header line; its change note joins the existing one.
@aiongg
aiongg merged commit 61ad2ff into storytold:main Oct 22, 2026
4 of 5 checks passed
THEtheChad added a commit to THEtheChad/lightcraft that referenced this pull request Oct 27, 2026
…h develop edits

The caches still keyed on the raw catalog revision move to `still_right`:
keyword names, chips, groups and ticks, the filter bar's values, keyword
completions and suggestions (what they read: photos' metadata), the
selection count, smart-album problems, face hints and the Missing count
(anything but develop state), People and the rule dialog's count (develop
state only when the filter or rules, or a smart album they test, read it).
A kept entry moves its revision on, so the change record it asks stays short.

The grid's list now stays the same through a develop edit when the view
reads no develop state, so its date runs and stack index aren't rebuilt.
Cell shapes (crop, orientation) are develop state: on a kept list,
`GridCache::reshape` reads again the shapes of the photos `touched_since`
the list was read (storytold#2054's `ListRead`), and the justified layout keys on
`GridCache::shapes`, moved on each time it does.

`ui.inspect` -> `perf` reports `viewKept`.

Tests: 20 develop ticks keep the trees, keyword lists, filter values,
People, suggestions, smart-album problems and the rule dialog's count,
while rules testing Has Edits, Cropped or such an album follow the edits;
`develop.set` through the control channel keeps the grid's list, runs and
stack index (and the square layout), and a rotation still re-lays the
justified grid with the list unchanged, its cells as a grid made afresh
shows them. storytold#2054's randomized check (rotations and crops among its edits)
holds with the lists now kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
THEtheChad added a commit to THEtheChad/lightcraft that referenced this pull request Oct 27, 2026
… a cell's shape changed

On a kept list, `GridCache::reshape` reads the shapes of the photos
`touched_since` the list was read (storytold#2054's `ListRead`), and moves
`GridCache::shapes`, the justified layout's key, only when one of them is
not what it was. Only a crop or a rotation changes a cell's shape, so an
exposure tick no longer lays out the whole grid again.

Frame after an exposure tick, 67k photos, Photo Grid alone, headless
app, release (median of 10 runs of the median of 40 ticks): 2.8 ms ->
2.5 ms, with a layout on every tick before and none now (main: 7.5 ms).

Test: `develop_edits_keep_the_grid_view` checks that exposure ticks lay
out neither grid, and that a rotation still lays out the Photo Grid
again with the list kept, its cells as a grid made afresh shows them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
THEtheChad added a commit to THEtheChad/lightcraft that referenced this pull request Oct 27, 2026
…h develop edits

The caches still keyed on the raw catalog revision move to `still_right`:
keyword names, chips, groups and ticks, the filter bar's values, keyword
completions and suggestions (what they read: photos' metadata), the
selection count, smart-album problems, face hints and the Missing count
(anything but develop state), People and the rule dialog's count (develop
state only when the filter or rules, or a smart album they test, read it).
A kept entry moves its revision on, so the change record it asks stays short.

The grid's list now stays the same through a develop edit when the view
reads no develop state, so its date runs and stack index aren't rebuilt.
Cell shapes (crop, orientation) are develop state: on a kept list,
`GridCache::reshape` reads again the shapes of the photos `touched_since`
the list was read (storytold#2054's `ListRead`), and the justified layout keys on
`GridCache::shapes`, moved on each time it does.

`ui.inspect` -> `perf` reports `viewKept`.

Tests: 20 develop ticks keep the trees, keyword lists, filter values,
People, suggestions, smart-album problems and the rule dialog's count,
while rules testing Has Edits, Cropped or such an album follow the edits;
`develop.set` through the control channel keeps the grid's list, runs and
stack index (and the square layout), and a rotation still re-lays the
justified grid with the list unchanged, its cells as a grid made afresh
shows them. storytold#2054's randomized check (rotations and crops among its edits)
holds with the lists now kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
THEtheChad added a commit to THEtheChad/lightcraft that referenced this pull request Oct 27, 2026
… a cell's shape changed

On a kept list, `GridCache::reshape` reads the shapes of the photos
`touched_since` the list was read (storytold#2054's `ListRead`), and moves
`GridCache::shapes`, the justified layout's key, only when one of them is
not what it was. Only a crop or a rotation changes a cell's shape, so an
exposure tick no longer lays out the whole grid again.

Frame after an exposure tick, 67k photos, Photo Grid alone, headless
app, release (median of 10 runs of the median of 40 ticks): 2.8 ms ->
2.5 ms, with a layout on every tick before and none now (main: 7.5 ms).

Test: `develop_edits_keep_the_grid_view` checks that exposure ticks lay
out neither grid, and that a rotation still lays out the Photo Grid
again with the list kept, its cells as a grid made afresh shows them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
THEtheChad added a commit to THEtheChad/lightcraft that referenced this pull request Oct 31, 2026
…h develop edits

The caches still keyed on the raw catalog revision move to `still_right`:
keyword names, chips, groups and ticks, the filter bar's values, keyword
completions and suggestions (what they read: photos' metadata), the
selection count, smart-album problems, face hints and the Missing count
(anything but develop state), People and the rule dialog's count (develop
state only when the filter or rules, or a smart album they test, read it).
A kept entry moves its revision on, so the change record it asks stays short.

The grid's list now stays the same through a develop edit when the view
reads no develop state, so its date runs and stack index aren't rebuilt.
Cell shapes (crop, orientation) are develop state: on a kept list,
`GridCache::reshape` reads again the shapes of the photos `touched_since`
the list was read (storytold#2054's `ListRead`), and the justified layout keys on
`GridCache::shapes`, moved on each time it does.

`ui.inspect` -> `perf` reports `viewKept`.

Tests: 20 develop ticks keep the trees, keyword lists, filter values,
People, suggestions, smart-album problems and the rule dialog's count,
while rules testing Has Edits, Cropped or such an album follow the edits;
`develop.set` through the control channel keeps the grid's list, runs and
stack index (and the square layout), and a rotation still re-lays the
justified grid with the list unchanged, its cells as a grid made afresh
shows them. storytold#2054's randomized check (rotations and crops among its edits)
holds with the lists now kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
THEtheChad added a commit to THEtheChad/lightcraft that referenced this pull request Oct 31, 2026
… a cell's shape changed

On a kept list, `GridCache::reshape` reads the shapes of the photos
`touched_since` the list was read (storytold#2054's `ListRead`), and moves
`GridCache::shapes`, the justified layout's key, only when one of them is
not what it was. Only a crop or a rotation changes a cell's shape, so an
exposure tick no longer lays out the whole grid again.

Frame after an exposure tick, 67k photos, Photo Grid alone, headless
app, release (median of 10 runs of the median of 40 ticks): 2.8 ms ->
2.5 ms, with a layout on every tick before and none now (main: 7.5 ms).

Test: `develop_edits_keep_the_grid_view` checks that exposure ticks lay
out neither grid, and that a rotation still lays out the Photo Grid
again with the list kept, its cells as a grid made afresh shows them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
THEtheChad added a commit to THEtheChad/lightcraft that referenced this pull request Nov 1, 2026
…h develop edits

The caches still keyed on the raw catalog revision move to `still_right`:
keyword names, chips, groups and ticks, the filter bar's values, keyword
completions and suggestions (what they read: photos' metadata), the
selection count, smart-album problems, face hints and the Missing count
(anything but develop state), People and the rule dialog's count (develop
state only when the filter or rules, or a smart album they test, read it).
A kept entry moves its revision on, so the change record it asks stays short.

The grid's list now stays the same through a develop edit when the view
reads no develop state, so its date runs and stack index aren't rebuilt.
Cell shapes (crop, orientation) are develop state: on a kept list,
`GridCache::reshape` reads again the shapes of the photos `touched_since`
the list was read (storytold#2054's `ListRead`), and the justified layout keys on
`GridCache::shapes`, moved on each time it does.

`ui.inspect` -> `perf` reports `viewKept`.

Tests: 20 develop ticks keep the trees, keyword lists, filter values,
People, suggestions, smart-album problems and the rule dialog's count,
while rules testing Has Edits, Cropped or such an album follow the edits;
`develop.set` through the control channel keeps the grid's list, runs and
stack index (and the square layout), and a rotation still re-lays the
justified grid with the list unchanged, its cells as a grid made afresh
shows them. storytold#2054's randomized check (rotations and crops among its edits)
holds with the lists now kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
THEtheChad added a commit to THEtheChad/lightcraft that referenced this pull request Nov 1, 2026
… a cell's shape changed

On a kept list, `GridCache::reshape` reads the shapes of the photos
`touched_since` the list was read (storytold#2054's `ListRead`), and moves
`GridCache::shapes`, the justified layout's key, only when one of them is
not what it was. Only a crop or a rotation changes a cell's shape, so an
exposure tick no longer lays out the whole grid again.

Frame after an exposure tick, 67k photos, Photo Grid alone, headless
app, release (median of 10 runs of the median of 40 ticks): 2.8 ms ->
2.5 ms, with a layout on every tick before and none now (main: 7.5 ms).

Test: `develop_edits_keep_the_grid_view` checks that exposure ticks lay
out neither grid, and that a rotation still lays out the Photo Grid
again with the list kept, its cells as a grid made afresh shows them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
THEtheChad added a commit to THEtheChad/lightcraft that referenced this pull request Nov 4, 2026
…h develop edits

The caches still keyed on the raw catalog revision move to `still_right`:
keyword names, chips, groups and ticks, the filter bar's values, keyword
completions and suggestions (what they read: photos' metadata), the
selection count, smart-album problems, face hints and the Missing count
(anything but develop state), People and the rule dialog's count (develop
state only when the filter or rules, or a smart album they test, read it).
A kept entry moves its revision on, so the change record it asks stays short.

The grid's list now stays the same through a develop edit when the view
reads no develop state, so its date runs and stack index aren't rebuilt.
Cell shapes (crop, orientation) are develop state: on a kept list,
`GridCache::reshape` reads again the shapes of the photos `touched_since`
the list was read (storytold#2054's `ListRead`), and the justified layout keys on
`GridCache::shapes`, moved on each time it does.

`ui.inspect` -> `perf` reports `viewKept`.

Tests: 20 develop ticks keep the trees, keyword lists, filter values,
People, suggestions, smart-album problems and the rule dialog's count,
while rules testing Has Edits, Cropped or such an album follow the edits;
`develop.set` through the control channel keeps the grid's list, runs and
stack index (and the square layout), and a rotation still re-lays the
justified grid with the list unchanged, its cells as a grid made afresh
shows them. storytold#2054's randomized check (rotations and crops among its edits)
holds with the lists now kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
THEtheChad added a commit to THEtheChad/lightcraft that referenced this pull request Nov 4, 2026
… a cell's shape changed

On a kept list, `GridCache::reshape` reads the shapes of the photos
`touched_since` the list was read (storytold#2054's `ListRead`), and moves
`GridCache::shapes`, the justified layout's key, only when one of them is
not what it was. Only a crop or a rotation changes a cell's shape, so an
exposure tick no longer lays out the whole grid again.

Frame after an exposure tick, 67k photos, Photo Grid alone, headless
app, release (median of 10 runs of the median of 40 ticks): 2.8 ms ->
2.5 ms, with a layout on every tick before and none now (main: 7.5 ms).

Test: `develop_edits_keep_the_grid_view` checks that exposure ticks lay
out neither grid, and that a rotation still lays out the Photo Grid
again with the list kept, its cells as a grid made afresh shows them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
THEtheChad added a commit to THEtheChad/lightcraft that referenced this pull request Nov 13, 2026
…h develop edits

The caches still keyed on the raw catalog revision move to `still_right`:
keyword names, chips, groups and ticks, the filter bar's values, keyword
completions and suggestions (what they read: photos' metadata), the
selection count, smart-album problems, face hints and the Missing count
(anything but develop state), People and the rule dialog's count (develop
state only when the filter or rules, or a smart album they test, read it).
A kept entry moves its revision on, so the change record it asks stays short.

The grid's list now stays the same through a develop edit when the view
reads no develop state, so its date runs and stack index aren't rebuilt.
Cell shapes (crop, orientation) are develop state: on a kept list,
`GridCache::reshape` reads again the shapes of the photos `touched_since`
the list was read (storytold#2054's `ListRead`), and the justified layout keys on
`GridCache::shapes`, moved on each time it does.

`ui.inspect` -> `perf` reports `viewKept`.

Tests: 20 develop ticks keep the trees, keyword lists, filter values,
People, suggestions, smart-album problems and the rule dialog's count,
while rules testing Has Edits, Cropped or such an album follow the edits;
`develop.set` through the control channel keeps the grid's list, runs and
stack index (and the square layout), and a rotation still re-lays the
justified grid with the list unchanged, its cells as a grid made afresh
shows them. storytold#2054's randomized check (rotations and crops among its edits)
holds with the lists now kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
THEtheChad added a commit to THEtheChad/lightcraft that referenced this pull request Nov 13, 2026
… a cell's shape changed

On a kept list, `GridCache::reshape` reads the shapes of the photos
`touched_since` the list was read (storytold#2054's `ListRead`), and moves
`GridCache::shapes`, the justified layout's key, only when one of them is
not what it was. Only a crop or a rotation changes a cell's shape, so an
exposure tick no longer lays out the whole grid again.

Frame after an exposure tick, 67k photos, Photo Grid alone, headless
app, release (median of 10 runs of the median of 40 ticks): 2.8 ms ->
2.5 ms, with a layout on every tick before and none now (main: 7.5 ms).

Test: `develop_edits_keep_the_grid_view` checks that exposure ticks lay
out neither grid, and that a rotation still lays out the Photo Grid
again with the list kept, its cells as a grid made afresh shows them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

3 participants