Repository navigation
Migrate to nextcloud-viewer v2 - #2854
Merged
Merged
Conversation
mejo-
force-pushed
the
migrate/viewer_v2
branch
2 times, most recently
from
October 14, 2026 13:14
bacbfb9 to
62930d3
Compare
skjnldsv
approved these changes
Oct 14, 2026
Comment on lines
+59
to
+70
| export function versionNode(version: VersionInfo): File { | ||
| const isVersion = version.filename?.startsWith('/versions/') | ||
| return fileNode({ | ||
| id: version.fileId, | ||
| source: version.source, | ||
| mime: version.mime, | ||
| root: isVersion ? `/versions/${getCurrentUser()?.uid}` : getRootPath(), | ||
| size: version.size, | ||
| mtime: new Date(version.mtime), | ||
| etag: version.etag, | ||
| }) | ||
| } |
Member
There was a problem hiding this comment.
Looks like someone would benefit from nextcloud/server#65395
max-nextcloud
approved these changes
Oct 14, 2026
max-nextcloud
left a comment
Collaborator
There was a problem hiding this comment.
Looks good. Some tests still failing though it seems.
Collaborator
There was a problem hiding this comment.
A lot of this seems useful for humans as well. I wonder if we could have all the generic useful stuff in our development docs and then point there from AGENTS.md to avoid duplication.
(As a follow up / separate from this PR)
mejo-
force-pushed
the
migrate/viewer_v2
branch
2 times, most recently
from
October 14, 2026 16:12
236161d to
7de80b0
Compare
Signed-off-by: Jonas <jonas@freesources.org>
Fixes: #2766 Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
Also disable sidebar in templates view as we don't have a useful sidebar there. The files sidebar is not available in Collectives. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
Nowadays Text doesn't open the link pill on click but only on hover. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
On public shares, the viewer node was built from the share download link, which is a relative URL. `@nextcloud/files` rejects that, so clicking an attachment fell through to the download link instead of opening the viewer. Build the attachment's WebDAV URL from the page's WebDAV URL instead. Attachments are stored next to the page file, and the page URL already points into the user's files or into the share. This also covers page shares, where the share root is the page folder and not the collective root. Add a Playwright test for collective and page shares, and a `createShare()` helper for page shares to the `CollectivePage` fixture. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
While the new @nextcloud/viewer v2 also works on older Nextcloud releases, no handlers are registered there by other apps, so we still need to use the older OCA.Viewer way there. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
mejo-
force-pushed
the
migrate/viewer_v2
branch
from
October 14, 2026 16:26
7de80b0 to
5b8769b
Compare
Member
Author
|
The failing Playwright test is unrelated (whiteboard app not migrated to viewer v2 yet). |
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.
📝 Summary
Migrates Collectives from the Viewer app's global
OCA.ViewerAPI to the bundled@nextcloud/viewerv2 library, while keeping the old Viewer app working on Nextcloud 33–35.Viewer migration
getViewer().open(),canView(),canCompare(),getViewer().compare()).registerDefaultHandlers()registers image/audio/video handlers on Nextcloud < 36, where the server doesn't provide them yet.Compatibility with Nextcloud 33–35
LoadVieweragain where the Viewer app exists, and falls back toOCA.Viewerfor files the library can't open (PDF/Markdown attachments, templates) and for version comparison.Fixes
Tests and CI
masterruns against Textmain. Tests adjusted to current Text: session route with file type (Nextcloud 35+), link bubble on hover (click on Nextcloud 33), comparison tab markup, image locator.@nextcloud/dialogs7.5 uses hashed CSS classes.🏁 Checklist
npm run lint/npm run stylelint/composer run cs:check)🤖 AI (if applicable)