Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
99bbdba
fix how the gallery orders things and reacts to changes in the persis…
johnarban May 13, 2026
baf5b2d
fix annoying ts message
johnarban May 13, 2026
a123c21
add a way to change just the background
johnarban May 13, 2026
6157a14
fix buttons and stuff
johnarban May 13, 2026
9a992f3
hide home button on when in split view
johnarban May 13, 2026
7735861
we'll show the home button, but it will close the view too
johnarban May 13, 2026
f8dc16a
instead only show home if we have moved (ignore zoom)
johnarban May 13, 2026
efae948
padding fix
johnarban May 13, 2026
80fa08e
show home button when simulation is active
johnarban May 13, 2026
22cb191
add some loading states to the gallery
johnarban May 13, 2026
e30a7a0
show home if it has moved at all
johnarban May 13, 2026
73b63fd
update copy and a typo
johnarban May 13, 2026
ef163b3
Merge branch 'main' into minor-changes
patudom May 13, 2026
f0cbd59
update gallery to fix ordering when persisted layer changes and if no…
johnarban May 13, 2026
e8ea384
move bckground picker to bottom right
johnarban May 13, 2026
9714a68
update change limit from 0 to 1 arcsecond motion
johnarban May 13, 2026
2f9c6ff
try to fit in a 4 corners model
johnarban May 14, 2026
48ba80d
stripped down place selection gallery (a little hacky) since we don't…
johnarban May 14, 2026
6c2758b
use PlaceGallery for foreground picker
johnarban May 14, 2026
8981a95
better center the label
johnarban May 14, 2026
3881d59
no border if not showing info button
johnarban May 14, 2026
66f8a63
reset and splitscreen need to reset the background
johnarban May 14, 2026
9a08776
fix crawl background
johnarban May 14, 2026
186e112
get the background informatin visible
johnarban May 14, 2026
e245ecb
rename and refine labels
johnarban May 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
500 changes: 334 additions & 166 deletions src/BubblingGalaxies.vue

Large diffs are not rendered by default.

17 changes: 15 additions & 2 deletions src/components/DetailSummary.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<template>
<div
class="expansion-panel"
@click="() => openInfo()"
@click="() => { if (!hideInfo) openInfo(); }"
>
<strong class="d-block">{{ title }}</strong>
<strong :class="['d-block', {'ep-hideInfo': hideInfo}]">{{ title }}</strong>
<v-icon
v-if="!hideInfo"
aria-label="Learn more"
size="small"
color="white"
Expand Down Expand Up @@ -62,6 +63,7 @@ interface Props {
content?: string;
normallyOpen?: boolean;
useInternalDialog?: boolean;
hideInfo?: boolean;
}

// add an @open emit
Expand All @@ -75,6 +77,7 @@ const props = withDefaults(defineProps<Props>(), {
title: '',
content: '',
useInternalDialog: true,
hideInfo: false,
});


Expand Down Expand Up @@ -113,8 +116,18 @@ function openInfo() {
align-items: center;
justify-content: space-between;
pointer-events: auto;
}

.expansion-panel > strong {
font-size: 0.9em;
border-right: 1px solid white;
padding-right: 4px;
}
.expansion-panel > strong.ep-hideInfo {
font-size: 0.9em;
border-right: none;
}



