diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index fa52359..f3d5f2f 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -7,7 +7,7 @@ - Pass fucntions as props instead od dispatching events - Mixing old (on:click) and new syntaxes for event handling is not allowed. Use only the onclick syntax - when setting state entity, simply od variable = newValue, do not use setState or similar methods like $state. - - USe $props instead of export let! + - USe $props instead of "export let"! - Use styling from ".github/styling.md" for any UI components. - Refer to the ".github/core-instructions.md" for the overall structure of the application. - Generate ".github/done.md" file to see what is done and what is not. Check it when you start and finish a task. @@ -15,4 +15,5 @@ - Avoid unncessary iterations. If problems is mostly solved, stop. - Split big components into subcomponents. Always create smaller subcomponents for better context management later. - Do not do what you're not being asked. Stick to scope of my request. -- Do not edit stores.ts ! Unless is explicitly allow you to. \ No newline at end of file +- Do not edit stores.ts ! Unless is explicitly allow you to. +- Focus only on files that are relevant. Do not venture to fix other things. \ No newline at end of file diff --git a/src/lib/components/wizard/StepCardDetails.svelte b/src/lib/components/wizard/StepCardDetails.svelte index 6539f6e..71d330f 100644 --- a/src/lib/components/wizard/StepCardDetails.svelte +++ b/src/lib/components/wizard/StepCardDetails.svelte @@ -3,31 +3,38 @@ import Navigator from './subcomponents/Navigator.svelte'; import { onMount } from 'svelte'; - let homeSection = $state(''); + let esnSection = $state(''); + let studiesAt = $state(''); let validityStart = $state(''); onMount(() => { validityStart = new Date().toISOString().split('T')[0]; try { - const savedHomeSection = localStorage.getItem('homeSection'); - if (savedHomeSection) { - homeSection = savedHomeSection; + const savedesnSection = localStorage.getItem('esnSection'); + if (savedesnSection) { + esnSection = savedesnSection; + } + const savedStudiesAt = localStorage.getItem('studiesAt'); + if (savedStudiesAt) { + studiesAt = savedStudiesAt; } } catch (error) { console.error('Failed to access localStorage on mount:', error); } }); - let canProceed = $derived(homeSection.trim() !== '' && validityStart.trim() !== ''); + let canProceed = $derived(esnSection.trim() !== '' && studiesAt.trim() !== '' && validityStart.trim() !== ''); function handleContinue() { try { - localStorage.setItem('homeSection', homeSection); + localStorage.setItem('esnSection', esnSection); + localStorage.setItem('studiesAt', studiesAt); } catch (error) { console.error('Failed to save to localStorage:', error); } - $cardDetails = { homeSection, validityStart }; + // Include new field; spread in case store has more fields defined elsewhere + $cardDetails = { ...$cardDetails, esnSection, studiesAt, validityStart } as any; } @@ -41,18 +48,31 @@
-
+
+ + +
+