Skip to content

Add slide config form in sidebar, and reveal slide types#9300

Merged
Light2Dark merged 19 commits into
mainfrom
sham/add-reveal-config
Apr 24, 2026
Merged

Add slide config form in sidebar, and reveal slide types#9300
Light2Dark merged 19 commits into
mainfrom
sham/add-reveal-config

Conversation

@Light2Dark

@Light2Dark Light2Dark commented Apr 21, 2026

Copy link
Copy Markdown
Member

📝 Summary

Screen.Recording.2026-04-22.at.4.47.06.PM.mov

in read mode
image

  • SerializedSlidesLayout now carries optional cells: SlideConfig[] and deck: DeckConfig; both are optional so existing .slides.json files (including bare {}) still deserialize cleanly.

  • SlideConfig supports type: "slide" | "sub-slide" | "fragment" | "skip"

  • DeckConfig supports transition: "none" | "fade" | "slide" | "convex" | "concave" | "zoom".

  • New compose-slides.ts groups the flat cell list into stacks → subslides → blocks, mirroring reveal.js's {h, v, f} indices, with helpers buildSlideIndices and resolveActiveCellIndex.

  • New tabbed SlidesForm (Slide | Deck):

📋 Pre-Review Checklist

  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • Video or media evidence is provided for any visual changes (optional).

✅ Merge Checklist

  • I have read the contributor guidelines.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Tests have been added for the changes made.
@vercel

vercel Bot commented Apr 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Apr 24, 2026 9:14am

Request Review

@Light2Dark Light2Dark added the enhancement New feature or request label Apr 21, 2026
@codecov

