Skip to content

fix: editing presenter notes on frontmatter-only slides#2591

Merged
antfu merged 1 commit into
slidevjs:mainfrom
quinnypig:codex/fix-side-editor-frontmatter-notes
May 19, 2026
Merged

fix: editing presenter notes on frontmatter-only slides#2591
antfu merged 1 commit into
slidevjs:mainfrom
quinnypig:codex/fix-side-editor-frontmatter-notes

Conversation

@quinnypig
Copy link
Copy Markdown
Contributor

@quinnypig quinnypig commented May 8, 2026

Summary

Fix presenter/browser note editing for slides whose editor content is only a frontmatter block, such as image-layout slides with no Markdown body.

Root Cause

The side editor trims the editor content before splitting out slide frontmatter. For a frontmatter-only slide, trimming removes the newline after the closing ---, so the previous regex did not recognize the frontmatter block. The save path then sent that frontmatter back as slide body content, which could be parsed as a new slide on reload/HMR. With autosave enabled, this could create repeated image slides containing partial note edits.

This also updates the dev server note patch guard so an empty string note can be saved, allowing notes to be cleared from the editor.

Changes

  • Extract side-editor content parsing into a small helper.
  • Accept either a newline or EOF after the closing frontmatter marker.
  • Add regression coverage for frontmatter-only slide content.
  • Treat note: '' as an intentional note update on the dev server.

Validation

  • pnpm exec eslint packages/client/internals/SideEditor.vue packages/client/logic/sideEditor.ts packages/slidev/node/vite/loaders.ts test/side-editor.test.ts
  • pnpm exec vitest run test/side-editor.test.ts
  • pnpm run build
  • pnpm test

I also manually reproduced this with a personally-themed deck containing consecutive layout: image slides, then verified the patched editor no longer creates additional slides while editing presenter notes.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 8, 2026

Deploy Preview for slidev ready!

Name Link
🔨 Latest commit b170d63
🔍 Latest deploy log https://app.netlify.com/projects/slidev/deploys/69fe467c1b368c000872baf6
😎 Deploy Preview https://deploy-preview-2591--slidev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 8, 2026

Open in StackBlitz

@slidev/client

npm i https://pkg.pr.new/@slidev/client@2591

create-slidev

npm i https://pkg.pr.new/create-slidev@2591

create-slidev-theme

npm i https://pkg.pr.new/create-slidev-theme@2591

@slidev/parser

npm i https://pkg.pr.new/@slidev/parser@2591

@slidev/cli

npm i https://pkg.pr.new/@slidev/cli@2591

@slidev/types

npm i https://pkg.pr.new/@slidev/types@2591

commit: b170d63

@quinnypig quinnypig marked this pull request as ready for review May 8, 2026 20:37
@quinnypig quinnypig changed the title [codex] fix presenter notes on frontmatter-only slides fix presenter notes on frontmatter-only slides May 9, 2026
@quinnypig quinnypig changed the title fix presenter notes on frontmatter-only slides fix: editing presenter notes on frontmatter-only slides May 9, 2026
@antfu antfu merged commit 39f523b into slidevjs:main May 19, 2026
20 checks passed
@quinnypig quinnypig deleted the codex/fix-side-editor-frontmatter-notes branch May 19, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants