@@ -145,19 +145,20 @@ export default {
145145
146146<script >
147147import { getBuilder } from ' @nextcloud/browser-storage'
148+ import { getCapabilities } from ' @nextcloud/capabilities'
148149import { emit } from ' @nextcloud/event-bus'
149150import { loadState } from ' @nextcloud/initial-state'
150151import { useSwipe } from ' @vueuse/core'
151152import { Splitpanes , Pane } from ' splitpanes'
153+ import NcAppContentDetailsToggle from ' ./NcAppContentDetailsToggle.vue'
152154import { useIsMobile } from ' ../../composables/useIsMobile/index.js'
155+ import { logger } from ' ../../utils/logger.ts'
153156import { isRtl } from ' ../../utils/rtl.ts'
154157
155- import NcAppContentDetailsToggle from ' ./NcAppContentDetailsToggle.vue'
156-
157158import ' splitpanes/dist/splitpanes.css'
158159
159160const browserStorage = getBuilder (' nextcloud' ).persist ().build ()
160- const { name : productName } = loadState ( ' theming' , ' data ' , { name: ' Nextcloud' })
161+ const instanceName = getCapabilities (). theming ? . name ?? ' Nextcloud'
161162const activeApp = loadState (' core' , ' active-app' , appName)
162163const localizedAppNameState = loadState (' core' , ' apps' , {})
163164const localizedAppName = (Array .isArray (localizedAppNameState)
@@ -197,8 +198,9 @@ export default {
197198
198199 /**
199200 * Allows you to set the default width of the resizable list in % on vertical-split
200- * Allows you to set the default height of the resizable list in % on horizontal-split
201- * Must be between listMinWidth and listMaxWidth
201+ * or respectively the default height on horizontal-split.
202+ *
203+ * Must be between `listMinWidth` and `listMaxWidth`.
202204 */
203205 listSize: {
204206 type: Number ,
@@ -207,7 +209,7 @@ export default {
207209
208210 /**
209211 * Allows you to set the minimum width of the list column in % on vertical-split
210- * Allows you to set the minimum height of the list column in % on horizontal-split
212+ * or respectively the minimum height on horizontal-split.
211213 */
212214 listMinWidth: {
213215 type: Number ,
@@ -216,7 +218,7 @@ export default {
216218
217219 /**
218220 * Allows you to set the maximum width of the list column in % on vertical-split
219- * Allows you to set the maximum height of the list column in % on horizontal-split
221+ * or respectively the maximum height on horizontal-split.
220222 */
221223 listMaxWidth: {
222224 type: Number ,
@@ -245,13 +247,6 @@ export default {
245247 default: true ,
246248 },
247249
248- /**
249- * Specify the `<h1>` page heading
250- */
251- pageHeading: {
252- type: String ,
253- default: null ,
254- },
255250 /**
256251 * Content layout used when there is a list together with content:
257252 * - `vertical-split` - a 2-column layout with list and default content separated vertically
@@ -267,12 +262,20 @@ export default {
267262 },
268263 },
269264
265+ /**
266+ * Specify the `<h1>` page heading
267+ */
268+ pageHeading: {
269+ type: String ,
270+ default: null ,
271+ },
272+
270273 /**
271274 * Allow setting the page's `<title>`
272275 *
273- * If a page heading is set it defaults to `{pageHeading} - {appName} - {productName }` e.g. `Favorites - Files - Nextcloud `.
274- * When the page heading and the app name is the same only one is used, e.g. `Files - Files - Nextcloud ` is shown as `Files - Nextcloud `.
275- * When setting the prop then the following format will be used: `{pageTitle} - {pageHeading || appName} - {productName }`
276+ * If a page heading is set it defaults to `{pageHeading} - {appName} - {instanceName }` e.g. `Favorites - Files - MyPersonalCloud `.
277+ * When the page heading and the app name is the same only one is used, e.g. `Files - Files - MyPersonalCloud ` is shown as `Files - MyPersonalCloud `.
278+ * When setting the prop then the following format will be used: `{pageTitle} - {instanceName }`
276279 */
277280 pageTitle: {
278281 type: String ,
@@ -317,7 +320,7 @@ export default {
317320 // to a global storage key
318321 return ` pane-list-size-${ appName} `
319322 } catch (e) {
320- console .info (' [INFO] AppContent: ' , ' falling back to global nextcloud pane config' )
323+ logger .info (' [NcAppContent]: falling back to global nextcloud pane config' )
321324 return ' pane-list-size-nextcloud'
322325 }
323326 },
@@ -350,20 +353,27 @@ export default {
350353 realPageTitle () {
351354 const entries = new Set ()
352355 if (this .pageTitle ) {
353- entries .add (this .pageTitle )
354- }
355- if (this .pageHeading ) {
356- entries .add (this .pageHeading )
357- }
358- if (entries .size === 0 ) {
356+ // when page title is set we only use that
357+ // we still split to remove duplicated instanceName
358+ for (const part of this .pageTitle .split (' - ' )) {
359+ entries .add (part)
360+ }
361+ } else if (this .pageHeading ) {
362+ // when the page heading is provided but not the title
363+ // then we split to remove duplicates
364+ // but also add the localized app name
365+ for (const part of this .pageHeading .split (' - ' )) {
366+ entries .add (part)
367+ }
368+
369+ if (entries .size > 0 ) {
370+ entries .add (localizedAppName)
371+ }
372+ } else {
359373 return null
360374 }
361375
362- if (entries .size < 2 ) {
363- // Only add if not already pageHeading and pageTitle are included
364- entries .add (localizedAppName)
365- }
366- entries .add (productName)
376+ entries .add (instanceName)
367377 return [... entries .values ()].join (' - ' )
368378 },
369379 },
0 commit comments