Skip to content

feat: add sort options to gallery filter (#357)#818

Open
starinsilentsky wants to merge 2 commits into
PastVu:mainfrom
starinsilentsky:feature/issue-357-clean
Open

feat: add sort options to gallery filter (#357)#818
starinsilentsky wants to merge 2 commits into
PastVu:mainfrom
starinsilentsky:feature/issue-357-clean

Conversation

@starinsilentsky

Copy link
Copy Markdown

Summary

Adds three new sorting options to the gallery filter panel:

  • Upload date (ldate) — sort by when the photo was uploaded
  • Last action date (cdate) — sort by last edit/status change
  • Last comment date (lcomdate) — sort by most recent comment

Closes #357

Changes

  • models/Photo.js — new lcomdate field with sparse index
  • controllers/photo.jssort parameter added to filterProps and parseFilter; dynamic sort field in givePhotos
  • controllers/comment.js — update lcomdate on comment add/remove
  • public/js/module/photo/gallery.js — sort observable, filter string, server response handling
  • views/module/photo/gallery.pug — radio button UI for sort selection
  • public/js/lang/i18n.{en,ru}.json — translations for new sort labels
  • controllers/__tests__/photo.sort.test.js — unit tests for sort filter parsing

Testing

npx jest --testPathPatterns=photo.sort
# 5/5 tests passed

@starinsilentsky

Copy link
Copy Markdown
Author

Recreated with clean branch — only 8 files changed, CRLF issue fixed.

@aeifn

aeifn commented Jul 5, 2026

Copy link
Copy Markdown
Member

The first click doesn't work:

Screen.Recording.2026-07-05.at.8.21.01.PM.mov

@aeifn

aeifn commented Jul 5, 2026

Copy link
Copy Markdown
Member

Still works strangely:

Screen.Recording.2026-07-05.at.10.57.13.PM.mov

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.

Add new filters by date in the image galleries / Добавить в галерею фильтры по дате

2 participants