diff --git a/apps/svelte.dev/src/routes/tutorial/[...slug]/+page.svelte b/apps/svelte.dev/src/routes/tutorial/[...slug]/+page.svelte
index 8cb535ae6a..16b6c3e87d 100644
--- a/apps/svelte.dev/src/routes/tutorial/[...slug]/+page.svelte
+++ b/apps/svelte.dev/src/routes/tutorial/[...slug]/+page.svelte
@@ -1,7 +1,7 @@
-
@@ -225,7 +227,7 @@
{
+ onpopstate={(e) => {
const q = new URLSearchParams(location.search);
const file = q.get('file');
@@ -272,9 +274,9 @@
max="300px"
pos="200px"
>
-
+
{#if mobile}
-
-
-
+
+
{#if mobile && show_filetree}
diff --git a/apps/svelte.dev/src/routes/tutorial/[...slug]/Editor.svelte b/apps/svelte.dev/src/routes/tutorial/[...slug]/Editor.svelte
index a11fdd7d8e..eb8e5a0535 100644
--- a/apps/svelte.dev/src/routes/tutorial/[...slug]/Editor.svelte
+++ b/apps/svelte.dev/src/routes/tutorial/[...slug]/Editor.svelte
@@ -13,19 +13,19 @@
import { svelteTheme } from '@sveltejs/repl/theme';
import { basicSetup } from 'codemirror';
import { onMount, tick } from 'svelte';
- import { adapter_state } from './adapter.svelte';
- import './codemirror.css';
- import { files, selected_file, selected_name, update_file } from './state.js';
- import { toStore } from 'svelte/store';
+ import { files, selected_file, selected_name, update_file } from './state.svelte';
import { autocomplete_for_svelte } from '@sveltejs/site-kit/codemirror';
import type { Diagnostic } from '@codemirror/lint';
import type { Exercise, Stub } from '$lib/tutorial';
+ import type { Warning } from 'svelte/compiler';
+ import './codemirror.css';
interface Props {
exercise: Exercise;
+ warnings: Record;
}
- let { exercise }: Props = $props();
+ let { exercise, warnings }: Props = $props();
let container = $state() as HTMLDivElement;
@@ -38,8 +38,6 @@
let editor_view = $state() as EditorView;
- const warnings = toStore(() => adapter_state.warnings);
-
const extensions = [
basicSetup,
EditorState.tabSize.of(2),
@@ -198,20 +196,20 @@
$effect(() => {
if (editor_view) {
if ($selected_name) {
- const current_warnings = $warnings[$selected_name] || [];
+ const current_warnings = warnings[$selected_name] || [];
const diagnostics = current_warnings.map((warning) => {
/** @type {import('@codemirror/lint').Diagnostic} */
const diagnostic: Diagnostic = {
- from: warning.start.character,
- to: warning.end.character,
+ from: warning.start!.character,
+ to: warning.end!.character,
severity: 'warning',
message: warning.message
};
return diagnostic;
});
- const transaction = setDiagnostics(editor_view.state, diagnostics);
+ const transaction = setDiagnostics(editor_view.state, diagnostics);
editor_view.dispatch(transaction);
}
}
diff --git a/apps/svelte.dev/src/routes/tutorial/[...slug]/Loading.svelte b/apps/svelte.dev/src/routes/tutorial/[...slug]/Loading.svelte
index 4db4a92639..52cdc2c6e0 100644
--- a/apps/svelte.dev/src/routes/tutorial/[...slug]/Loading.svelte
+++ b/apps/svelte.dev/src/routes/tutorial/[...slug]/Loading.svelte
@@ -1,6 +1,6 @@