Skip to content

IONOS(viewer): NC33 fork release — reinstate IONOS delta (HDNEXT-1585) - #45

Open
printminion-co wants to merge 20 commits into
ionos-dev-v33from
mk/dev/HDNEXT-1585-viewer-nc33
Open

IONOS(viewer): NC33 fork release — reinstate IONOS delta (HDNEXT-1585)#45
printminion-co wants to merge 20 commits into
ionos-dev-v33from
mk/dev/HDNEXT-1585-viewer-nc33

Conversation

@printminion-co

@printminion-co printminion-co commented Jul 24, 2026

Copy link
Copy Markdown

Summary

NC33 IONOS viewer line: upstream vanilla v33.0.6 + cherry-picked IONOS delta.

  • Integration branch ionos-dev-v33 = vanilla nextcloud/viewer v33.0.6 (app 6.0.0, NC 33).
  • This PR reinstates the IONOS viewer customizations on top of that vanilla base: default viewer / always_show_viewer, remove Collabora (office/pdf) documents from preview, folder/mimetype/preview fixes, and Default-component styling.
  • The IONOS delta was sourced from the fork default branch ionos-dev (previously last maintained on ionos-dev-v31.0.6).
  • appinfo/info.xml already declares max-version="33" — no bump needed.
  • Assets (js/, css/) rebuilt with vite (node 24) and committed, as this fork ships built assets.
  • Code-style fixes required by CI (single-quote in provideInitialState, semicolon-free preview filter) are folded into the commits that introduced them (781cfbf / f271af9) — no follow-up fixup commits.

Commit hashes below are written unformatted so GitHub auto-links them to the real commits (source commits on ionos-dev).

Reconciliation against v33.0.6

Kept (22 commits, reconciled to the v33 defineComponent Viewer.vue + viewerAction.ts structure):

Group Source commits Notes
Default viewer / always_show_viewer 781cfbf 939299c de2ba4d 4cfcad5 c997a3d 41daec7 1eeec05 8c29248 04aa53e LoadViewerScript.php constructor reconciled (trailing-comma + viewer-init); config/default models are new files
Modal title a2072f4 e7ac87e dropped the v31-only :view prop that v33 removed
Folder/list filtering + nav 4534420 d845ff2 d403b49 reconciled into v33's restructured openFileInfo
Enabled-logic (viewer action) 83f3557 (folds c997a3d alwaysShowViewer + 4db419b folder-exclusion) re-homed from Viewer.vue into src/files_actions/viewerAction.ts::registerViewerAction(), which is where v33 keeps the file-action enabled callback
Remove Collabora from preview f271af9 excludes x-office* + application/pdf from the always-show file list
Images fallback 04a1740 reconciled to v33's fallback state (was previewFailed); adds originalFailed → Default component
Video load fix cc760f4 livePhotoUtils .toString() guard
Styling / cosmetics 7834768 ff8f900 43284c4 d2d33ad Default.vue text/width/title-color + semicolon cleanup

Dropped (with reasons):

Source commit Reason
c29e117 react 19→18 downgrade obsolete — v33 base already pins react ^18.3.1
8b89880 use custom-npms for icons we do not use custom-npms; v33 registry deps kept
992158f + b7f3c87 a commit and its revert (net zero)
deea136 number-folder fix upstreamed — v33 fileUtils.ts already has the .toString()?.localeCompare + isNumber() handling
07ac1d3 package-lock fix superseded by fresh npm install against v33 deps
b86aa2a "Resolve conflicts of update to v30.0.5" old-rebase merge artifact
7ed9d57 shares-menu view action patched the legacy OCA.Files.fileActions.registerAction block that v33 removed; the new registerFileAction already sets the eye icon
ef19310 49707fe cab07a7 cosmetic against restructured files (semicolon/whitespace/lint); the needed semicolon cleanup is folded into f271af9

CI note

static-psalm-analysis fails on a pre-existing base issue, not this delta: the psalm job pulls nextcloud/ocp dev-master, which now requires PHP ~8.3, while composer.json config.platform.php is 8.2 (unchanged from vanilla v33.0.6git diff ionos-dev-v33..HEAD -- composer.json is empty). Fixing it would mean diverging the vanilla base's platform pin; tracked separately.

