File tree Expand file tree Collapse file tree
src/routes/[package]/[version]/examples/[slug] Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343 $effect (() => {
4444 const slug = data .meta .slug ;
4545
46- // Reset namespace and notebook state when switching examples
46+ // Reset namespace when switching examples
47+ // Note: {#key} on Notebook handles component destruction and store cleanup
4748 return async () => {
4849 try {
4950 const { reset } = await import (' $lib/pyodide' );
5051 await reset ();
5152 } catch {
5253 // Ignore if Pyodide not loaded
5354 }
54- notebookStore .resetAllCells ();
55+ notebookStore .reset ();
5556 };
5657 });
5758
8889 downloadUrl ={` ${versionBasePath }/notebooks/${data .meta .file } ` }
8990 />
9091
91- <Notebook
92- notebook ={data .notebook }
93- basePath ={versionBasePath }
94- precomputedOutputs ={data .outputs }
95- {figuresBasePath }
96- showStaticOutputs ={true }
97- executable ={data .meta .executable }
98- />
92+ {#key data .meta .slug }
93+ <Notebook
94+ notebook ={data .notebook }
95+ basePath ={versionBasePath }
96+ precomputedOutputs ={data .outputs }
97+ {figuresBasePath }
98+ showStaticOutputs ={true }
99+ executable ={data .meta .executable }
100+ />
101+ {/ key }
99102</div >
100103
101104<style >
You can’t perform that action at this time.
0 commit comments