[4.0] feat(presentation): insert pages into an existing presentation (from core and plugins) - #277
Merged
TiagoJacobs merged 4 commits intoAug 6, 2026
Conversation
|
Thank you for this contribution! Could you please confirm if you already sent in the signed Contributor License Agreement? See https://docs.bigbluebutton.org/support/faq.html#why-do-i-need-to-sign-a-contributor-license-agreement-to-contribute-source-code Thanks in advance! |
imdt-claudiop
marked this pull request as draft
July 7, 2026 03:34
Add a plugin server-command that inserts pages into the current presentation at a 1-based position. A null content inserts a single blank page; out-of-range positions are clamped server-side. - enum: PRESENTATION_INSERT_PAGES_COMMAND - types: InsertPagesCommandArguments, insertPages on ServerCommandsPresentationObject - commands: insertPages(position, content?, mimeType?, filename?) dispatcher
Move the defaulted `content` parameter to the end of the `insertPages` signature so optional params (`mimeType`, `filename`) come first, and break the params across lines to satisfy function-paren-newline. Update the JSDoc and the ServerCommandsPresentationObject type to match.
The previous ordering pushed content behind mimeType and filename to avoid
the default-param-last lint rule, which forced insertPages(2, undefined,
undefined, { file }) for the primary use case. The rule only flags
default-value parameters, so declaring content as an optional parameter with
no default keeps the positional (position, content) contract and still lints
clean. The dispatched detail now normalizes an omitted content to null, which
core reads as a blank page.
imdt-claudiop
force-pushed
the
feature/insert-pages-server-command
branch
from
August 6, 2026 17:07
0a05200 to
4e112d3
Compare
Add the insertPages entry to the server commands namespace list, with an example usage that inserts the pages of a PDF file at a given position. Also deduplicate the presentation block: it was listed twice, verbatim, as a leftover of the v0.0.x into v0.1.x merges, and both copies were indented as children of the caption namespace instead of being a sibling of it.
This was referenced Aug 6, 2026
TiagoJacobs
marked this pull request as ready for review
August 6, 2026 17:58
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.
feat(server-commands): add presentation.insertPages command
What this adds (and why)
This adds a new server-command to the plugin SDK:
serverCommands.presentation.insertPages(position, content). It allows a plugin to insert pages taken from a source file into an existing in-meeting presentation at a given 1-based position. Pages already in the target are shifted right; omittingcontent(or passingnull) inserts a blank slide.This is the SDK half of a feature whose backend + html5 glue lands in the paired BBB monorepo PR (bigbluebutton/bigbluebutton#25380). The SDK envelope is shipped separately because it is a distinct repository and follows its own release cadence; the BBB PR references this branch by codeload until a versioned release of the SDK is published.
API
contentis the sameUploadPresentationContentunion used by the siblinguploadcommand, so the source can be provided as{ file },{ blob },{ base64 }or{ dataUrl }.The signature is positional (unlike
upload(args)), matching the contract originally specified. Internally it is wrapped in anInsertPagesCommandArgumentspayload and dispatched via the samewindow.dispatchEvent(new CustomEvent(...))pattern as the siblinguploadcommand.Changes
src/server-commands/presentation/enum.ts: addsINSERT_PAGES = 'PRESENTATION_INSERT_PAGES_COMMAND'.src/server-commands/presentation/types.ts: addsInsertPagesCommandArguments(withposition,content: UploadPresentationContent | null,mimeType?,filename?); addsinsertPages(position: number, content?: UploadPresentationContent | null, mimeType?: string, filename?: string): voidtoServerCommandsPresentationObject.src/server-commands/presentation/commands.ts: implementsinsertPages(position: number, content?: UploadPresentationContent | null, mimeType?: string, filename?: string): void; an omitted or nullcontentis dispatched asnulland produces a blank-slide request server-side.src/server-commands/index.ts: re-exports the new types.Validation
Validated end-to-end in a running from-source BBB 4.0 server (paired with the backend PR above): a minimal test plugin calls
serverCommands.presentation.insertPages(2, { file: pdf })against a base 3-page presentation; the inserted pages appear at positions 2-3, the originals shift to 4-5 (verified by DOM, GraphQLpres_pageordering, and recordingevents.xmlintegrity). See the paired BBB PR for the MP4 + screenshots.Out of scope
The external XML API (
insertDocument) is intentionally not extended; this command is exposed only via the in-meeting plugin path.