Skip to content

Henter flere uker når man kommer til slutten av lastet data#1156

Merged
palbock merged 5 commits intomainfrom
feature/utvid-antall-uker
Feb 24, 2026
Merged

Henter flere uker når man kommer til slutten av lastet data#1156
palbock merged 5 commits intomainfrom
feature/utvid-antall-uker

Conversation

@palbock
Copy link
Copy Markdown
Contributor

@palbock palbock commented Feb 12, 2026

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

@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://zealous-wave-0708ca403-1156.westeurope.2.azurestaticapps.net

@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://zealous-wave-0708ca403-1156.westeurope.2.azurestaticapps.net

@palbock
Copy link
Copy Markdown
Contributor Author

palbock commented Feb 24, 2026

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).

@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://zealous-wave-0708ca403-1156.westeurope.2.azurestaticapps.net

boye-s
boye-s previously approved these changes Feb 24, 2026
Copy link
Copy Markdown
Contributor

@boye-s boye-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://zealous-wave-0708ca403-1156.westeurope.2.azurestaticapps.net

@palbock palbock merged commit 2633d78 into main Feb 24, 2026
4 checks passed
@palbock palbock deleted the feature/utvid-antall-uker branch February 24, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ragnhild får ikke scrollet lenger frem i tid enn til juli

2 participants