Skip to content

✨(frontend) Start the presenter from a block - #2485

Open
PanchoutNathan wants to merge 2 commits into
mainfrom
feature/present-mode-start-from-block
Open

✨(frontend) Start the presenter from a block#2485
PanchoutNathan wants to merge 2 commits into
mainfrom
feature/present-mode-start-from-block

Conversation

@PanchoutNathan

Copy link
Copy Markdown
Contributor

Purpose

  • Add a "Present" action to the editor block side menu.
  • Open the presenter on the slide containing the selected block.
  • Map nested blocks and divider blocks to their rendered content slide.
  • Exclude the keyboard shortcut, which is tracked separately in Add keybord shortcut to jump in presentation mode #2473.

Refs #2466
Closes #2470

@PanchoutNathan PanchoutNathan self-assigned this Jul 1, 2026
@PanchoutNathan
PanchoutNathan marked this pull request as draft July 1, 2026 12:31
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Size Change: +446 B (+0.01%)

Total Size: 4.36 MB

📦 View Changed
Filename Size Change
apps/impress/out/_next/static/5e8bb81f/_buildManifest.js 678 B +678 B (new file) 🆕
apps/impress/out/_next/static/2075ca68/_buildManifest.js 0 B -677 B (removed) 🏆
apps/impress/out/_next/static/chunks/3347.js 4 kB +4 kB (new file) 🆕
apps/impress/out/_next/static/chunks/3626.js 0 B -4.55 kB (removed) 🏆
apps/impress/out/_next/static/chunks/5149.js 0 B -23.1 kB (removed) 🏆
apps/impress/out/_next/static/chunks/6528.js 24.1 kB +24.1 kB (new file) 🆕

compressed-size-action

Add a "Present" item to the block side menu that opens the presenter on
the slide containing that block. Map any block id (incl. nested or
divider ids) to its rendered content slide.

Closes #2470
Exercise block-to-slide mapping and the editor side-menu action.

Keep coverage scoped to starting the presenter from a block.
@PanchoutNathan
PanchoutNathan force-pushed the feature/present-mode-start-from-block branch from 0a311b8 to f1a8ad9 Compare July 22, 2026 10:09
@PanchoutNathan
PanchoutNathan requested review from AntoLC and Ovgodd July 22, 2026 10:17
@AntoLC AntoLC added frontend feature add a new feature editor labels Jul 23, 2026
@AntoLC
AntoLC marked this pull request as ready for review July 27, 2026 12:24
Comment on lines +23 to +58
const PresentBlockItem = () => {
const { t } = useTranslation();
const Components = useComponentsContext();
const editor: DocsBlockNoteEditor = useBlockNoteEditor();
const block = useExtensionState(SideMenuExtension, {
editor,
selector: (state) => state?.block,
});
const openPresenter = usePresenterStore((state) => state.open);
const { isMobile } = useResponsiveStore();

// Hidden on mobile (no presenter there) and until a block is targeted
// (no drag handle hovered yet).
if (Components === undefined || block === undefined || isMobile) {
return null;
}

return (
<Components.Generic.Menu.Item
className="bn-menu-item"
onClick={() => {
const contentSlideIndex = getContentSlideIndexForBlock(
editor.document as PresenterBlock[],
block.id,
);

// Overlay slide 0 is the generated title slide; content slides start
// at index 1, hence the +1 on the 0-based content-slide index.
openPresenter(contentSlideIndex + 1);
}}
>
{t('Present')}
</Components.Generic.Menu.Item>
);
};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This part should come from the doc-presenter feature.

openPresenter(contentSlideIndex + 1);
}}
>
{t('Present')}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why not "Present from here" like on the mockup ?
#2470
image

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Start presentation from a block

2 participants