Consumed by IONOS-Productivity/nc-server#279 via a submodule bump after merge + tag.

Linked PRs

Jira: HDNEXT-1585

@printminion-co
printminion-co force-pushed the mk/dev/HDNEXT-1585-viewer-nc33 branch from cb416c0 to 8158194 Compare July 24, 2026 12:16
printminion-co and others added 20 commits July 24, 2026 14:28
enable via:
./occ config:app:set --value yes --type string viewer always_show_viewer

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
(cherry picked from commit 781cfbf)
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
(cherry picked from commit 939299c)
in order later to use it as default viewer

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
(cherry picked from commit de2ba4d)
in order later to display it for all not known mime types

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
(cherry picked from commit 4cfcad5)
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
(cherry picked from commit c997a3d)
in order to reuse it later

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
(cherry picked from commit 41daec7)
Signed-off-by: Franziska Bath <franziska.bath@strato.de>
(cherry picked from commit 1eeec05)
in order to be able to influence it later

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
(cherry picked from commit a2072f4)
…hown

Signed-off-by: Franziska Bath <franziska.bath@strato.de>
(cherry picked from commit e7ac87e)
Don't include directories as they can not be displayed.

Note: including directories could also cause a follow-up error with
certain directory structures which happen to include a directory
named like a number (i.e. 123) because of sloppy, too broad type
casting in fileUtils.ts's genFileInfo() accidentally converting
such a folder name to a Number, which then can not be used in string
comparisons.

Signed-off-by: Thomas Lehmann <t.lehmann@strato.de>
(cherry picked from commit 4534420)
== The error

The text below the mimetype icon has Nextcloud's default text styling,
which is dark text on light background, yet here it's dark background.

== The fix

The default component now defines a text color.

Signed-off-by: Thomas Lehmann <t.lehmann@strato.de>
(cherry picked from commit 7834768)
== The cause

Previously the code attempted to load a preview of an image.

If loading this preview image failed it was attempted to load the
original image.

Load errors of images were only handled _once_. This meant that a
load error for the original image was never handled, thus the
viewer was still in loading state and showed a browser-dependant
"broken image" replacement icon.

== The fix

Now further image load errors are handled too. In case the original
fails too, the loading state is ended and a placeholder text is shown.

The default preview component, which was introduced to show something
for any mimetype if configured, is now also used as a fallback.

Signed-off-by: Thomas Lehmann <t.lehmann@strato.de>
(cherry picked from commit 04a1740)
For Safari 16.5/167.3 this fixes different icon sizes for the same mime type, visible when cycling through files with different file names.

Signed-off-by: Franziska Bath <franziska.bath@strato.de>
(cherry picked from commit ff8f900)
Signed-off-by: Franziska Bath <franziska.bath@strato.de>
(cherry picked from commit cc760f4)
Signed-off-by: Franziska Bath <franziska.bath@strato.de>
(cherry picked from commit d845ff2)
Signed-off-by: Franziska Bath <franziska.bath@strato.de>
(cherry picked from commit f271af9)
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
(cherry picked from commit 83f3557)
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
(cherry picked from commit 43284c4)
…efault component

Signed-off-by: Franziska Bath <franziska.bath@strato.de>
(cherry picked from commit d403b49)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reinstates the IONOS-specific Viewer delta on top of upstream Nextcloud Viewer v33.0.6, primarily to support “always show viewer” behavior, default/fallback viewing, and Collabora/office/PDF preview exclusions, with rebuilt frontend assets committed for distribution.

Changes:

  • Add an always_show_viewer config module + server-provided initial state, and use it to influence viewer enablement, modal title, handler fallback, grouping, and folder listing behavior.
  • Introduce a Default handler/component and wire it into the viewer so unsupported mimes can fall back to a default UI.
  • Improve image fallback handling (preview → original → default) and harden live photo peer matching; rebuild and commit the generated JS/CSS artifacts.

Reviewed changes

