feat(viewer): vendor the Viewer app in-tree - #63954
Draft
skjnldsv wants to merge 6 commits into
Draft
Conversation
skjnldsv
force-pushed
the
feat/merge-viewer
branch
from
September 2, 2026 12:26
92e753a to
c0f841d
Compare
skjnldsv
force-pushed
the
feat/merge-viewer
branch
from
September 2, 2026 12:41
c0f841d to
8018718
Compare
Import the rewritten Vue 3 Viewer app (nextcloud/viewer feat/6.0.0) into apps/viewer as a bundled app and wire it into the shared frontend build: - add the viewer entry + build/frontend/apps/viewer symlink to the shared vite config, and un-ignore apps/viewer - add the viewer-only runtime deps (@nextcloud/image-editor, @skjnldsv/vue-plyr, dompurify, vue-material-design-icons, camelcase) to the root package.json - vendor the plyr sprite as apps/viewer/img/plyr.svg and import it raw, instead of the standalone build.s PLYR_ICONS global / a blocked plyr deep import - port the Vitest unit and component specs; run the viewer test setup (mock reset, handler registry reset, ResizeObserver stub) from the shared vitest config, and add the shared @nextcloud/event-bus manual mock - cover the viewer l10n / img / composer files in REUSE.toml WIP: Playwright e2e still to port. Signed-off-by: skjnldsv <skjnldsv@protonmail.com> Assisted-by: ClaudeCode:claude-opus-4-8
skjnldsv
force-pushed
the
feat/merge-viewer
branch
from
September 2, 2026 12:50
8018718 to
7a2fb77
Compare
Port the 19 Viewer end-to-end specs (navigation, media handlers, actions, history, sharing, a11y) onto the server's Playwright harness: a ViewerPage section, a viewer-page fixture composing the files/public-share/sharing fixtures, and the bundled media fixtures they exercise. Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Align the vendored Viewer app with the server's stricter checks: - eslint: camelCase bound attributes, import order, attach `cause` to the re-thrown rename error, typed `@throws` - stylelint: explicit .scss import extension, scope the shared Plyr partial - php-cs/rector: format the Files event test stub - register the app in psalm.xml and regenerate its composer autoloader - mark the app as having no OpenAPI spec (.noopenapi) Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
CodeQL flags the `replace('<', '')` as incomplete sanitization. The match
always starts with a single '<', but using the existing capture group is both
clearer and avoids the false positive.
Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
The app is now built and tested by the server, so the tooling it carried as a separate repository is redundant: - remove its composer.json/composer.lock (dev tooling provided at the root), duplicated LICENSES, AUTHORS.md and COPYING - remove tests/, whose psalm baseline is superseded by build/psalm-baseline.xml and whose only stub duplicates a class shipped by the files app - point the bug tracker at the server repository - document the in-tree build and test commands - declare the Vue 3 peer dependency on the API package Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
The server resolves app assets as dist/$app-$name, so requesting 'viewer-init' for the viewer app looked for dist/viewer-viewer-init.mjs. The frontend build emits dist/viewer-init.mjs, so the bundle was never served and the viewer never initialised. The old name was correct while the app built into its own js/ folder as a separate repository; under the shared frontend build the app name is already part of the file name. Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
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.
Closes #60480
Summary
Viewer has been a force-enabled, always-installed app for a long time, so it
belongs directly in the server tree. Vendoring it here drops the separate
release/bundling step and lets its front-end assets be shared with the other
server apps through the unified
dist/build (deduplicated common chunks).This imports the rewritten Vue 3 Viewer (from nextcloud/viewer, the 7.0.0 branch)
as a clean snapshot into
apps/viewer— no upstream git history — and wiresit into the shared frontend build.
What the import contains
apps/viewer/— the app itself (appinfo,lib,src,l10n,img, php),no built assets (they now ship from the shared
/dist).build/frontend/vite.config.ts— aviewer: { init }entry (buildsviewer-init.mjs, matching whatLoadViewerScriptloads) plus thebuild/frontend/apps/viewersymlink.package.json— the viewer-only runtime deps (@nextcloud/image-editor,@skjnldsv/vue-plyr,dompurify,vue-material-design-icons); everything elsewas already present.
PLYR_ICONSis now aplyr/dist/plyr.svg?rawimport instead of the standalonebuild's injected global.
.gitignore—apps/viewerun-ignored.TODO
tests/playwright/e2e/viewershipped.jsonsanity checkChecklist
enhancement,2. developing, feature component)AI (if applicable)
(Claude Code, model
claude-opus-4-8)