diff --git a/frontend/src/lib/components/WorkspaceHeader.svelte b/frontend/src/lib/components/WorkspaceHeader.svelte index 87f153c..e9e7b97 100644 --- a/frontend/src/lib/components/WorkspaceHeader.svelte +++ b/frontend/src/lib/components/WorkspaceHeader.svelte @@ -60,30 +60,38 @@ else mobileMode = 'hidden'; } } + + function handleTabClick(tab: TabType, lang?: string) { + activeTab = tab; + if (lang) currentLanguage = lang; + if (isMobile && mobileMode === 'hidden') { + mobileMode = 'half'; + } + } {#snippet chromeTabs()} {#if hasInfo} - + {/if} {#if hasExercise} - + {/if} {#if hasCodeEditor} {#if hasMultiLang} - - + + {:else} - + {/if} {/if} {#if hasCircuit} - + {/if} {#if hasVelxio} - + {/if} - + {/snippet} {#if isMobile} diff --git a/frontend/src/routes/lesson/[slug]/+page.svelte b/frontend/src/routes/lesson/[slug]/+page.svelte index b129ce8..4d748e7 100644 --- a/frontend/src/routes/lesson/[slug]/+page.svelte +++ b/frontend/src/routes/lesson/[slug]/+page.svelte @@ -150,7 +150,7 @@ // Mobile state: 'hidden' (only handle bar), 'half' (60%), 'full' (100%) let isMobile = $state(false); - let mobileMode = $state<'hidden' | 'half' | 'full'>('half'); + let mobileMode = $state<'hidden' | 'half' | 'full'>('hidden'); // Media query detection $effect(() => { @@ -209,7 +209,7 @@ else if (isVelxioLesson) activeTab = 'velxio' as any; else if (lesson.active_tabs?.includes('circuit') && !hasC && !hasPython) activeTab = 'circuit'; else activeTab = 'editor'; - mobileMode = 'half'; + mobileMode = 'hidden'; // Populate navbar context lessonContext.set({