Skip to content

Gallery view for folders of pictures - #26

Merged
ssenerg merged 1 commit into
mainfrom
gallery
Oct 25, 2026
Merged

ssenerg merged 1 commit into
mainfrom
gallery

Conversation

@ssenerg

@ssenerg ssenerg commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Stacked on #25 (folder share end dates). Merge #25 first, then this one.

What it does

  • List or grid. Two buttons next to Download zip switch a folder between the list and a grid of thumbnail tiles.
    • The switch happens in place, and the browser remembers the choice for that folder.
    • ?layout=grid|list asks for a layout in a link, and the sort links keep a layout that was asked for that way.
  • Grid by default for pictures. Folders whose files are mostly pictures and videos (two thirds, at least three) open as a grid. Everything else opens as a list, as before.
  • Same features in both layouts. The grid is the same table, laid out as tiles with CSS, so ticking entries, the ⋯ menu, sorting, filtering, the parent folder, and New/selected highlights all keep working.
    • Checkboxes show on hover, and all of them show once one is ticked.
    • Phones get three columns.
    • Share-link pages get the grid too.
  • Viewer:
    • follows the folder's sort order (?view&sort=modified&order=desc, carried through prev/next and back to the folder) instead of always going by name;
    • fetches the next picture ahead;
    • turns pages with a horizontal swipe on touch screens.
  • The grid uses the existing 256 px thumbnails. Videos and other files show their icon.

Tests

  • gallery_test.go covers:
    • picking the layout automatically and as asked;
    • sort links keeping a requested layout, and layout links keeping the sort;
    • viewer links carrying the order;
    • previous and next following the folder's order, the prefetch, and the way back to the folder.
  • Server suite with -race passes on macOS (except the known macOS-only TestLongNonASCIIPath). CI runs Linux.
  • Checked in the browser against a local server with 10 generated photos:
    • grid and list on desktop and phone;
    • the toggle, and remembering it across a reload;
    • arrow keys and a simulated swipe in the viewer.
  • That check also showed the new end-date choice cut off on phones; that fix went into End dates for folder shares #25.

🤖 Generated with Claude Code

Folders can be laid out as a list or as a grid, with two buttons next
to Download zip; a choice is remembered for the folder in the browser,
and folders that hold mostly pictures and videos open as a grid. The
grid is the same table laid out as tiles, so ticking entries, their
menus, sorting and filtering work as in the list.

The viewer now goes through a folder in the order it was sorted in,
fetches the next picture ahead, and turns pages with a swipe on touch
screens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ssenerg ssenerg mentioned this pull request Oct 25, 2026
@ssenerg
ssenerg changed the base branch from share-end-dates to main October 25, 2026 18:52
@ssenerg
ssenerg merged commit 11824ac into main Oct 25, 2026
4 checks passed
@ssenerg
ssenerg deleted the gallery branch October 25, 2026 19:08
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