@@ -13,6 +13,7 @@ import { BBadge, BButton, BCollapse } from "bootstrap-vue";
1313import { computed , ref } from " vue" ;
1414import { useRoute , useRouter } from " vue-router/composables" ;
1515
16+ import { getGalaxyInstance } from " @/app" ;
1617import type { ItemUrls } from " @/components/History/Content/Dataset/index" ;
1718import { updateContentFields } from " @/components/History/model/queries" ;
1819import { useEntryPointStore } from " @/stores/entryPointStore" ;
@@ -21,6 +22,7 @@ import { clearDrag } from "@/utils/setDrag";
2122
2223import { JobStateSummary } from " ./Collection/JobStateSummary" ;
2324import { getContentItemState , type StateMap , STATES } from " ./model/states" ;
25+ import type { RouterPushOptions } from " ./router-push-options" ;
2426
2527import CollectionDescription from " ./Collection/CollectionDescription.vue" ;
2628import ContentOptions from " ./ContentOptions.vue" ;
@@ -263,15 +265,33 @@ function onDisplay() {
263265 const url = entryPointsForHda [0 ]?.target ;
264266 window .open (url , " _blank" );
265267 } else {
268+ const Galaxy = getGalaxyInstance ();
269+ const isWindowManagerActive = Galaxy .frame && Galaxy .frame .active ;
270+
271+ // Build the display URL with displayOnly query param if needed
272+ let displayUrl = itemUrls .value .display ;
273+ if (isWindowManagerActive && displayUrl ) {
274+ displayUrl += displayUrl .includes (" ?" ) ? " &displayOnly=true" : " ?displayOnly=true" ;
275+ }
276+
266277 // vue-router 4 supports a native force push with clean URLs,
267278 // but we're using a __vkey__ bit as a workaround
268279 // Only conditionally force to keep urls clean most of the time.
269280 if (route .path === itemUrls .value .display ) {
281+ const options: RouterPushOptions = {
282+ force: true ,
283+ preventWindowManager: ! isWindowManagerActive ,
284+ title: isWindowManagerActive ? ` ${props .item .hid }: ${props .name } ` : undefined ,
285+ };
270286 // @ts-ignore - monkeypatched router, drop with migration.
271- router .push (itemUrls .value .display , { force: true , preventWindowManager: true });
272- } else if (itemUrls .value .display ) {
287+ router .push (displayUrl , options );
288+ } else if (displayUrl ) {
289+ const options: RouterPushOptions = {
290+ preventWindowManager: ! isWindowManagerActive ,
291+ title: isWindowManagerActive ? ` ${props .item .hid }: ${props .name } ` : undefined ,
292+ };
273293 // @ts-ignore - monkeypatched router, drop with migration.
274- router .push (itemUrls . value . display , { preventWindowManager: true } );
294+ router .push (displayUrl , options );
275295 }
276296 }
277297}
0 commit comments