Merge pull request #57393 from nextcloud/fix/viewer-sidebar
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
Integration sqlite / changes (push) Waiting to run
Integration sqlite / integration-sqlite (master, 8.4, main, --tags ~@large files_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, capabilities_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, collaboration_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, comments_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, dav_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, federation_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, file_conversions) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, files_reminders) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, filesdrop_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, ldap_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, openldap_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, openldap_numerical_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, remoteapi_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, routing_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, setup_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, sharees_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, sharing_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, theming_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, 8.4, main, videoverification_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite-summary (push) Blocked by required conditions

fix(files): properly handle viewer integration of sidebar
This commit is contained in:
Ferdinand Thiessen 2026-01-16 02:13:50 +01:00 committed by GitHub
commit 5db140d101
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 34 additions and 15 deletions

View file

@ -33,6 +33,8 @@ declare module '@nextcloud/event-bus' {
'files:sidebar:opened': INode
'files:sidebar:closed': undefined
'viewer:sidebar:open': { source: string }
}
}

View file

@ -64,9 +64,7 @@ export default class RouterService {
query?: Record<string, string | (string | null)[] | null | undefined>,
replace?: boolean,
): Promise<Route> {
if (!name) {
name = this.router.currentRoute.name as string
}
name ??= this.router.currentRoute.name as string
const location: Location = { name, query, params }
if (replace) {
return this._router.replace(location)

View file

@ -11,6 +11,7 @@ import { defineStore } from 'pinia'
import { computed, ref, watch } from 'vue'
import logger from '../logger.ts'
import { useActiveStore } from './active.ts'
import { useFilesStore } from './files.ts'
export const useSidebarStore = defineStore('sidebar', () => {
const activeTab = ref<string>()
@ -127,6 +128,17 @@ export const useSidebarStore = defineStore('sidebar', () => {
}
})
subscribe('viewer:sidebar:open', ({ source }) => {
const filesStore = useFilesStore()
const node = filesStore.getNode(source)
if (node) {
logger.debug('Opening sidebar for node from Viewer.', { node })
open(node)
} else {
logger.error(`Cannot open sidebar for node '${source}' because it was not found in the current view.`)
}
})
let initialized = false
// close sidebar when parameter is removed from url
subscribe('files:list:updated', () => {

4
dist/core-common.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
dist/files-main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -12,6 +12,7 @@ SPDX-FileCopyrightText: Tobias Koppers @sokra
SPDX-FileCopyrightText: T. Jameson Little <t.jameson.little@gmail.com>
SPDX-FileCopyrightText: Sindre Sorhus
SPDX-FileCopyrightText: Roman Shtylman <shtylman@gmail.com>
SPDX-FileCopyrightText: Perry Mitchell <perry@perrymitchell.net>
SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors
SPDX-FileCopyrightText: Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)
SPDX-FileCopyrightText: Jonas Schade <derzade@gmail.com>
@ -62,6 +63,9 @@ This file is generated from multiple sources. Included packages:
- @nextcloud/router
- version: 3.1.0
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.3.0
- license: GPL-3.0-or-later
- @vue/devtools-api
- version: 6.6.4
- license: MIT
@ -125,6 +129,9 @@ This file is generated from multiple sources. Included packages:
- vue
- version: 2.7.16
- license: MIT
- webdav
- version: 5.8.0
- license: MIT
- webpack
- version: 5.104.1
- license: MIT

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long