-
Notifications
You must be signed in to change notification settings - Fork 339
fix(slides): propagate design system CSS vars to all preview surfaces #1145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
30d7067
1816c82
2f84b61
0568897
88952e9
3563552
00bc111
954098b
0c6c578
172deb7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,15 @@ | ||
| import { appBasePath, useT } from "@agent-native/core/client"; | ||
| import type { SharedDeckResponse } from "@shared/api"; | ||
| import { IconAlertCircle } from "@tabler/icons-react"; | ||
| import { useState, useEffect } from "react"; | ||
| import { useMemo, useState, useEffect } from "react"; | ||
| import { useParams } from "react-router"; | ||
|
|
||
| import PresentationView from "@/components/presentation/PresentationView"; | ||
| import type { Slide } from "@/context/DeckContext"; | ||
| import { | ||
| DEFAULT_DESIGN_SYSTEM, | ||
| mergeDesignSystemData, | ||
| } from "@/hooks/use-deck-design-system"; | ||
|
|
||
| interface SharedPresentationProps { | ||
| initialDeck?: SharedDeckResponse | null; | ||
|
|
@@ -21,6 +25,14 @@ export default function SharedPresentation({ | |
| const [deck, setDeck] = useState<SharedDeckResponse | null>(initialDeck); | ||
| const [error, setError] = useState(initialError); | ||
| const [loading, setLoading] = useState(!initialDeck && !initialError); | ||
| const designSystem = useMemo(() => { | ||
| if (!deck?.designSystemSnapshot) return DEFAULT_DESIGN_SYSTEM; | ||
|
Comment on lines
+28
to
+29
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Public /p/:id presentations still initialize without the design-system snapshotThis now renders from Additional Info |
||
| try { | ||
| return mergeDesignSystemData(JSON.parse(deck.designSystemSnapshot)); | ||
| } catch { | ||
| return DEFAULT_DESIGN_SYSTEM; | ||
| } | ||
| }, [deck?.designSystemSnapshot]); | ||
|
|
||
| useEffect(() => { | ||
| if (!token) return; | ||
|
|
@@ -87,6 +99,7 @@ export default function SharedPresentation({ | |
| slides={slides} | ||
| deckId={`__shared__/${token}`} | ||
| aspectRatio={deck.aspectRatio} | ||
| designSystem={designSystem} | ||
| /> | ||
| ); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Version history still drops themes applied through the new O(1) path
selectedVersion.designSystemIdonly exists if the snapshot JSON captured it, butapply-design-systemstill updates onlydecks.designSystemIdwhile version snapshots copysource.dataunchanged. For retroactively themed decks, history previews and restores will still fall back to the default styling.Additional Info