Add gallery folder and sort order controls (#3605)

* Add gallery folder and sort order controls
Closes #3601

* Refactor sort constants to use Object.freeze for immutability

* Add comment

* Remove excessive null propagation

* Update type hint for gallery.folders

* Use defaultSettings.sort as a fallback

* Throw in groups

* Handle rename/deletion events

* Merge init functions

* Fix multiple gallery file uplods

* Add min-height for gallery element

* Fix gallery endpoint not parsing body

* translatable toasts

* Pass folder path in request body

* Change restore pictogram

* Add title to gallery thumbnail images

* Allow optional folder parameter in image list endpoint and handle deprecated usage warning

* Add validation for folder parameter in image list endpoint

* Add border to gallery sort selection

* Remove override if default folder is set to input

* Use server-side path sanitation

* Sanitize gallery folder input before updating

---------

Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
This commit is contained in:
Cohee
2025-03-04 23:16:56 +02:00
committed by GitHub
parent 70f762c006
commit 8d608bcd72
4 changed files with 421 additions and 84 deletions

View File

@ -210,6 +210,12 @@ export const extension_settings = {
* @type {string[]}
*/
disabled_attachments: [],
gallery: {
/** @type {{[characterKey: string]: string}} */
folders: {},
/** @type {string} */
sort: 'dateAsc',
},
};
function showHideExtensionsMenu() {