From 36e47d48ce212ea7d2babf8bf2e8bce52e8ce937 Mon Sep 17 00:00:00 2001 From: "Fabian @ Blax Software" Date: Wed, 28 Oct 2026 21:05:34 +0100 Subject: [PATCH] feat: in-world header with Village and Map; changing worlds is a quiet link Co-Authored-By: Claude Opus 5.5 --- app/app.vue | 32 +++++++++++++++++++------- app/composables/useCurrentWorld.ts | 36 ++++++++++++++++++++++++++++++ app/pages/map/[worldId].vue | 2 +- app/pages/village/[id].vue | 4 ++-- app/pages/worlds.vue | 3 ++- i18n/locales/en.ts | 3 ++- 6 files changed, 67 insertions(+), 13 deletions(-) create mode 100644 app/composables/useCurrentWorld.ts diff --git a/app/app.vue b/app/app.vue index dfba819..26ceff1 100644 --- a/app/app.vue +++ b/app/app.vue @@ -2,8 +2,14 @@ const { t } = useI18n() const { user, logout } = useAuth() const notices = useNotices() -/** The world of the village or map on screen, for the Map link. */ -const currentWorld = useState('world.current', () => null) +const route = useRoute() +const { current } = useCurrentWorld() + +/** Inside a world (village or map) the header is that world's navigation. */ +const inWorld = computed(() => !!current.value && /^\/(village|map)\//.test(route.path)) +const home = computed(() => + inWorld.value && current.value?.villageId ? `/village/${current.value.villageId}` : '/worlds', +) const connection = computed(() => isMockServer @@ -28,7 +34,7 @@ useHead({ title: () => t('app.title') })
- + @@ -37,12 +43,17 @@ useHead({ title: () => t('app.title') }) -