agent-native icon indicating copy to clipboard operation
agent-native copied to clipboard

fix(slides): propagate design system CSS vars to all preview surfaces

Open Abdul-M01 opened this issue 5 months ago • 9 comments

Summary

Applying a design system to an existing deck was O(n) in tool calls. The agent had to read, rewrite, and update each slide individually. On a modest deck this produced 25+ tool calls. This PR reduces retroactive application to O(1).

Problem

Skill templates contained hardcoded color and font values baked into slide HTML. SlideRenderer already injected CSS custom properties at render time, but the hardcoded values bypassed the cascade, forcing the agent to rewrite each slide's content when a design system was applied or changed.

When a design system was applied retroactively to an existing deck, sidebar thumbnails and browse-card previews continued to render with default tokens — designSystem was never forwarded to EditorSidebar or DeckCard.

Solution

Replace all hardcoded values in skill templates with var(--ds-*) references so new slides are token-aware from creation. Retroactive application becomes a single call — SlideRenderer handles the rest via CSS cascade.

Thread designSystem through to all three render surfaces so the main editor, sidebar thumbnails, and browse cards stay consistent. Fallback mirrors useDeckDesignSystem DEFAULT_DESIGN_SYSTEM behaviour at each call site.

Key Changes

  • create-deck/SKILL.md, slide-editing/SKILL.md — replace hardcoded hex/font values with var(--ds-*) tokens
  • design-systems/SKILL.md — add retroactive application guidance
  • SlideRenderer.tsx — add --ds-heading-weight and --ds-body-weight to CSS var injection block
  • EditorSidebar.tsx, DeckEditor.tsx — thread designSystem prop through to <SlideRenderer>
  • Index.tsx, DeckCard.tsx — build designSystemById map and thread designSystem through to <SlideRenderer>

Known limitation

The current implementation stores share links as self-contained copies — duplicating title, slides, and aspect ratio rather than referencing the live deck. This change follows that pattern by persisting design_system_id into the share link at creation time rather than joining back to decks at read time. Schema changes were required because SharedPresentation loads entirely from deck_share_links, so without the column, there was no design system ID to pass into useDeckDesignSystem.

Share links created before this change have design_system_id = NULL and continue to render with default branding — no regression. New shares of existing decks capture the current designSystemId at creation time. A backfill migration for already-published share links is scoped as a follow-up.

Abdul-M01 avatar Jun 11 '26 00:06 Abdul-M01

Deploy request for agent-native-scheduling pending review.

Visit the deploys page to approve it

Name Link
Latest commit 00bc1115dfb7f78d8fef5649a6f29c5168b68dc2

netlify avatar Jun 11 '26 00:06 netlify

Deploy request for agent-native-brain pending review.

Visit the deploys page to approve it

Name Link
Latest commit 00bc1115dfb7f78d8fef5649a6f29c5168b68dc2

netlify avatar Jun 11 '26 00:06 netlify

Deploy request for agent-native-design pending review.

Visit the deploys page to approve it

Name Link
Latest commit 00bc1115dfb7f78d8fef5649a6f29c5168b68dc2

netlify avatar Jun 11 '26 00:06 netlify

Deploy request for agent-native-voice pending review.

Visit the deploys page to approve it

Name Link
Latest commit 00bc1115dfb7f78d8fef5649a6f29c5168b68dc2

netlify avatar Jun 11 '26 00:06 netlify

Deploy request for agent-native-meeting-notes pending review.

Visit the deploys page to approve it

Name Link
Latest commit 00bc1115dfb7f78d8fef5649a6f29c5168b68dc2

netlify avatar Jun 11 '26 00:06 netlify

Deploy request for agent-native-images pending review.

Visit the deploys page to approve it

Name Link
Latest commit 00bc1115dfb7f78d8fef5649a6f29c5168b68dc2

netlify avatar Jun 11 '26 00:06 netlify

@Abdul-M01 this PR is great - just one piece of feedback above to get it in

steve8708 avatar Jun 23 '26 18:06 steve8708

Visual recap — skipped

The visual recap job did not run for this pull request. This is informational only and does not block the PR.

Recap skipped for 00bc111: external fork PR requires a maintainer to apply the recap label to the current head SHA.

github-actions[bot] avatar Jun 25 '26 01:06 github-actions[bot]

we just merged a big localization PR that created some conflicts, if you can resolve @Abdul-M01 and check if any of the other automated feedback looks worth fixing would love to get this in

steve8708 avatar Jun 25 '26 20:06 steve8708