Repository navigation
feat: open whiteboards in the viewer of Nextcloud 36 - #1374
Merged
Merged
Conversation
skjnldsv
requested review from
grnd-alt,
hweihwang and
juliusknorr
as code owners
October 7, 2026 08:05
skjnldsv
force-pushed
the
feature/migrate-new-viewer-api
branch
from
October 7, 2026 08:56
cd789cf to
9addf41
Compare
5 of 6 tasks
skjnldsv
force-pushed
the
feature/migrate-new-viewer-api
branch
from
October 7, 2026 15:58
9addf41 to
492863e
Compare
1 task done
hweihwang
requested changes
Oct 13, 2026
hweihwang
left a comment
Contributor
There was a problem hiding this comment.
Thanks John, nice work! A few things before this can go in:
- Server master moved to
@nextcloud/viewerbeta.18 on Oct 12, wherecanComparehas to be a function, so Compare disappears for whiteboards right now. - The
whiteboard-viewerinit script runs on every page and pulls in React (~312 KiB), and Text's editor now loads on every page too. Could both load only where a board can open? WhiteboardViewerElement.tsdetects embedded and comparison mode from the viewer's class names, while beta.18 already passescomparisonas a prop.
#1385 fixes the IUserFolder mocks and skips the embed test on master, so CI here can go green once that is in.
Member
Author
|
Hey! I've made this PR as a nice starting point, but ultimately, devs should take over as I can't realistically migrate all repositories to my new viewer library 😉 |
mejo-
added a commit
to nextcloud/collectives
that referenced
this pull request
Oct 19, 2026
Requires nextcloud/whiteboard#1374 to succeed with latest Text. Signed-off-by: Jonas <jonas@freesources.org>
The viewer is part of the server from 36: the setup installed the app anyway and then failed reading its checkout, so no end-to-end test ran against master. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
The viewer moved into the server as @nextcloud/viewer, which takes handlers as custom elements and no longer dispatches LoadViewer or offers OCA.Viewer.registerHandler. On 36 and up, a small init script now registers a <whiteboard-viewer> element on every page, defined the first time a board opens. It renders the board as before: read-only outside the viewer (the preview of a link to the file) and side by side with another version, and an older version from its own source. Servers up to 35 keep the viewer app's LoadViewer path. The main script skips its legacy registration on 36, where it still runs as the board shares chunks with it. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
On Nextcloud 36, IRootFolder::getUserFolder() returns IUserFolder, so the Folder mocks fail with IncompatibleReturnValueException. Mock IUserFolder when it exists. Skip the embed e2e test on master: the Files smart picker and the file reference widget do not work with the Nextcloud 36 viewer yet. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
hweihwang
force-pushed
the
feature/migrate-new-viewer-api
branch
from
October 19, 2026 14:32
492863e to
d2d8e03
Compare
…ct out of its init script @nextcloud/viewer 2.0.0-beta.18 rejects a handler whose canCompare is not a function, so it is one now. The comparison mode comes from the comparison property the viewer sets, instead of the CSS classes around the element. When comparing, both boards read their own source: the current file is compared with a version and is read-only there too, instead of failing without a source. On Nextcloud 36 only the viewer modal renders the element, so it is not embedded for now. The CommonJS helper gets its own chunk. In vendor, it made the viewer init script, which runs on every page, load React: its static imports go from 311.9 KiB to 175.6 KiB. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
hweihwang
force-pushed
the
feature/migrate-new-viewer-api
branch
from
October 19, 2026 14:44
d2d8e03 to
3615c25
Compare
3 tasks done
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.
In Nextcloud 36 the viewer is part of the server as
@nextcloud/viewer. It takes handlers as custom elements, and nothing dispatchesLoadVieweror offersOCA.Viewer.registerHandlerany more, so whiteboards no longer open in the viewer on master. The end-to-end setup also failed on master, because it read the viewer app's checkout, so no Playwright test ran against master.On 36, an init script registers a
<whiteboard-viewer>element on every page. The element renders the board and is defined the first time a board opens. Servers up to 35 keep the viewer app path.@nextcloud/viewer2.0.0-beta.18, which needscanCompareto be a function.comparisonproperty. When comparing, both boards read their own source, so the current file shows read-only next to the older version.embed.spec.tsis skipped on master until then.IUserFolderon 36 (from test: prepare unit and e2e tests for Nextcloud 36 #1385, which this replaces).Tested with unit tests for both listeners, a build test that the viewer init script loads no React, and a Playwright test on master that compares a version with the current file. Manually on a Nextcloud 36 instance: opening a board from Files, comparing the initial version with the current one in the Versions tab (both boards render read-only), and a public link while logged out. Escape inside the board closes the viewer because of a
@nextcloud/vuehotkey bug.