codecov Bot commented Apr 21, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 20.28kB (0.08%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
marimo-esm 25.13MB 20.28kB (0.08%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: marimo-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-*.js 39 bytes 605.96kB 0.01%
assets/index-*.css 1.42kB 364.21kB 0.39%
assets/JsonOutput-*.js 2.05kB 345.5kB 0.6%
assets/dist-*.js -13 bytes 164 bytes -7.34%
assets/dist-*.js -76 bytes 259 bytes -22.69%
assets/dist-*.js -14 bytes 169 bytes -7.65%
assets/dist-*.js 59 bytes 335 bytes 21.38% ⚠️
assets/dist-*.js -131 bytes 256 bytes -33.85%
assets/dist-*.js -299 bytes 104 bytes -74.19%
assets/dist-*.js 234 bytes 403 bytes 138.46% ⚠️
assets/dist-*.js 107 bytes 276 bytes 63.31% ⚠️
assets/dist-*.js -35 bytes 102 bytes -25.55%
assets/dist-*.js 13 bytes 177 bytes 7.93% ⚠️
assets/dist-*.js 250 bytes 387 bytes 182.48% ⚠️
assets/dist-*.js 33 bytes 137 bytes 31.73% ⚠️
assets/dist-*.js -14 bytes 169 bytes -7.65%
assets/dist-*.js -56 bytes 104 bytes -35.0%
assets/dist-*.js -73 bytes 183 bytes -28.52%
assets/dist-*.js -76 bytes 183 bytes -29.34%
assets/dist-*.js 72 bytes 176 bytes 69.23% ⚠️
assets/dist-*.js -16 bytes 160 bytes -9.09%
assets/dist-*.js 35 bytes 137 bytes 34.31% ⚠️
assets/edit-*.js 38 bytes 329.64kB 0.01%
assets/ai-*.js 467 bytes 250.67kB 0.19%
assets/layout-*.js 2.31kB 187.91kB 1.24%
assets/reveal-*.js 4.95kB 170.55kB 2.99%
assets/reveal-*.css 346 bytes 54.42kB 0.64%
assets/useNotebookActions-*.js -185 bytes 27.68kB -0.66%
assets/react-*.browser.esm-Bcm5njwd.js (New) 25.64kB 25.64kB 100.0% 🚀
assets/vega-*.browser-DXARUlxo.js (New) 24.8kB 24.8kB 100.0% 🚀
assets/state-*.js 290 bytes 24.73kB 1.19%
assets/form-*.js -4.69kB 21.63kB -17.81%
assets/slide-*.js 8.26kB 8.88kB 1343.74% ⚠️
assets/react-*.esm-BUYTQ32a.js (New) 8.37kB 8.37kB 100.0% 🚀
assets/radio-*.js (New) 4.98kB 4.98kB 100.0% 🚀
assets/ttcn-*.js -7 bytes 57 bytes -10.94%
assets/ttcn-*.js 7 bytes 64 bytes 12.28% ⚠️
assets/emotion-*.esm-DYxi7n2b.js (New) 4.37kB 4.37kB 100.0% 🚀
assets/mermaid-*.core-DP6UBthl.js (New) 2.38kB 2.38kB 100.0% 🚀
assets/__vite-*.js -5 bytes 93 bytes -5.1%
assets/__vite-*.js 5 bytes 98 bytes 5.38% ⚠️
assets/react-*.browser.esm-xQHRvEag.js (Deleted) -25.64kB 0 bytes -100.0% 🗑️
assets/vega-*.browser-BlkwfOz9.js (Deleted) -24.8kB 0 bytes -100.0% 🗑️
assets/react-*.esm-CwO5-6Hf.js (Deleted) -8.37kB 0 bytes -100.0% 🗑️
assets/emotion-*.esm-BvF4JMSP.js (Deleted) -4.37kB 0 bytes -100.0% 🗑️
assets/mermaid-*.core-C7QPzAah.js (Deleted) -2.38kB 0 bytes -100.0% 🗑️

Files in assets/layout-*.js:

  • ./src/components/slides/minimap.tsx → Total Size: 17.31kB

  • ./src/components/editor/renderers/slides-layout/compute-slide-cells.ts → Total Size: 756 bytes

  • ./src/core/layout/layout.ts → Total Size: 1.51kB

  • ./src/components/editor/renderers/slides-layout/slides-layout.tsx → Total Size: 2.0kB

  • ./src/components/editor/renderers/slides-layout/plugin.tsx → Total Size: 1.28kB

Files in assets/reveal-*.js:

  • ./src/components/slides/reveal-component.tsx → Total Size: 9.29kB

  • ./src/components/slides/reveal-slides.css → Total Size: 0 bytes

  • ./src/components/slides/compose-slides.ts → Total Size: 6.89kB

Files in assets/slide-*.js:

  • ./src/components/slides/slide-form.tsx → Total Size: 12.9kB

Files in assets/radio-*.js:

  • ./src/components/ui/radio-group.tsx → Total Size: 2.36kB

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the slides layout to support slide metadata (slide / sub-slide / fragment / skip), adds a slide-type configuration sidebar to the Reveal.js-based slide renderer, and includes a nested-slides smoke test to exercise the new behavior.

Changes:

  • Add slide layout serialization/deserialization (cells[]) and UI to edit slide types per cell.
  • Introduce slide composition logic (stacks/subslides/fragments) for Reveal.js rendering + indexing to sync active cell ↔ Reveal indices.
  • Add a nested-slides smoke test notebook + layout JSON for vertical stacks, fragments, and skipped cells.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
marimo/_smoke_tests/slides_examples/nested_slides.py New smoke test notebook exercising nested slides, fragments, and skip cells
marimo/_smoke_tests/slides_examples/layouts/nested_slides.slides.json Serialized slides layout used by the nested smoke test
frontend/src/components/slides/slide-form.tsx New sidebar form for setting slide type per cell
frontend/src/components/slides/reveal-slides.css Reveal-specific CSS updates for nested sections and fragment block stacking
frontend/src/components/slides/reveal-component.tsx Major refactor: compose stacks/subslides/fragments, add config sidebar, sync active cell with Reveal indices
frontend/src/components/slides/minimap.tsx Minimap updates: dynamic thumbnail sizing + skipped-cell affordances
frontend/src/components/slides/compose-slides.ts New composition + indexing utilities for slides/fragments/subslides
frontend/src/components/slides/tests/compose-slides.test.ts Unit tests for composition and index mapping logic
frontend/src/components/editor/renderers/types.ts Clarify serialize/deserialize layout docs
frontend/src/components/editor/renderers/slides-layout/types.ts Define serialized/in-memory slides layout schema + slide config types
frontend/src/components/editor/renderers/slides-layout/slides-layout.tsx Wire layout + setLayout into slides renderer; track skipped cells; default index selection
frontend/src/components/editor/renderers/slides-layout/plugin.tsx Implement slides layout schema validation + (de)serialization
Comment thread frontend/src/components/slides/minimap.tsx
Comment thread frontend/src/components/editor/renderers/slides-layout/plugin.tsx
Comment thread frontend/src/components/slides/reveal-component.tsx Outdated
Comment thread frontend/src/components/slides/slide-form.tsx
Comment thread frontend/src/components/slides/reveal-component.tsx Outdated
Comment thread frontend/src/components/slides/slide-form.tsx Outdated
Comment thread frontend/src/components/slides/reveal-component.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Comment thread frontend/src/components/editor/renderers/slides-layout/plugin.tsx Outdated
Comment thread frontend/src/components/editor/renderers/slides-layout/types.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Comment thread frontend/src/components/slides/reveal-component.tsx
Comment thread frontend/src/components/editor/renderers/slides-layout/plugin.tsx
Comment thread frontend/src/components/slides/slide-form.tsx

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Comment thread frontend/src/components/slides/slide-form.tsx
Comment thread frontend/src/components/editor/renderers/slides-layout/plugin.tsx
Comment on lines +94 to 102
const cells = notebookCells(notebook);
// Fall back to the plugin's initial layout when the user has not yet
// interacted with this layout — otherwise serializers that expect a
// structured layout object crash on `undefined`.
const data = layoutData[selectedLayout] ?? plugin.getInitialLayout(cells);
return {
type: selectedLayout,
data: plugin.serializeLayout(data, notebookCells(notebook)),
data: plugin.serializeLayout(data, cells),
};

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getSerializedLayout now uses plugin.getInitialLayout(cells) as a fallback, but LayoutState.layoutData is still typed as GridLayout | undefined. This makes layout state/serialization rely on any for non-grid layouts (like slides) and weakens type safety. Consider widening LayoutData to a union of all layout types (e.g. GridLayout | SlidesLayout | undefined) so state and serialization stay type-correct.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can fix this in a follow-up

@Light2Dark Light2Dark requested a review from peter-gy April 23, 2026 17:47
Comment thread frontend/src/components/slides/reveal-component.tsx Outdated
Comment thread frontend/src/components/slides/reveal-component.tsx Outdated
</div>
)}
</aside>
)}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be worth breaking this component up into 3-4 sub components

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved the sidebar to the slide-form file, I can move out more stuff once we introduce Live editing

