feat(asset): Recently Deleted previews, retention countdown, and version stack delete/restore (#418)

* feat(asset): improve Recently Deleted previews and retention indicators

- Include soft-deleted children when building folder previews for the
  Recently Deleted view, and resolve deleted version stacks to their
  latest version so a trashed folder shows what was inside it.
- Add a "days left" badge (clock + Nd) to file and folder cards in the
  Recently Deleted view, placed to the left of the comments badge.
- Fix an issue where deleting or restoring a version stack from the file
  list did nothing because the WebUI dropped version_stack items before
  calling the API.
- Share the 30-day trash retention window through TRASH_RETENTION_DAYS.

* test(asset): use typed MediaInfo in recently-deleted preview tests

Replace the explicit any cast with a fully typed MediaInfo object so the new tests comply with the no-explicit-any policy.
This commit is contained in:
Yiling-J
2026-09-19 11:36:14 +08:00
committed by GitHub
parent b52b2ce7d8
commit 09b65a1eb6
16 changed files with 695 additions and 25 deletions
+6
View File
@@ -1,6 +1,12 @@
import { z } from 'zod'
import { paginationPageInfoSchema, paginationParamsSchema } from './pagination'
/**
* Number of days a soft-deleted asset is kept before it is permanently purged.
* Shared between the backend retention logic and the WebUI countdown labels.
*/
export const TRASH_RETENTION_DAYS = 30
export const assetInfoPaginatedListSchema = z.object({
data: z.array(z.lazy(() => assetInfoSchema)),
pageInfo: paginationPageInfoSchema,