Skip to content

Offer text-label landmarks on the semantic map - #434

Open
lstein wants to merge 1 commit into
masterfrom
lstein/feature/text-landmarks
Open

lstein wants to merge 1 commit into
masterfrom
lstein/feature/text-landmarks

Conversation

@lstein

@lstein lstein commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Landmarks pulldown replaces the "Show landmarks" checkbox: None, Thumbnails, or Text labels.
  • Text labels are rounded tags filled with the cluster's colour, with black or white text chosen for contrast. They show the cluster's autotag phrase, or "Cluster N" when autotagging is off. Each label is centred on its cluster. Labels follow the media filter, are placed so they don't overlap (up to 24 in view), and redraw when cluster labels arrive or change. Clicking a label acts like clicking a thumbnail landmark.
  • Controls rebalanced into a centred two-column grid. Left column: Cluster Strength, Landmarks, Click selects. Right column: hover thumbnails, highlight selection, exit fullscreen. In windows narrower than 480px the columns stay side by side and their labels wrap, because the phone fullscreen layout fixes this area at 60px tall.
  • New preference umapLandmarkStyle, with a server field to match. It is seeded from the old umapShowLandmarks, so devices that had landmarks off get "None". It only accepts the three valid values, so a corrupt stored value can't get a whole preferences update rejected by the server.
  • Two existing landmark redraw bugs fixed:
    • newPlot left the "already drawn" caches set. After a recluster, an identical redraw was skipped and landmarks stayed missing until the next pan.
    • The thumbnail cache was recorded only after the images loaded, so switching style mid-load left thumbnails on screen.
  • User-guide docs updated.

Notes

  • Rounded corners come from CSS rx/ry on Plotly's annotation background rectangle, because Plotly has no corner-radius option. This is verified in Chromium only. If Safari ignores it, the tags fall back to square corners.
  • Panning: labels are clickable (captureevents), so a drag that starts on a label doesn't pan the map.
  • Touch pan: text labels, like the thumbnails, are drawn as SVG over the WebGL dots. During a touch-pan they slide while the dots stay put until the gesture ends.
  • Existing curation-mode bug: clicking a thumbnail landmark passes a cluster id to the curation click callback where an image index is expected. Clicking a text label passes the representative image index. The thumbnail behaviour is untouched here.

Test plan

  • npm test: 1059 passed, including new tests for text-label rendering, the media filter, style switching, clicks, escaping, redraw after re-plot, and preference migration/validation
  • pytest tests/backend: passed; make lint and format:check are clean
  • Headless Chromium screenshots of fullscreen, medium, small and phone widths on a real album
  • Adversarial fresh-context review; its two confirmed findings are fixed in this PR
  • Check the label corners and the pulldown on an iPad

🤖 Generated with Claude Code

Replace the "Show landmarks" checkbox with a Landmarks pulldown: None,
Thumbnails, or Text labels. Text labels are Plotly annotations centred on
each cluster: rounded tags filled with the cluster colour, black or white
text for contrast, showing the autotag phrase (or "Cluster N"). They follow
the media filter, avoid overlapping, redraw when cluster labels change, and
clicking one acts like clicking a thumbnail landmark.

The controls under the map are rebalanced into a two-column grid, with a
container query that lets the columns wrap in narrow windows.

The new umapLandmarkStyle preference is seeded from the old
umapShowLandmarks so devices keep their on/off choice, and is validated
against its allowed values so a corrupt stored value can't get a whole
preferences PATCH rejected.

Also fixes two cache bugs in landmark redraws: newPlot left the
thumbnail/label caches set, so an identical redraw after a recluster was
skipped and landmarks stayed missing; and the thumbnail cache was recorded
only after the images loaded, so switching style mid-load left thumbnails
on screen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch has not been deployed

No deployments
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