Comment thread frontend/src/components/editor/renderers/slides-layout/slides-layout.tsx Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 18 files

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.

Comment thread frontend/src/components/editor/renderers/slides-layout/types.ts
Comment thread frontend/src/components/slides/reveal-component.tsx
Comment thread frontend/src/components/slides/reveal-component.tsx
Comment thread frontend/src/components/slides/slide-form.tsx
peter-gy
peter-gy previously approved these changes Apr 24, 2026

@peter-gy peter-gy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all in all this looks good!
I believe the unresolved comments are fine to be addtessed in a follow up.

Comment on lines +187 to +193
// Skip cells aren't part of the composed deck. When one is selected in the
// minimap we render a preview over the deck and park reveal on a neighboring
// real slide; keyboard nav while parked is handled below.
const skippedPreviewCell =
activeCell && layout.cells.get(activeCell.id)?.type === "skip"
? activeCell
: null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this leaks skipped cells in read/presentation mode when the selected or initial cell is skipped. The smoke layout starts with type: "skip", but SlidesLayoutRenderer defaults activeIndex to 0, and RevealSlidesComponent builds skippedPreviewCell regardless of mode. So we end up showing the slide that's supposed to be skipped:

Image

Can we gate the skipped-preview behavior to authoring mode, or initialize read-mode navigation to the first non-skipped deck target?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good catch, thank you!

@kirangadhave kirangadhave left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 looks like you have addressed most of the feedback

@Light2Dark Light2Dark merged commit a845f3c into main Apr 24, 2026
45 checks passed
@Light2Dark Light2Dark deleted the sham/add-reveal-config branch April 24, 2026 17:17
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.3-dev45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bash-focus Area to focus on during release bug bash enhancement New feature or request

5 participants