diff --git a/frontend/src/hooks.server.ts b/frontend/src/hooks.server.ts index 6321164..554a293 100644 --- a/frontend/src/hooks.server.ts +++ b/frontend/src/hooks.server.ts @@ -20,6 +20,13 @@ function resolveBackend(): string { const API_BACKEND = resolveBackend(); export const handle: Handle = async ({ event, resolve }) => { + console.log(`[hooks] ${event.request.method} ${event.url.pathname} (referer: ${event.request.headers.get('referer')})`); + + // Redirect /editor or /editor/ to /velxio/editor + if (event.url.pathname === '/editor' || event.url.pathname === '/editor/' || event.url.pathname.startsWith('/editor/')) { + return Response.redirect(`${event.url.origin}/velxio/editor${event.url.search}`, 302); + } + // Proxy /api/* and /assets/* to Flask backend const isApi = event.url.pathname.startsWith('/api/'); const isAsset = event.url.pathname.startsWith('/assets/'); diff --git a/frontend/src/lib/components/TeacherVelxioEditor.svelte b/frontend/src/lib/components/TeacherVelxioEditor.svelte index df70954..ef1bcff 100644 --- a/frontend/src/lib/components/TeacherVelxioEditor.svelte +++ b/frontend/src/lib/components/TeacherVelxioEditor.svelte @@ -17,7 +17,7 @@ let saveFeedback = $state(null); let feedbackTimeout: ReturnType | null = null; - const velxioSrc = '/velxio/editor?embed=true'; + const velxioSrc = '/velxio/editor?embed=true&desktopLayout=true'; export function getCurrentState(): { code: string; circuit: string } | null { return getVelxioState(iframeRef);