forked from tangled.org/core

stop repo header and layout writes during navigation from tripping svelte #3

Open ezra.eti.tf
targeting master from ezra/nav-invariant
Open opened by and assigned to ezra.eti.tf
targeting master from ezra/nav-invariant

fixes TAN-1064. navigating between repo pages (tabs, a ticket, back and forward) in dev throws svelte invariant_violation errors and await_reactivity_loss warnings, because two places write or read state in a way svelte 5 async mode does not allow during a navigation.

  • RepoHeader read knotInfo with {#await}, now <Pending> with {@const info = await knotInfo}, like the rest of the header
  • the repo layout kept the last counts in $state set from an effect, so counts could be written while the navigation was in flight. it now uses data.counts directly

same run on both branches against the dev server: open tangled.org/core, click issues, pulls, commits, issues and a ticket, then 5 times back and 5 times forward.

invariant_violation await_reactivity_loss
master 11 8
this branch 0 0

pnpm test, eslint, pnpm check and prettier clean on changed files.

Commits 1

web: stop repo header and layout writes during navigation from tripping svelte