Skip to content

LRC-MAP-VIEW: one filmstrip click centres the map on the photo, keeping the zoom - #1541

Closed
tyhwer wants to merge 3 commits into
emmertex:mainfrom
tyhwer:map/filmstrip-click-centres
Closed

tyhwer wants to merge 3 commits into
emmertex:mainfrom
tyhwer:map/filmstrip-click-centres

Conversation

@tyhwer

@tyhwer tyhwer commented Nov 27, 2026 •

Copy link
Copy Markdown

Problem

In Chromaforge's Map module, one click on a filmstrip thumbnail only moves the map when the photo's pin is off screen (fork #741), and then by the least pan that brings it in; it takes a double-click to centre on the photo, and that also zooms in. Lightroom Classic centres the map on the clicked photo with one click and keeps the zoom; when the pin is close by, the map slides over rather than jumping, so it is clear where the new photo is in relation to the last.

Change

  • One click (crates/ui-egui/src/panels/detail.rs → map::centre_on_photo): in the Map module, a click on a filmstrip thumbnail centres the map on that photo's pin at the current zoom. Within three map widths it glides there (0.45 s, eased, the short way across the antimeridian); farther, it jumps. A photo without a position leaves the map alone.
  • The glide (crates/ui-egui/src/map/mod.rs, glide_step, called each frame from view.rs): it remembers the centre it set last frame, so anything else that moves the map (a drag, wheel zoom, search, map.view, the double-click's zoom) ends it where it is. The click's own selection change no longer also runs the off-screen reveal, so the two don't fight.
  • A double-click still frames the pin and zooms in (map.reveal {force}); other selection changes still pan to off-screen pins as before.

How it was checked

  • cargo xtask ci --quick (all 16 steps) passes on this branch, up to date with main
  • map::tests::one_filmstrip_click_centres_the_map_on_the_photo_and_keeps_the_zoom fails without this change: a photo about a kilometre away at zoom 12 is not reached in one frame but is centred once the glide ends, with the zoom unchanged and the photo selected; Madrid from Paris is a jump in one frame; a photo with no position leaves the map where it is; glide_step stops on a map that something else moved
  • User-visible change: ran the app (demo library) and clicked between near and far photos

Screenshots

Headless renders of the demo library on a plain tile server (attached below): (1) before: the map centred on Home at zoom 14; (2) after one click on a filmstrip photo about 3.5 km away: centred on it, same zoom. The glide itself is motion and does not show in a still.

5a-before-one-click 5b-after-one-click-centred-same-zoom

Merging

  • Overlap: none found among open pull requests. Companion Map pull requests add a MapUi field next to glide, append to map/tests.rs and edit the same manual lines; keep both
  • Existing edits and libraries: unchanged; no catalog or format change. The map's saved view is written once a glide ends, as after a drag
  • Shared numbers taken: none
  • Where it came from: own design, behaviour modelled on Lightroom Classic's Map module (observed, no assets)
  • New dependencies, unsafe, build scripts, network access, spawned processes, deleted files, CI or xtask gate changes: none

Checklist

  • No new panic path in non-test code
  • No new text on screen; no new shortcut
  • docs/parity-checklist.md LRC-MAP-VIEW updated (stays 🟡: no animated zoom)
  • Manual updated (library/map.mdx, output/map.mdx), What's New and changelog entries added
  • New code has a caller
  • No new assets
  • Ready to merge

🤖 Generated with Claude Code

…ng the zoom

As in Lightroom Classic, a single click on a filmstrip thumbnail in the Map
module centres the map on that photo's pin at the zoom the map has. Within
three map widths the map glides there (0.45 s, eased); farther it jumps. A
photo without a position leaves the map alone, and anything else that moves
the map (a drag, a zoom, a search) ends a glide where it is. The click's own
selection change no longer also runs the off-screen reveal. A double-click
still frames the pin and zooms in (map.reveal {force}).

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

@emmertex emmertex left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed and it reads sound (CI was green), but it now conflicts with main after #1538 landed (map/tests.rs appends, map manual pages). Please merge origin/main; note #1540 and #1541 also touch the same spots (MapUi fields, end of map/tests.rs, map.mdx lines), so whichever lands second will need one more merge. I'll approve and merge on a later pass once the new head is green.

…entres

# Conflicts:
#	crates/ui-egui/src/map/tests.rs
@emmertex
emmertex enabled auto-merge November 27, 2026 05:39
auto-merge was automatically disabled November 27, 2026 05:42

Head branch was pushed to by a user without write access

@tyhwer

tyhwer commented Nov 27, 2026

Copy link
Copy Markdown
Author

Merged origin/main. The only conflict was the map/tests.rs appends (main's file is kept as is, with this branch's test after it); the manual and parity lines merged cleanly. cargo xtask ci --quick passes on the new head. Whichever of #1540 and #1541 lands second will need one more merge, as you said; I can do that as soon as the first one lands.

@emmertex

Copy link
Copy Markdown
Owner

Reviewed earlier and CI is green, but #1539 just merged and this branch now conflicts with main. Please merge main and push; I'll approve and merge on the next run if CI stays green.

…entres

# Conflicts:
#	crates/ui-egui/src/map/tests.rs
@tyhwer

tyhwer commented Nov 27, 2026

Copy link
Copy Markdown
Author

Merged main again after #1539 (the same map/tests.rs append conflict, resolved the same way); cargo xtask ci --quick passes on the new head.

@tyhwer

tyhwer commented Nov 27, 2026

Copy link
Copy Markdown
Author

This change landed on main through #1547 (merged 2026-11-27 09:04 UTC), which merged an earlier head of this branch with the conflicts resolved. GitHub still shows this PR as open because of the later main-merge push here, so it can be closed.

@emmertex emmertex closed this Nov 27, 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.

2 participants