.expansion-panel > .ds-info-icon {
Expand Down
115 changes: 105 additions & 10 deletions src/components/Gallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,25 @@
>
{{ closedText }}
</span>
<img
<!-- <img
v-if="selectedPlace === null"
class="noselect"
:src="selectedPlace ? getThumbnailUrl(selectedPlace) : (places[previewIndex] ? getThumbnailUrl(places[previewIndex]) : defaultThumbnailUrl)"
/>
/> -->
<div
v-if="selectedPlace === null"
class="gallery-no-view"
>
<span>No view selected</span>
</div>
<GalleryItem
v-else
:place="selectedPlace"
:show-opacity="showOpacity"
:opacity="getOpacity(selectedPlace)"
borderless
hide-label
:loading="loadingImageset[getPlaceKey(selectedPlace)]"
@update:opacity="(v) => setOpacity(selectedPlace!, v)"
/>
</div>
Expand Down Expand Up @@ -71,6 +78,7 @@
:persistent="isPersistantLayer(place)"
:show-opacity="showOpacity && selectedPlaces.includes(place)"
:opacity="placeOpacities[getPlaceKey(place)] ?? getOpacity(place) ?? 1"
:loading="loadingImageset[getPlaceKey(place)]"
@click="selectPlace(place)"
@update:opacity="(v) => setOpacity(place, v)"
/>
Expand All @@ -84,7 +92,7 @@ import { ref, computed, onBeforeMount, nextTick, watch } from "vue";
import { engineStore } from "@wwtelescope/engine-pinia";
import { Folder, Imageset, Place, ImageSetLayer } from "@wwtelescope/engine";
import GalleryItem from "./GalleryItem.vue";

import { useLayerOrdering } from "@/composables/useLayerOrdering";

/* Gallery */

Expand Down Expand Up @@ -130,6 +138,10 @@ export interface GalleryProps {
defaultStarting?: string | null;
/** prevent the gallery from being opened by user interaction */
disabled?: boolean;
/** draw images in the order selected. most recent on top */
useSelectedOrder?: boolean;
/** exclude from list */
excludeItems?: string[];
}


Expand All @@ -152,8 +164,12 @@ const props = withDefaults(defineProps<GalleryProps>(), {
collapseOnSelect: false,
defaultStarting: null,
disabled: false,
useSelectedOrder: false,
excludeItems: undefined,
});



const defaultThumbnailUrl = "https://cdn.worldwidetelescope.org/wwtweb/thumbnail.aspx?name=test";

// const emit = defineEmits<{
Expand All @@ -176,11 +192,18 @@ const selectedPlaces = defineModel<Place[]>("selectedPlaces", { required: false,
const selectedPlace = computed(() => selectedPlaces.value[selectedPlaces.value.length - 1] ?? null);
const placeOpacities = ref<Record<string, number>>({});
const imagesetLayers = ref<Record<string, ImageSetLayer>>({});

let _internallySelecting = false;
const loadingImageset = ref<Record<string, boolean>>({});

const shownPlaces = computed(() => {
if (!props.hidePersisted) return places.value;
return places.value.filter(p => getImageset(p)?.get_name() !== props.persist);
const _dontShow = (p: Place) => {
const c1 = props.persist && getImageset(p)?.get_name() === props.persist;
const c2 = props.excludeItems?.includes(p.get_name());
return !(c1 || c2);
};
return places.value.filter(_dontShow);
});

const cssVars = computed(() => {
Expand Down Expand Up @@ -232,6 +255,8 @@ function getPlaceKey(place: Place): string {
async function loadImagesetLayerForPlace(place: Place): Promise<ImageSetLayer | null> {
const imageset = getImageset(place);
if (!imageset) return null;
const key = getPlaceKey(place);
loadingImageset.value[key] = true;
console.log("Loading imageset layer for place", place.get_name(), "with imageset", imageset.get_name());
return await store.addImageSetLayer({
url: imageset.get_url(),
Expand All @@ -241,6 +266,7 @@ async function loadImagesetLayerForPlace(place: Place): Promise<ImageSetLayer |
}).then((layer) => {
imagesetLayers.value[getPlaceKey(place)] = layer;
layer.set_enabled(false);
loadingImageset.value[key] = false;
return layer;
});
}
Expand All @@ -263,7 +289,7 @@ function getImagesetLayerForPlace(place: Place): ImageSetLayer | null {
return imagesetLayers.value[getPlaceKey(place)] ?? null;
}

function getThumbnailUrl(place: Place): string {
function _getThumbnailUrl(place: Place): string {

const imagesetThumbnail = getImageset(place)?.get_thumbnailUrl();
if (imagesetThumbnail) {
Expand All @@ -289,6 +315,10 @@ function applySelectedPlaceOpacity(place: Place) {
const layer = getImagesetLayerForPlace(place);
if (!layer) return;
layer.set_opacity(0);
if (isPersistantLayer(place)) {
layer.set_opacity(1);
return;
}
layer.set_opacity(getOpacity(place));
}

Expand Down Expand Up @@ -380,6 +410,11 @@ function isPersistantLayer(place: Place) {
return iset.get_name() === props.persist;
}

const getPersistedPlace = () => {
if (props.persist === null) return null;
return places.value.find(p => isPersistantLayer(p)) ?? null;
};

function setPlaceVisibility(place: Place, visible: boolean) {
const layer = getImagesetLayerForPlace(place);
if (!layer) return false;
Expand All @@ -403,17 +438,19 @@ function syncSelectedLayerVisibility() {
}

watch(() => props.persist, (newPersist, oldPersist) => {
// if there is an old persist, hide it
if (oldPersist !== null && oldPersist !== undefined) {
if (oldPersist) {
const oldPlace = places.value.find(p => getImageset(p)?.get_name() === oldPersist);
if (oldPlace) {
setPlaceVisibility(oldPlace, false);
}
}
// if there is a new persist, show it
if (newPersist !== null && newPersist !== undefined) {

if (newPersist) {
const newPlace = places.value.find(p => getImageset(p)?.get_name() === newPersist);
if (newPlace) {
if (selectedPlaces.value.includes(newPlace)) {
selectedPlaces.value = selectedPlaces.value.filter(p => p !== newPlace);
}
const layer = getImagesetLayerForPlace(newPlace);
if (layer) {
setLayerVisibility(layer, true);
Expand All @@ -424,8 +461,31 @@ watch(() => props.persist, (newPersist, oldPersist) => {
}
}
}
showPersistantPlace(places.value);
});

/* get the draw order of currently selected places, including the persistant one */
function getSelectedPlacesDrawOrder() {
const _selected = selectedPlaces.value.slice();
if (!props.useSelectedOrder) {
_selected.sort((a, b) => places.value.indexOf(b) - places.value.indexOf(a));
}
const persisted = getPersistedPlace();
if (persisted) {
if (_selected.includes(persisted)) {
_selected.splice(_selected.indexOf(persisted), 1);
}
_selected.unshift(persisted);
}
return _selected;
}

const { setOrderForPlaces } = useLayerOrdering();
function setDrawOrder() {
const selected = getSelectedPlacesDrawOrder();
setOrderForPlaces(selected);
}

watch(() => props.hideGalleryLayers, (hide) => {
if (hide) {
places.value.forEach(place => {
Expand All @@ -445,6 +505,11 @@ watch(selectedPlaces, () => {
nextTick(() => { _internallySelecting = false; });
}, { immediate: true });

watch(() => [selectedPlaces.value, props.persist], () => {
setDrawOrder();
syncSelectedLayerVisibility();
}, { deep: true });

</script>

<style lang="less">
Expand Down Expand Up @@ -607,12 +672,42 @@ watch(selectedPlaces, () => {
background: hsla(120, 100%, 25%, 0.5);
width: 100%;
text-align: center;
}
}

.gallery-item.gallery-imageset-loading::after {
content: "Loading...";
position: absolute;
inset: 0;
white-space: nowrap;
background: hsla(0, 0%, 0%, 0.5);
width: 100%;
text-align: center;
pointer-events: all;
}

.place-name {
font-size: 0.8em;
margin-inline: 2px;
}

.gallery-no-view {
background: rgba(0,0,0,0.5);
border-radius: 3px;
width: calc(var(--gallery-width) - 10px);
height: 45px;
text-align: center;
line-height: 1;
display:flex;
align-items: center;
padding-inline: 4px;
margin-block: 4px;
font-weight: bold;

span {
color: white;
font-size: 0.9em;
}
}

}
</style>
3 changes: 3 additions & 0 deletions src/components/GalleryItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{ 'gallery-selected': selected },
{ 'galaxy-persisted': persistent },
{ 'gallery-item__borderless': borderless },
{ 'gallery-imageset-loading': loading },
]"
>
<img
Expand Down Expand Up @@ -43,6 +44,7 @@ interface Props {
borderless?: boolean;
hideLabel?: boolean;
hideImage?: boolean;
loading?: boolean;
}

const props = withDefaults(defineProps<Props>(), {
Expand All @@ -53,6 +55,7 @@ const props = withDefaults(defineProps<Props>(), {
borderless: false,
hideLabel: false,
hideImage: false,
loading: false,
});

const emit = defineEmits<{
Expand Down
4 changes: 1 addition & 3 deletions src/components/ImageText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,10 @@
</div>
</template>
<script setup lang="ts">
import type { PropType } from 'vue';
import type { PhantomImageNames } from '../types';
import Lightbox from './Lightbox.vue';
defineProps({
which: {
type: String as PropType<PhantomImageNames>,
type: String,
required: true,
},
showHeading: {
Expand Down
3 changes: 2 additions & 1 deletion src/components/InformationSheet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ a<!-- eslint-disable vue/max-attributes-per-line -->
<v-card
class="info-sheet"
height="100%"
elevation="0"
>
<v-tabs
id="tabs"
Expand Down Expand Up @@ -45,7 +46,7 @@ a<!-- eslint-disable vue/max-attributes-per-line -->
:style="cssVars"
>
<v-window-item>
<v-card class="scrollable border-radius-0">
<v-card class="scrollable border-radius-0" elevation="0">
<v-card-text class="info-text scrollable">
<slot />
</v-card-text>
Expand Down
Loading
Loading