Henter flere uker når man kommer til slutten av lastet data#1156
Henter flere uker når man kommer til slutten av lastet data#1156
Conversation
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://zealous-wave-0708ca403-1156.westeurope.2.azurestaticapps.net |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://zealous-wave-0708ca403-1156.westeurope.2.azurestaticapps.net |
|
Claude reasoning for bug fix: When the user scrolls to the edge of the rendered weeks, extendWeeks() adds new weeks to dateStore.weeks immediately, causing new swiper slides to render. At that point no entries exist yet for those dates, so addMissingTaskEntriesToWeek in TaskWeek.vue returns placeholder objects: { id: "new-{taskId}-{date}", value: 0, ... }. HourInput mounts and captures timeValue = ref("0"). When getTimeEntries() resolves (milliseconds later), the real entry (numeric ID, real hours value) arrives and filteredTimeEntriesForTask recomputes. Because the :key on HourInput only used taskId-date, the key is the same for both the placeholder and the real entry — so Vue patches in-place rather than recreating the component. The timeEntry prop is updated but timeValue (a local ref initialized at mount) is never re-synced, so the cell stays showing "0". Include timeEntry.id in the :key. The placeholder ID is "new-{taskId}-{date}"; the real entry has a numeric string ID (e.g. "12345"). When the real entry arrives the key changes, Vue destroys the stale HourInput and mounts a fresh one — which correctly initializes timeValue from timeEntry.value at mount. After this one-time transition, the ID is stable for all subsequent saves and fetches (confirmed by isMatchingEntry in timeEntriesStore.ts which merges by date+taskId once a real ID is established). |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://zealous-wave-0708ca403-1156.westeurope.2.azurestaticapps.net |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://zealous-wave-0708ca403-1156.westeurope.2.azurestaticapps.net |
Når man kommer til slutten av lastet data (26 uker), hentes nye 26 uker med tilhørende timer og beregner nye helligdager. Det hentes ikke nye uker når man scroller bakover i tid da dette sannsynligvis ikke er et case man har bruk for.
OBS! Må testes: scroll forbi initiell maksdato (> 6 mnd), før en time på en dato mer enn 6 mnd fra i dag. Deretter refresh siden og scroll frem til datoen du førte på. Sjekk at timeføringen faktisk vises.
Closes #1119