diff --git a/changes/changelog.d/2090.feature b/changes/changelog.d/2090.feature new file mode 100644 index 000000000..993264243 --- /dev/null +++ b/changes/changelog.d/2090.feature @@ -0,0 +1 @@ +Improve mobile design (#2090) diff --git a/front/src/App.vue b/front/src/App.vue index cec2b1960..a30cba419 100644 --- a/front/src/App.vue +++ b/front/src/App.vue @@ -1,26 +1,32 @@ - - - + + - - - - - - - - - - + + - - {{ $t('App.loading') }} + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/front/src/composables/audio/queue.ts b/front/src/composables/audio/queue.ts index 108eeddaf..1481c0d3e 100644 --- a/front/src/composables/audio/queue.ts +++ b/front/src/composables/audio/queue.ts @@ -111,6 +111,9 @@ export const useQueue = createGlobalState(() => { const { uploads } = await axios.get(`tracks/${track.id}/`) .then(response => response.data as Track, () => ({ uploads: [] as Upload[] })) + // TODO: Either make `track` a writable ref or implement the client/cache model + // See Issue: https://dev.funkwhale.audio/funkwhale/funkwhale/-/issues/2437 + // @ts-expect-error `track` is read-only track.uploads = uploads } @@ -123,11 +126,11 @@ export const useQueue = createGlobalState(() => { artistId: (track.artist_credit && track.artist_credit[0] && track.artist_credit[0].artist.id) ?? -1, albumId: track.album?.id ?? -1, coverUrl: ( - (track.cover?.urls) - || (track.album?.cover?.urls) - || ((track.artist_credit && track.artist_credit[0] && track.artist_credit[0].artist && track.artist_credit[0].artist.cover?.urls)) - || {} - )?.original ?? new URL('../../assets/audio/default-cover.png', import.meta.url).href, + track.cover?.urls.original + || track.album?.cover?.urls.original + || track.artist_credit?.[0]?.artist.cover?.urls.original + || new URL('../../assets/audio/default-cover.png', import.meta.url).href + ).toString(), sources: track.uploads.map(upload => ({ uuid: upload.uuid, duration: upload.duration, diff --git a/front/src/router/index.ts b/front/src/router/index.ts index ce71293fa..c39644cd8 100644 --- a/front/src/router/index.ts +++ b/front/src/router/index.ts @@ -1,6 +1,17 @@ +import { useLocalStorage } from '@vueuse/core' import { createRouter, createWebHistory } from 'vue-router' import { forceInstanceChooser } from './guards' -import routes from './routes' + +import routesV1 from './routes' +import routesV2 from '~/ui/routes' + +// TODO: +// Research... +// - "What is the use case for this toggle?" +// - "Is Local Storage (persistence on a specific browser +// on a specific machine) the right place?" +const isUIv2 = useLocalStorage('ui-v2', true) +const routes = isUIv2.value ? routesV2 : routesV1 const router = createRouter({ history: createWebHistory(import.meta.env.VUE_APP_ROUTER_BASE_URL as string ?? '/'), diff --git a/front/src/ui/components/Sidebar.vue b/front/src/ui/components/Sidebar.vue new file mode 100644 index 000000000..640164d0e --- /dev/null +++ b/front/src/ui/components/Sidebar.vue @@ -0,0 +1,473 @@ + + + + + + + + + {{ t('components.Sidebar.link.home') }} + + + + + + + + {{ moderationNotifications }} + + + + + {{ t('components.Sidebar.link.library') }} + + {{ store.state.ui.notifications.pendingReviewEdits }} + + + + + {{ t('components.Sidebar.link.moderation') }} + + {{ store.state.ui.notifications.pendingReviewReports + store.state.ui.notifications.pendingReviewRequests }} + + + + + {{ t('components.Sidebar.link.users') }} + + + + {{ t('components.Sidebar.link.settings') }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ t('components.common.UserMenu.link.login') }} + + + {{ t('components.common.UserMenu.link.signup') }} + + + + + + + + {{ t('components.Sidebar.header.explore') }} + + + + {{ t('components.Sidebar.link.artists') }} + + + + {{ t('components.Sidebar.link.channels') }} + + + + {{ t('components.Sidebar.link.albums') }} + + + + {{ t('components.Sidebar.link.playlists') }} + + + {{ t('components.Sidebar.link.radios') }} + + + {{ t('components.Sidebar.link.podcasts') }} + + + {{ t('components.Sidebar.link.favorites') }} + + + + + + {{ t('components.Sidebar.link.about') }} + + + + + + + +