✨(frontend) Start the presenter from a block - #2485
Open
PanchoutNathan wants to merge 2 commits into
Open
Conversation
PanchoutNathan
marked this pull request as draft
July 1, 2026 12:31
Contributor
|
Size Change: +446 B (+0.01%) Total Size: 4.36 MB 📦 View Changed
|
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
force-pushed
the
feature/present-mode-start-from-block
branch
from
July 22, 2026 10:09
0a311b8 to
f1a8ad9
Compare
AntoLC
marked this pull request as ready for review
July 27, 2026 12:24
AntoLC
reviewed
Jul 27, 2026
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> | ||
| ); | ||
| }; | ||
|
|
Collaborator
There was a problem hiding this comment.
This part should come from the doc-presenter feature.
| openPresenter(contentSlideIndex + 1); | ||
| }} | ||
| > | ||
| {t('Present')} |
Collaborator
There was a problem hiding this comment.
Why not "Present from here" like on the mockup ?
#2470

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Refs #2466
Closes #2470