Copilot reviewed 16 out of 38 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/views/Viewer.vue Uses config to drive modal title, handler/group fallback, folder filtering, and default-component fallback selection.
src/utils/livePhotoUtils.ts Coerces basename to string before startsWith to avoid type-related runtime errors.
src/services/Viewer.js Registers the new Default handler in the viewer’s handler registry.
src/models/default.ts Declares the Default handler mapped to the configured “default” mime type.
src/models/config.ts Loads always_show_viewer from initial state and defines the default mime type constant.
src/files_actions/viewerAction.ts Adjusts file action enabled-logic to support always-show behavior.
src/components/Images.vue Adds a second-stage failure state and renders the Default component when original image load also fails.
src/components/Default.vue Adds a default fallback UI for unsupported/unrenderable items.
lib/Listener/LoadViewerScript.php Provides always_show_viewer initial state from app config to the frontend.
js/viewer-main.mjs Rebuilt main viewer bundle reflecting the new default/always-show behavior.
js/previewUtils-BAoIfi1D.chunk.mjs.map.license Generated license metadata for rebuilt preview utils chunk/map.
js/previewUtils-BAoIfi1D.chunk.mjs.license Generated license metadata for rebuilt preview utils chunk.
js/NcModal-BjXpg4f9.chunk.mjs.map.license Generated license metadata for rebuilt NcModal chunk/map.
js/NcModal-BjXpg4f9.chunk.mjs.license Generated license metadata for rebuilt NcModal chunk.
js/NcIconSvgWrapper-Bui9PhAS-BmHHvszF.chunk.mjs.map.license Generated license metadata for rebuilt NcIconSvgWrapper chunk/map.
js/NcIconSvgWrapper-Bui9PhAS-BmHHvszF.chunk.mjs.map Rebuilt sourcemap for NcIconSvgWrapper chunk.
js/NcIconSvgWrapper-Bui9PhAS-BmHHvszF.chunk.mjs.license Generated license metadata for rebuilt NcIconSvgWrapper chunk.
js/NcIconSvgWrapper-Bui9PhAS-BmHHvszF.chunk.mjs Rebuilt NcIconSvgWrapper chunk.
js/NcActionButton-CTBtzndk.chunk.mjs.map.license Generated license metadata for rebuilt NcActionButton chunk/map.
js/NcActionButton-CTBtzndk.chunk.mjs.map Rebuilt sourcemap for NcActionButton chunk.
js/NcActionButton-CTBtzndk.chunk.mjs.license Generated license metadata for rebuilt NcActionButton chunk.
js/NcActionButton-CTBtzndk.chunk.mjs Rebuilt NcActionButton chunk.
js/index-CQjyoCOa.chunk.mjs.map.license Generated license metadata for rebuilt editor-related index chunk/map.
js/index-CQjyoCOa.chunk.mjs.license Generated license metadata for rebuilt editor-related index chunk.
js/index-CQjyoCOa.chunk.mjs Rebuilt editor-related index chunk.
css/viewer-main.css Updates CSS imports to point at rebuilt chunk filenames.
css/viewer-init.css Updates CSS imports to point at rebuilt chunk filenames.
css/main-n63QkgA_.chunk.css Rebuilt main CSS chunk reflecting updated component scoping/hashes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +36 to +38
mounted() {
this.doneLoading()
},
Comment on lines +7 to +9
<div class="default_container">
<img :src="mimeIcon" alt="mimetype-icon">
<span class="title">
Comment on lines +110 to +114
// Always enabled if configured so
if (configModule.alwaysShowViewer) {
// disable for folders
return !nodes.some(node => node.type === 'folder')
}
Comment thread src/models/config.ts
Comment on lines +1 to +5
/**
* SPDX-FileLicenseText: 2024 STRATO AG
* SPDX-License-Identifier: AGPL-3.0-or-later
* SPDX-FileContributor: Mikhailo Matiyenko-Kupriyanov <kupriyanov@strato.de>
*/
@printminion-co

Copy link
Copy Markdown
Author

Folded, one-commit-per-feature variant of this PR opened as #46 (byte-identical tree, history reshaped for upstream-readiness). Leaving both open for granular-vs-folded comparison.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants