Skip to content

Show the image/video split on the album card - #411

Merged
lstein merged 2 commits into
masterfrom
lstein/fix/album-card-media-split
Sep 29, 2026
Merged

lstein merged 2 commits into
masterfrom
lstein/fix/album-card-media-split

Conversation

@lstein

@lstein lstein commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Closes #368.

Summary

GET /index_metadata/{album_key} has returned image_count and video_count since #360, but nothing in the frontend read them. This wires them into the album card's index-status line through a new exported helper, formatIndexCount() in album-manager.js.

Index contents Card shows
no videos (120 images), same as before
images and videos (120 images, 4 videos)
videos only (4 videos)
one of either 1 image / 1 video
  • Singular and plural are handled everywhere. For image-only albums, the only visible change is that a 1-image album reads (1 image) instead of (1 images).
  • A response without the split fields falls back to filename_count.

Not changed

  • The update-progress toast reads total_images from the progress endpoint, which returns no split, so matching it would need backend work first.
  • The delete and "album contains no images" paths use filename_count only as a total and never display it.
  • The UMAP info panel counts plotted points, not the index.

Tests

New tests/frontend/album-card-media-count.test.js covers the display rules for each case above, the missing-field fallback, and the rendered .index-status text for a mixed album and an image-only album. Full frontend suite: 58 suites, 963 tests passing; eslint and prettier are clean.

🤖 Generated with Claude Code

lstein and others added 2 commits September 28, 2026 22:47
/index_metadata has returned image_count and video_count since #360, but
the album card still showed a single total, so a count that jumped
because videos were indexed gave no hint why. Image-only albums keep the
single count; once videos are present the card reads "N images, M
videos", omitting a zero side. Counts of one are now singular.

Closes #368

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lstein
lstein enabled auto-merge (squash) September 29, 2026 12:06
@lstein
lstein merged commit 135474b into master Sep 29, 2026
11 checks passed
@lstein
lstein deleted the lstein/fix/album-card-media-split branch September 29, 2026 12:22
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.

Album card should show the image/video split returned by /index_metadata

1 participant