mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 10:01:00 +01:00
Render the v2 pair page and share the auth footer
/pair only had a default view, so the v2 named router-view rendered nothing and the QR pairing link opened a blank page. Give it a v2 view like /pair/device and drop PairDispatcher. Move the language selector and version tag bar into AuthFooter, used by the sign-in layout and both pair shells. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -508,7 +508,10 @@ const routes = [
|
||||
{
|
||||
path: "/pair",
|
||||
name: ROUTES.PAIR,
|
||||
component: () => import("@/v2/views/PairDispatcher.vue"),
|
||||
components: {
|
||||
default: () => import("@/views/Pair.vue"),
|
||||
v2: v2For(ROUTES.PAIR),
|
||||
},
|
||||
},
|
||||
// Console mode (separate UI namespace under /console): v1 only; v2 merges
|
||||
// console behavior into the main UI via the universal input system.
|
||||
|
||||
28
frontend/src/v2/components/shared/AuthFooter.vue
Normal file
28
frontend/src/v2/components/shared/AuthFooter.vue
Normal file
@@ -0,0 +1,28 @@
|
||||
<script setup lang="ts">
|
||||
// Bottom bar of the sign-in and pair shells: language selector on the left,
|
||||
// version tag on the right. The parent shell owns its placement.
|
||||
import LanguageSelector from "@/v2/components/shared/LanguageSelector.vue";
|
||||
import VersionTag from "@/v2/components/shared/VersionTag.vue";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<footer class="r-v2-auth-footer">
|
||||
<LanguageSelector />
|
||||
<VersionTag class="r-v2-auth-footer__version" />
|
||||
</footer>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.r-v2-auth-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--r-space-3);
|
||||
}
|
||||
|
||||
.r-v2-auth-footer__version {
|
||||
/* Sits directly on the background art with no card behind it, so a soft
|
||||
black shadow keeps it legible over the lighter patches. */
|
||||
text-shadow: 0 1px 3px color-mix(in srgb, black 70%, transparent);
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
// Renders the running RomM version, shared by AuthLayout, DevicePairShell,
|
||||
// and PairShell. Pass `link` to render as an anchor to the release/branch page.
|
||||
// Renders the running RomM version. Pass `link` to render as an anchor to
|
||||
// the release/branch page.
|
||||
import { useVersionDisplay } from "@/v2/composables/useVersionDisplay";
|
||||
|
||||
defineOptions({ inheritAttrs: false });
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
// AuthLayout: full-viewport blurred background with a centred card stage
|
||||
// for the auth flows (Login / Register / ResetPassword / Setup). Bottom
|
||||
// corners hold the LanguageSelector (left) and VersionTag (right).
|
||||
// bar is the shared AuthFooter.
|
||||
import { onMounted } from "vue";
|
||||
import NotificationHost from "@/v2/components/Notifications/NotificationHost.vue";
|
||||
import LanguageSelector from "@/v2/components/shared/LanguageSelector.vue";
|
||||
import VersionTag from "@/v2/components/shared/VersionTag.vue";
|
||||
import AuthFooter from "@/v2/components/shared/AuthFooter.vue";
|
||||
import { installBreakpointAttribute } from "@/v2/composables/useBreakpoint";
|
||||
import { useInputModality } from "@/v2/composables/useInputModality";
|
||||
|
||||
@@ -24,15 +23,8 @@ onMounted(installInputModality);
|
||||
<main class="r-v2-auth__stage">
|
||||
<router-view name="v2" />
|
||||
</main>
|
||||
<!-- Bottom bar: language selector pinned left, version tag right. A
|
||||
single row so the "one on each side" split holds at every width
|
||||
(absolute on desktop, in normal flow below the card on phones). -->
|
||||
<div class="r-v2-auth__footer">
|
||||
<div class="r-v2-auth__lang">
|
||||
<LanguageSelector />
|
||||
</div>
|
||||
<VersionTag class="r-v2-auth__version" />
|
||||
</div>
|
||||
<!-- Absolute on desktop, in normal flow below the card on phones. -->
|
||||
<AuthFooter class="r-v2-auth__footer" />
|
||||
<NotificationHost />
|
||||
</div>
|
||||
</template>
|
||||
@@ -95,24 +87,12 @@ onMounted(installInputModality);
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* Bottom bar is an absolute full-width row on desktop: language selector hugs
|
||||
the left, version tag the right (space-between). */
|
||||
.r-v2-auth__footer {
|
||||
position: absolute;
|
||||
left: var(--r-space-4);
|
||||
right: var(--r-space-4);
|
||||
bottom: var(--r-space-3);
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--r-space-3);
|
||||
}
|
||||
|
||||
.r-v2-auth__version {
|
||||
/* Sits directly on the background art with no card behind it, so a soft
|
||||
black shadow keeps it legible over the lighter patches. */
|
||||
text-shadow: 0 1px 3px color-mix(in srgb, black 70%, transparent);
|
||||
}
|
||||
|
||||
/* Phones: lay the card and the bottom bar out in normal flow instead of
|
||||
|
||||
@@ -21,4 +21,12 @@ describe("v2 route resolution", () => {
|
||||
expect(leaf.name).toBe(ROUTES.ADMINISTRATION);
|
||||
expect(leaf.components?.v2).toBe(v2RouteComponents[ROUTES.ADMINISTRATION]);
|
||||
});
|
||||
|
||||
it("renders the v2 pair shell for /pair", () => {
|
||||
const leaf = leafRouteFor("/pair?code=ABC123");
|
||||
|
||||
expect(leaf.name).toBe(ROUTES.PAIR);
|
||||
expect(v2RouteComponents[ROUTES.PAIR]).toBeDefined();
|
||||
expect(leaf.components?.v2).toBe(v2RouteComponents[ROUTES.PAIR]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -49,8 +49,7 @@ export const v2RouteComponents: Partial<Record<RouteName, V2Route>> = {
|
||||
// Wave 6: Library Tools (Scan / Upload) + Pair
|
||||
[ROUTES.SCAN]: () => import("@/v2/views/Scan.vue"),
|
||||
[ROUTES.UPLOAD]: () => import("@/v2/views/Upload.vue"),
|
||||
// Pair is wired via a top-level PairDispatcher (see plugins/router.ts); no
|
||||
// named-view entry is needed: the dispatcher picks v1 or v2 itself.
|
||||
[ROUTES.PAIR]: () => import("@/v2/views/PairShell.vue"),
|
||||
// Wave 7: Settings suite
|
||||
[ROUTES.USER_PROFILE]: () => import("@/v2/views/Settings/UserProfile.vue"),
|
||||
[ROUTES.USER_INTERFACE]: () =>
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
* nested `<router-view>`, so the shell inlines {@link DevicePair} instead of
|
||||
* reusing AuthLayout directly.
|
||||
*/
|
||||
import LanguageSelector from "@/v2/components/shared/LanguageSelector.vue";
|
||||
import VersionTag from "@/v2/components/shared/VersionTag.vue";
|
||||
import AuthFooter from "@/v2/components/shared/AuthFooter.vue";
|
||||
import DevicePair from "@/v2/views/DevicePair.vue";
|
||||
</script>
|
||||
|
||||
@@ -16,10 +15,7 @@ import DevicePair from "@/v2/views/DevicePair.vue";
|
||||
<main class="r-v2-devpair-shell__stage">
|
||||
<DevicePair />
|
||||
</main>
|
||||
<div class="r-v2-devpair-shell__lang">
|
||||
<LanguageSelector />
|
||||
</div>
|
||||
<VersionTag class="r-v2-devpair-shell__version" />
|
||||
<AuthFooter class="r-v2-devpair-shell__footer" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -68,15 +64,10 @@ import DevicePair from "@/v2/views/DevicePair.vue";
|
||||
max-width: 460px;
|
||||
}
|
||||
|
||||
.r-v2-devpair-shell__lang {
|
||||
/* Absolute so it stays out of the grid and the stage keeps its centring. */
|
||||
.r-v2-devpair-shell__footer {
|
||||
position: absolute;
|
||||
left: var(--r-space-4);
|
||||
bottom: var(--r-space-3);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.r-v2-devpair-shell__version {
|
||||
position: absolute;
|
||||
right: var(--r-space-4);
|
||||
bottom: var(--r-space-3);
|
||||
z-index: 1;
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
// PairDispatcher: /pair has no shared layout wrapper (v1 Pair ships its
|
||||
// own app shell, v2 Pair renders inside an AuthLayout-style shell). The
|
||||
// top-level router entry mounts this dispatcher, which picks v1 or v2
|
||||
// by the user's uiVersion setting. Keeps /pair link-compatible without
|
||||
// touching the v1 Pair implementation.
|
||||
import { computed, defineAsyncComponent } from "vue";
|
||||
import { useUiVersion } from "@/composables/useUiVersion";
|
||||
|
||||
const V1Pair = defineAsyncComponent(() => import("@/views/Pair.vue"));
|
||||
const V2PairShell = defineAsyncComponent(
|
||||
() => import("@/v2/views/PairShell.vue"),
|
||||
);
|
||||
|
||||
const uiVersion = useUiVersion();
|
||||
const active = computed(() =>
|
||||
uiVersion.value === "v2" ? V2PairShell : V1Pair,
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<component :is="active" />
|
||||
</template>
|
||||
@@ -2,8 +2,7 @@
|
||||
// PairShell: minimal AuthLayout-equivalent for /pair under v2. We can't
|
||||
// reuse AuthLayout directly because /pair is a top-level route with no
|
||||
// nested <router-view>; the shell inlines Pair.vue instead.
|
||||
import LanguageSelector from "@/v2/components/shared/LanguageSelector.vue";
|
||||
import VersionTag from "@/v2/components/shared/VersionTag.vue";
|
||||
import AuthFooter from "@/v2/components/shared/AuthFooter.vue";
|
||||
import Pair from "@/v2/views/Pair.vue";
|
||||
</script>
|
||||
|
||||
@@ -13,10 +12,7 @@ import Pair from "@/v2/views/Pair.vue";
|
||||
<main class="r-v2-pair-shell__stage">
|
||||
<Pair />
|
||||
</main>
|
||||
<div class="r-v2-pair-shell__lang">
|
||||
<LanguageSelector />
|
||||
</div>
|
||||
<VersionTag class="r-v2-pair-shell__version" />
|
||||
<AuthFooter class="r-v2-pair-shell__footer" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -55,15 +51,10 @@ import Pair from "@/v2/views/Pair.vue";
|
||||
max-width: 440px;
|
||||
}
|
||||
|
||||
.r-v2-pair-shell__lang {
|
||||
/* Absolute so it stays out of the grid and the stage keeps its centring. */
|
||||
.r-v2-pair-shell__footer {
|
||||
position: absolute;
|
||||
left: var(--r-space-4);
|
||||
bottom: var(--r-space-3);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.r-v2-pair-shell__version {
|
||||
position: absolute;
|
||||
right: var(--r-space-4);
|
||||
bottom: var(--r-space-3);
|
||||
z-index: 1;
|
||||
|
||||
Reference in New Issue
Block a user