feat: Add timeline support for folder media (#2197)

- Closes #2106
This commit is contained in:
Dermot Duffy
2025-10-04 15:47:39 -07:00
committed by GitHub
parent 262e5f223f
commit 78dee9194f
34 changed files with 2261 additions and 1363 deletions
@@ -1,9 +0,0 @@
import { z } from 'zod';
import { advancedCameraCardCustomActionsBaseSchema } from './base';
export const foldersViewActionConfigSchema =
advancedCameraCardCustomActionsBaseSchema.extend({
advanced_camera_card_action: z.literal('folders').or(z.literal('folder')),
folder: z.string().optional(),
});
export type FoldersViewActionConfig = z.infer<typeof foldersViewActionConfigSchema>;
+3 -17
View File
@@ -1,23 +1,9 @@
import { z } from 'zod';
import {
AdvancedCameraCardUserSpecifiedView,
VIEWS_USER_SPECIFIED,
} from '../../common/const';
import { VIEWS_USER_SPECIFIED } from '../../common/const';
import { advancedCameraCardCustomActionsBaseSchema } from './base';
type AdvancedCameraCardUserSpecifiedViewWithoutFolder = Exclude<
AdvancedCameraCardUserSpecifiedView,
'folder' | 'folders'
>;
export const viewActionConfigSchema = advancedCameraCardCustomActionsBaseSchema.extend({
advanced_camera_card_action: z.enum(
// The folder/folders views are handled separately as they accept an
// optional folder ID.
VIEWS_USER_SPECIFIED.filter((view) => view !== 'folder' && view !== 'folders') as [
AdvancedCameraCardUserSpecifiedViewWithoutFolder,
...AdvancedCameraCardUserSpecifiedViewWithoutFolder[],
],
),
advanced_camera_card_action: z.enum(VIEWS_USER_SPECIFIED),
folder: z.string().optional(),
});
export type ViewActionConfig = z.infer<typeof viewActionConfigSchema>;