From bbda8d33570cbf3b2e417254677568ed9605ba63 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 17 Oct 2025 09:28:44 +0300 Subject: [PATCH] feat(collection/presentation): support custom background color per slide --- .../client/src/widgets/collections/presentation/index.tsx | 8 +++++++- apps/client/src/widgets/collections/presentation/model.ts | 4 +++- packages/commons/src/lib/attribute_names.ts | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/client/src/widgets/collections/presentation/index.tsx b/apps/client/src/widgets/collections/presentation/index.tsx index 1d9896d35..d9fabff10 100644 --- a/apps/client/src/widgets/collections/presentation/index.tsx +++ b/apps/client/src/widgets/collections/presentation/index.tsx @@ -174,7 +174,13 @@ function Presentation({ presentation, setApi } : { presentation: PresentationMod } function Slide({ slide }: { slide: PresentationSlideBaseModel }) { - return
; + return ( +
+ ); } function getNoteIdFromSlide(slide: HTMLElement | undefined) { diff --git a/apps/client/src/widgets/collections/presentation/model.ts b/apps/client/src/widgets/collections/presentation/model.ts index 346adc505..b0b4aa12c 100644 --- a/apps/client/src/widgets/collections/presentation/model.ts +++ b/apps/client/src/widgets/collections/presentation/model.ts @@ -12,6 +12,7 @@ interface PresentationSlideModel extends PresentationSlideBaseModel { export interface PresentationSlideBaseModel { noteId: string; content: DangerouslySetInnerHTML; + backgroundColor?: string; } export interface PresentationModel { @@ -40,7 +41,8 @@ async function buildVerticalSlides(parentSlideNote: FNote): Promise { return { noteId: note.noteId, - content: await processContent(note) + content: await processContent(note), + backgroundColor: note.getLabelValue("slide:background") ?? undefined } } diff --git a/packages/commons/src/lib/attribute_names.ts b/packages/commons/src/lib/attribute_names.ts index 314cc8c9c..d55d4e375 100644 --- a/packages/commons/src/lib/attribute_names.ts +++ b/packages/commons/src/lib/attribute_names.ts @@ -40,6 +40,7 @@ type Labels = { maxNestingDepth: number; includeArchived: boolean; "presentation:theme": string; + "slide:background": string; } /**