Skip to content

feat: Search the gallery, and choose its order - #79

Merged
mrtncode merged 2 commits into
mrtncode:mainfrom
SirTerrific:pr-gallery-search
Aug 13, 2026
Merged

feat: Search the gallery, and choose its order#79
mrtncode merged 2 commits into
mrtncode:mainfrom
SirTerrific:pr-gallery-search

Conversation

@SirTerrific

Copy link
Copy Markdown
Contributor

The gallery shows whatever order the filesystem hands back — neither alphabetical nor chronological — and shows all of it. Finding one image among a few hundred means scrolling and hoping.

What this does

  • Newest first by default. created_at from the database where a row exists, the file's own mtime otherwise, so images that predate the database still land somewhere sensible rather than at an arbitrary position.
  • ?q= filters by name, case-insensitive.
  • ?sort=oldest|name changes the order.

The response stays a plain list of filenames, so nothing that consumes /api/images has to change.

The search box is debounced by 250ms — typing eight characters queries once, not eight times.

4 tests added, 28 pass. Frontend typechecks and builds.

Independent of #72#77.

🤖 Generated with Claude Code

The gallery showed whatever order the filesystem returned, which is neither
alphabetical nor chronological, and it showed all of it. Finding one image among
a few hundred meant scrolling and hoping.

The listing is now newest first by default, and takes ?q= to filter by name and
?sort=oldest|name to change the order. The response is still a plain list of
filenames, so nothing that consumes it has to change.

Ordering uses the database's created_at where a row exists and the file's own
mtime otherwise, so images that predate the database still land somewhere
sensible instead of at an arbitrary position.

The search box is debounced by 250ms: typing eight characters queries once, not
eight times.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mrtncode mrtncode added the enhancement New feature or request label Aug 11, 2026
@mrtncode
mrtncode merged commit d437fad into mrtncode:main Aug 13, 2026
2 checks passed
@mrtncode

Copy link
Copy Markdown
Owner

Thanks!

@mrtncode

mrtncode commented Aug 13, 2026

Copy link
Copy Markdown
Owner

@SirTerrific All PRs reviewed 😄
Thank you for your great effort! Looking forward to more PRs 🤗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants