Repository navigation
feat(shared-notes): markdown export, init-from-markdown, and import modal - #25373
antobinary merged 14 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis PR adds Markdown-based shared-notes initialization through create-meeting parameters, secure URL fetching, meeting models, gateway messages, and shared-notes server seeding. It adds BlockNote Markdown import and export actions, an import modal with append/replace modes and upload validation, feature flags, localization, Playwright coverage, runtime configuration, and API documentation. Estimated code review effort: 4 (Complex) | ~60 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Client
participant MeetingService
participant BbbWebApiGWApp
participant MeetingActor
participant SharedNotesServer
Client->>MeetingService: create meeting with Markdown parameters
MeetingService->>BbbWebApiGWApp: pass resolved Markdown content
BbbWebApiGWApp->>MeetingActor: publish shared-notes initialization
MeetingActor->>SharedNotesServer: send JSON and Markdown content
SharedNotesServer->>SharedNotesServer: seed JSON or fallback to Markdown
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
bigbluebutton-tests/playwright/sharednotes/blocknote/markdown.ts (1)
1-100: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMissing test coverage for the cancel path.
notesImportMarkdownCancelis added inelements.tsbut never exercised here — only the confirm/replace flow is covered. Consider adding a method (and corresponding spec test) that fills the textarea, clicks cancel on the confirmation warning, and asserts the original content is preserved.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@bigbluebutton-tests/playwright/sharednotes/blocknote/markdown.ts` around lines 1 - 100, Add coverage for the markdown import cancel path in MarkdownSharedNotes: create a new method that opens the import flow, fills notesImportMarkdownTextarea, triggers the confirmation warning, clicks notesImportMarkdownCancel instead of confirming, and verifies the original editor content remains unchanged. Then wire this into a corresponding spec test so the non-destructive cancel behavior is exercised alongside the existing importFromMarkdownReplacesWithConfirmation flow.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java`:
- Around line 450-471: The shared-notes markdown fetch in
requestSharedNotesInitialContentMarkdownFromUrl can block meeting creation
because it uses URL.openStream() with no timeout or response-size limit while
createMeeting() holds the monitor. Update this flow to use SecureUrlDownloader
like the other URL-based parameter loaders, or add explicit connect/read
timeouts and a max payload cap before reading the content. Keep the existing
redirectFollower.followRedirect and logging, but ensure the download path in
MeetingService is bounded and non-blocking.
---
Nitpick comments:
In `@bigbluebutton-tests/playwright/sharednotes/blocknote/markdown.ts`:
- Around line 1-100: Add coverage for the markdown import cancel path in
MarkdownSharedNotes: create a new method that opens the import flow, fills
notesImportMarkdownTextarea, triggers the confirmation warning, clicks
notesImportMarkdownCancel instead of confirming, and verifies the original
editor content remains unchanged. Then wire this into a corresponding spec test
so the non-destructive cancel behavior is exercised alongside the existing
importFromMarkdownReplacesWithConfirmation flow.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 83cee435-3d18-40e0-89d9-b00e3ae01dd8
📒 Files selected for processing (22)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/pads/PadslHdlrHelpers.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scalabbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scalabbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PadsMsgs.scalabbb-common-web/src/main/java/org/bigbluebutton/api/ApiParams.javabbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.javabbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.javabbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.javabbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.javabbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scalabbb-shared-notes-server/src/redis/handler.tsbbb-shared-notes-server/src/redis/service/pushInitialContent.tsbigbluebutton-html5/imports/ui/components/bn-shared-notes/component.tsxbigbluebutton-html5/imports/ui/components/bn-shared-notes/import-context.tsxbigbluebutton-html5/imports/ui/components/bn-shared-notes/markdown-import-modal/component.tsxbigbluebutton-html5/imports/ui/components/bn-shared-notes/markdown-import-modal/styles.tsbigbluebutton-html5/imports/ui/components/notes/component.tsxbigbluebutton-html5/imports/ui/components/notes/notes-dropdown/component.tsxbigbluebutton-html5/public/locales/en.jsonbigbluebutton-tests/playwright/core/elements.tsbigbluebutton-tests/playwright/sharednotes/blocknote/markdown.spec.tsbigbluebutton-tests/playwright/sharednotes/blocknote/markdown.ts
…odal Add three Markdown capabilities to BlockNote shared notes: - Export as Markdown: new kebab item mirroring Export as PDF, hitting the existing /export/md document endpoint. - Init from Markdown on create: new sharedNotesInitialContentMarkdown and sharedNotesInitialContentMarkdownUrl create params, carried as a raw string through the web/akka pipeline and converted to blocks on the shared-notes server (where BlockNote is available) before seeding the empty document. - Import from Markdown: presenter-only kebab item opens a modal with a textarea that replaces the current notes client-side via editor.replaceBlocks, which propagates to every client through the shared Yjs document. Replacing a non-empty document requires an explicit confirmation.
…port Playwright coverage for the three markdown features, run against a live from-source BlockNote shared-notes environment: - export downloads a .md file whose content matches the editor; - a room created with sharedNotesInitialContentMarkdown renders the seeded heading and list; - the import modal replaces a non-empty document only after confirmation; - an import propagates to a second connected user through the shared document.
0427d9c to
d7f769d
Compare
|
Update based on initial review feedback: Precedence changed: BlockNote JSON now takes precedence; Markdown is the fallback (used when JSON is absent, empty, or fails to convert). Partial writes from a failed JSON seed are cleaned before falling through. Markdown via POST payload: Lint + docs: fixed the Tests: 3 new cases cover the JSON-wins precedence, the invalid-JSON-falls-back-to-Markdown path, and the POST-payload seeding. Existing tests still pass (8/8 green against a from-source 3.0 environment). |
Route both shared-notes initial-content URL fetches (the pre-existing JSON path and the new markdown path) through the same DNS-pinned fetch already used by plugin, presentation and callback URLs: followRedirectSecure plus SecureUrlDownloader. SharedNotesRedirectValidatorService now extends BaseUrlRedirectValidator, so it applies the shared protocol allowlist, blocked/local host rules and address-resolution checks, and the fetch is capped by maxSharedNotesInitialContentUrlPayloadSize. Both paths now go through one small fetchUrlContent helper instead of an ad-hoc URL.openStream() reader. Shared notes was the only caller of the non-secure followRedirect, so it is removed, leaving followRedirectSecure as the single fetch entry point. Docs: add the sharedNotesInitialContentMarkdown and sharedNotesInitialContentMarkdownUrl create params to the API table, and de-indent the CDATA markdown example so it pastes at the left margin. Also drop dead try/catch blocks around plain map lookups introduced with the markdown params in ParamsProcessorUtil.
cddb96f to
c7caec6
Compare
|
Further hardening pass:
Validated end-to-end against a from-source 3.0 environment: build clean, 8/8 Playwright tests green, and the URL validator now rejects link-local/private addresses at validation time (no internal connection attempted) while still fetching legitimate URLs. |
The "Import from Markdown" dialog previously only accepted content pasted into a textarea. This adds a file upload path as the primary way to bring in notes, while keeping the textarea as an optional secondary path so nothing that worked before changes. Layout is stacked and compact: a drag-and-drop zone on top, an "or paste it below" divider, then the existing textarea. Both feed the same markdown state, so the parse/replace pipeline and the non-empty replace confirmation are untouched. The dropzone reuses the same react-dropzone component the presentation uploader relies on. Files are validated by extension (.md/.markdown), capped at 1MB, and read with FileReader. UX states are covered: idle, drag-over, file-loaded chip (name/size/remove), wrong-type and read-error alerts, and an empty-file notice that keeps import disabled. Errors and warnings use role=alert. Adds Playwright coverage for uploading a valid file, rejecting a wrong type, and disabling import for an empty file, alongside the existing paste tests.
Importing Markdown into the shared notes previously popped a second
confirmation ("This will replace the current notes. Continue?") whenever
the document was not empty. That is an extra click and only ever offered
one outcome: overwrite.
Replace it with an explicit Append/Replace radio inside the modal,
defaulting to Append so an import never silently destroys existing notes:
- Append (default): the parsed blocks are inserted after the current
content via editor.insertBlocks.
- Replace: the whole document is overwritten via editor.replaceBlocks
(the previous behaviour), now without a separate confirmation step.
The Import button stays enabled as long as the Markdown is non-empty.
Updates the i18n keys (drops importModal.replaceWarning, adds the
importMode.* strings) and the Playwright coverage: the old
confirmation test becomes separate Append and Replace tests.
The Markdown import modal wrapped react-dropzone@7 through styled-components, which tripped three tsc errors and one eslint error, all type-level (runtime was already correct): - accept expects a single string, not string[]. Added ACCEPTED_EXTENSIONS_ATTR (comma-joined) for the picker hint; the array stays the source of truth for the extension check in loadFile. - data-test is a valid data-* DOM attribute but not in the typed InputHTMLAttributes, so it is passed via an object spread instead of a cast, keeping the hook the Playwright test relies on. - styled(Dropzone) merges the div ReactNode children with dropzone render-prop children into an intersection that excludes functions, so the render callback is passed through React.ReactNode. - Extracted the render callback to a typed const (DropzoneRenderFunction) with the isDragActive destructure moved into the body, clearing the react/no-unused-prop-types false positive on the inline param type.
…mport/export configurable Move "Import from Markdown" to the top of the shared notes options menu so it is the first action presenters see. Add two client settings under public.sharedNotes, both enabled by default: - importMarkdownEnabled: toggles the "Import from Markdown" menu item - exportMarkdownEnabled: toggles the "Export notes as Markdown" menu item When both are disabled the menu keeps only Convert, Export as PDF and Pin.
The settings importMarkdownEnabled and exportMarkdownEnabled were added to settings.yml and read in the notes dropdown component, but the SharedNotes TypeScript interface was not updated, breaking ts-code-compilation. Add both properties to the interface and provide their defaults in the initial values so the required fields are satisfied.
…pload feat(shared-notes): file upload and Append/Replace mode in the Markdown import modal
Add a Playwright case that opens the Markdown import modal, stages some markdown, then cancels: the modal closes and neither the staged markdown nor a mode change reaches the editor, so the existing document is left untouched. Introduces the notesImportMarkdownModal selector so the close can be asserted directly.
|
hello @imdt-claudiop
as this is targeting BBB 3.0, please make these settings default=fase, so we don't surprise the users with a new button in a minor version update |
|
Got it, Tiago. Makes total sense: switching the defaults of |
|
Working on the defaults change ( |
|
On it now: mapping the declaration sites of |
|
Defaults flipped to false in both declaration sites ( |
Per review feedback on PR 25373, importMarkdownEnabled and exportMarkdownEnabled now default to false so a minor-version update of BBB 3.0 does not surface a new shared-notes menu button. The flags are client-only (no server default); the read/guard sites in notes-dropdown are unchanged. Tests that exercise the Markdown menu enable both flags on the client before the notes panel mounts (the menu bakes its items at render time); seed-only scenarios are unaffected.
|
Done - flipped both defaults to false (commit 5afcf65). What changed:
Reviewed the diff independently (only declaration sites touched, helper timing correct, scenario selection exact, override is self-contained and network-free). Deployments that want the Markdown affordances turn the two settings on explicitly. |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (4)
bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java (1)
415-430: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueHardcoded
6000ms timeout — consider making it configurable.The connect/read timeout is hardcoded here (twice), while the payload cap is already injectable via
setMaxSharedNotesInitialContentUrlPayloadSize. Sibling fetch paths (plugin manifests, client-settings override) use configurable timeouts. Since this runs insidesynchronized createMeeting(), an operator may want to tune it. Extracting amaxSharedNotesInitialContentUrlResponseTimeoutfield would keep this consistent with the other URL loaders.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java` around lines 415 - 430, The URL fetch logic in fetchUrlContent hardcodes the 6000 ms timeout in both redirect resolution and download, so make this value configurable like maxSharedNotesInitialContentUrlPayloadSize. Add a dedicated timeout field (for example, maxSharedNotesInitialContentUrlResponseTimeout) with a setter, then use that field in redirectFollower.followRedirectSecure and secureUrlDownloader.downloadToString so MeetingService stays consistent with the other URL loaders.bigbluebutton-html5/imports/ui/components/bn-shared-notes/markdown-import-modal/component.tsx (1)
157-171: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider
Blob#text()overFileReader#readAsText.SonarCloud recommends the modern
Blob#text()API which returns a promise and avoids the callback-basedFileReaderboilerplate. This is optional since the current code works correctly.♻️ Optional refactor using Blob.text()
- const reader = new FileReader(); - reader.onerror = () => { - setError('readFailed'); - clearFile(); - }; - reader.onload = () => { - const text = typeof reader.result === 'string' ? reader.result : ''; - setFileName(file.name); - setFileSize(file.size); - setMarkdown(text); - setError(text.trim().length === 0 ? 'empty' : null); - }; - reader.readAsText(file); + try { + const text = await file.text(); + setFileName(file.name); + setFileSize(file.size); + setMarkdown(text); + setError(text.trim().length === 0 ? 'empty' : null); + } catch { + setError('readFailed'); + clearFile(); + }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@bigbluebutton-html5/imports/ui/components/bn-shared-notes/markdown-import-modal/component.tsx` around lines 157 - 171, The markdown import flow still uses callback-based FileReader#readAsText in the file-loading logic, and this should be refactored to the modern Blob#text() promise API. Update the file handling in the markdown import modal component (the reader setup inside the import path) to await file.text(), then keep the existing state updates for setFileName, setFileSize, setMarkdown, and setError, while preserving the current error handling behavior for read failures and empty files.Source: Linters/SAST tools
bigbluebutton-html5/imports/ui/components/bn-shared-notes/markdown-import-modal/styles.ts (1)
140-145: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
Errorstyled component shadows the globalErrorconstructor.SonarCloud flags this. While this file only exports styled components, the name
Errorcould cause confusion if someone adds error-handling logic here later. Consider renaming toErrorTextorErrorMessage.♻️ Optional rename
-const Error = styled.p` +const ErrorText = styled.p` margin: 0; color: ${colorDanger}; font-size: 0.8125rem; font-weight: 600; `;And update the export:
Error, + Error: ErrorText,🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@bigbluebutton-html5/imports/ui/components/bn-shared-notes/markdown-import-modal/styles.ts` around lines 140 - 145, Rename the styled component currently named Error in the markdown-import-modal styles to avoid shadowing the global Error constructor; update the declaration and any export/use sites in this module to a clearer name like ErrorText or ErrorMessage, using the existing styled component definition as the primary symbol to locate and refactor.Source: Linters/SAST tools
bbb-shared-notes-server/src/redis/service/pushInitialContent.ts (1)
15-15: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider extracting seed helpers to reduce cognitive complexity.
SonarCloud reports cognitive complexity of 17 (threshold 15). Extracting the JSON-seed block (lines 51-67) and the markdown-seed block (lines 69-76) into small helper functions would bring the main function under the threshold while improving readability.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@bbb-shared-notes-server/src/redis/service/pushInitialContent.ts` at line 15, The pushInitialContent function has too much cognitive complexity because the JSON-seed and markdown-seed branches are embedded inline. Extract those two blocks into small helper functions (for example, helpers used by pushInitialContent) and have the main function delegate to them so the control flow is flatter and easier to read while keeping the same behavior.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@bbb-shared-notes-server/src/redis/service/pushInitialContent.ts`:
- Around line 69-76: The markdown fallback in pushInitialContent should mirror
the JSON path’s validation and rollback behavior. In pushInitialContent, check
the result of editor.tryParseMarkdownToBlocks before seeding so empty/null
markdown does not return statusCode: "document_loaded", and wrap
editor.blocksToYXmlFragment in a try/catch that deletes the fragment on failure
just like the JSON branch. Keep the existing logger.info and return flow only
after successful seeding, and preserve the outer error handling for
unknown_error.
In
`@bigbluebutton-html5/imports/ui/components/bn-shared-notes/markdown-import-modal/component.tsx`:
- Around line 184-199: `applyImport` in `component.tsx` needs error handling
around the markdown parse/apply flow because
`editor.tryParseMarkdownToBlocks(markdown)` can reject and currently leaves the
modal open with no feedback. Wrap the logic inside `applyImport` in a try/catch,
set the existing error state used by this modal when parsing or
inserting/replacing blocks fails, and only call `onClose()` on success so users
can retry after a failure.
---
Nitpick comments:
In `@bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java`:
- Around line 415-430: The URL fetch logic in fetchUrlContent hardcodes the 6000
ms timeout in both redirect resolution and download, so make this value
configurable like maxSharedNotesInitialContentUrlPayloadSize. Add a dedicated
timeout field (for example, maxSharedNotesInitialContentUrlResponseTimeout) with
a setter, then use that field in redirectFollower.followRedirectSecure and
secureUrlDownloader.downloadToString so MeetingService stays consistent with the
other URL loaders.
In `@bbb-shared-notes-server/src/redis/service/pushInitialContent.ts`:
- Line 15: The pushInitialContent function has too much cognitive complexity
because the JSON-seed and markdown-seed branches are embedded inline. Extract
those two blocks into small helper functions (for example, helpers used by
pushInitialContent) and have the main function delegate to them so the control
flow is flatter and easier to read while keeping the same behavior.
In
`@bigbluebutton-html5/imports/ui/components/bn-shared-notes/markdown-import-modal/component.tsx`:
- Around line 157-171: The markdown import flow still uses callback-based
FileReader#readAsText in the file-loading logic, and this should be refactored
to the modern Blob#text() promise API. Update the file handling in the markdown
import modal component (the reader setup inside the import path) to await
file.text(), then keep the existing state updates for setFileName, setFileSize,
setMarkdown, and setError, while preserving the current error handling behavior
for read failures and empty files.
In
`@bigbluebutton-html5/imports/ui/components/bn-shared-notes/markdown-import-modal/styles.ts`:
- Around line 140-145: Rename the styled component currently named Error in the
markdown-import-modal styles to avoid shadowing the global Error constructor;
update the declaration and any export/use sites in this module to a clearer name
like ErrorText or ErrorMessage, using the existing styled component definition
as the primary symbol to locate and refactor.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: b01da62b-3bab-4833-b33e-312e12e27601
📒 Files selected for processing (34)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/pads/PadslHdlrHelpers.scalaakka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scalabbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scalabbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PadsMsgs.scalabbb-common-web/src/main/java/org/bigbluebutton/api/ApiParams.javabbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.javabbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.javabbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.javabbb-common-web/src/main/java/org/bigbluebutton/api/service/RedirectFollowerService.javabbb-common-web/src/main/java/org/bigbluebutton/api/service/impl/SharedNotesRedirectValidatorService.javabbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.javabbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scalabbb-shared-notes-server/src/redis/handler.tsbbb-shared-notes-server/src/redis/service/pushInitialContent.tsbigbluebutton-html5/imports/ui/Types/meetingClientSettings.tsbigbluebutton-html5/imports/ui/components/bn-shared-notes/component.tsxbigbluebutton-html5/imports/ui/components/bn-shared-notes/import-context.tsxbigbluebutton-html5/imports/ui/components/bn-shared-notes/markdown-import-modal/component.tsxbigbluebutton-html5/imports/ui/components/bn-shared-notes/markdown-import-modal/styles.tsbigbluebutton-html5/imports/ui/components/notes/component.tsxbigbluebutton-html5/imports/ui/components/notes/notes-dropdown/component.tsxbigbluebutton-html5/imports/ui/core/initial-values/meetingClientSettings.tsbigbluebutton-html5/private/config/settings.ymlbigbluebutton-html5/public/locales/en.jsonbigbluebutton-tests/playwright/core/elements.tsbigbluebutton-tests/playwright/core/helpers.tsbigbluebutton-tests/playwright/sharednotes/blocknote/markdown.spec.tsbigbluebutton-tests/playwright/sharednotes/blocknote/markdown.tsbigbluebutton-tests/playwright/sharednotes/blocknote/util.tsbigbluebutton-web/grails-app/conf/bigbluebutton.propertiesbigbluebutton-web/grails-app/conf/spring/resources.xmlbigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovydocs/docs/data/create.tsxdocs/docs/development/api.md
💤 Files with no reviewable changes (1)
- bbb-common-web/src/main/java/org/bigbluebutton/api/service/RedirectFollowerService.java
✅ Files skipped from review due to trivial changes (2)
- bigbluebutton-web/grails-app/conf/bigbluebutton.properties
- docs/docs/data/create.tsx
🚧 Files skipped from review as they are similar to previous changes (11)
- bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PadsMsgs.scala
- bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scala
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala
- bigbluebutton-html5/imports/ui/components/bn-shared-notes/import-context.tsx
- bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java
- bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala
- bbb-common-web/src/main/java/org/bigbluebutton/api/ApiParams.java
- bbb-shared-notes-server/src/redis/handler.ts
- bigbluebutton-html5/imports/ui/components/bn-shared-notes/component.tsx
- bigbluebutton-html5/imports/ui/components/notes/component.tsx
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/pads/PadslHdlrHelpers.scala
… limits Wrap applyImport in try/catch: a rejected tryParseMarkdownToBlocks (malformed markdown or a parser edge case) now surfaces a visible error and keeps the modal open for retry, instead of leaving the promise to reject silently while the modal freezes. Adds the parseFailed ImportError and its en.json message. Document that the shared-notes initial-content URLs (sharedNotesInitialContentJsonUrl and sharedNotesInitialContentMarkdownUrl) are fetched through the hardened, DNS-pinned path: https only, capped by maxSharedNotesInitialContentUrlPayloadSize (1024 KiB) and a 6000 ms timeout, so an http URL or an oversized/slow endpoint yields empty content silently.
…t path - pushInitialContent: extract seedFromJson/seedFromMarkdown helpers so the function cognitive complexity drops below the threshold (behavior unchanged) - markdown-import-modal: read the uploaded file via Blob#text() instead of FileReader, rename the styled Error component to ErrorText, and drop the redundant object-literal spread on the dropzone input props - notes-dropdown: read meetingClientSettings through globalThis - sharednotes tests: use globalThis instead of window in the eval helper No behavior change: html5 tsc and eslint clean, sharednotes markdown suite 13/13 passing against a from-source rebuild.
seedFromMarkdown had two gaps versus seedFromJson: it did not validate that tryParseMarkdownToBlocks returned usable blocks (an empty result still reported document_loaded), and it had no cleanup for a partially written fragment if blocksToYXmlFragment threw. Mirror the seedFromJson pattern: return null on empty blocks or on a conversion error (rolling back any partial write), and let the caller fall through to no_initial_content instead of a false-positive success.
|
✅ Automated tests have passed! |



What
Adds three Markdown capabilities to BlockNote Shared Notes:
.mdfile. The shared-notes server already served/export/md; this only wires the client menu item.sharedNotesInitialContentMarkdown(raw markdown string) andsharedNotesInitialContentMarkdownUrl(fetched server side), mirroring the existingsharedNotesInitialContentJsonpipeline. The markdown travels as a raw string through bbb-web, akka and redis, and is converted to BlockNote blocks on the shared-notes server (the only tier where BlockNote runs) before seeding an empty document..md/.markdownfile (primary path), andOn submit the client parses the markdown and writes it into the document, which propagates to every connected client through the shared Yjs document. An Append | Replace radio (default Append) controls whether the imported blocks are inserted after the existing content or overwrite it; the previous two-step "this will replace" confirmation alert is replaced by this explicit, non-destructive-by-default selector.
Import from MarkdownandExport notes as Markdownkebab items are gated by two new settings underpublic.sharedNotes:importMarkdownEnabledandexportMarkdownEnabled, both defaulting tofalse. The default is off so a minor-version update of BBB 3.0 does not surface a new shared-notes menu button unless a deployment opts in; set either totrueto enable the corresponding affordance.Import from Markdownis now the first item in the shared-notes kebab menu (aboveConvert notes to presentation), reflecting that import is the most likely entry action.Why
Shared Notes could already round-trip to PDF/HTML/TXT/JSON but had no Markdown in or out. Markdown is the natural interchange format for notes: it lets an integrator pre-seed a room from a template and lets users paste external markdown into a live session. File upload makes the interchange path concrete (drag a
.mdin, or paste), and the Append/Replace choice removes modal-on-modal friction while keeping a safe default.How it was validated
BlockNote 0.51 (
@blocknote/server-utiland@blocknote/core) exposestryParseMarkdownToBlocksandeditor.replaceBlocks, confirmed in the realnode_modulesbefore implementation. Built and deployed from source on a 3.0 environment and covered by new Playwright tests (all green):.mdfile whose content matches the editor.sharedNotesInitialContentMarkdownrenders the seeded heading and list..mdfile populates the modal and imports correctly; wrong-type, too-large, and empty files are rejected with an inline error and do not clear text the user typed.importMarkdownEnabled/exportMarkdownEnabled) is set totrue.Evidence
Each clip below demonstrates one capability against a live from-source BBB 3.0 room (created with
sharedNotesEditor=blockNote). Per-feature timestamps are not needed: each clip is a single short demonstration of that feature end-to-end.Preview animated below - click a GIF to open the higher-quality MP4 (with controls):
Feature 1 - Export as Markdown (editor with content, kebab menu,
.mddownload asserted by the Playwright test):Feature 2a - Init from Markdown (room created with
sharedNotesInitialContentMarkdown; notes open with the seeded heading + list):Feature 2b - Import from Markdown (moderator) (modal submitted; notes replaced with the imported content):
Feature 2b - Import propagates to a second user (attendee sees the same imported content via the shared Yjs document):
Feature 3 - Import modal UX: file upload + Append/Replace (the modal now opens with a dropzone as the primary path, the textarea as an optional secondary path, and an Append | Replace radio defaulting to Append; the clip shows a
.mdfile being uploaded, the file chip, the populated textarea, Import rendering the content in the editor, then a second import in Replace mode overwriting the document):Note: the Append/Replace selector is covered by the Playwright suite (
importFromMarkdownAppend,importFromMarkdownReplace). The file-upload validation states (wrong-type, too-large, empty) are covered byimportFromMarkdownUploadFile,importFromMarkdownUploadWrongType, andimportFromMarkdownUploadEmptyFile.