Skip to content

Commit 0c1000b

Browse files
Set transitions as |local to solve populating destroy (#2865)
# Motivation Svelte transitions are executed by default in components regardless if their parent components destroy those or not. This behavior is known as the `|global` transitions. This leads NNS dapp to various issues in which components are not destroyed and therefore, there context remains active. Until today we solved this by applying a workaround in which we destroyed the all layout in case of navigation. While it solved the issue, this had for side effect to be a bit unpleasant for the eyes as the all page layout disappeared on navigation. By setting all the animation to `|local` we can solve the issue and make the navigation more fluid. # References - documentation: https://svelte.dev/docs/v4-migration-guide#transitions-are-local-by-default - svelte issue: sveltejs/svelte#6686 # PRs - [x] dfinity/gix-components#246 # Previous issues - #1741 - #2861 # Changes - update gix-cmp to set `|local` to any Svelte transitions - set `|local` to the Svelte animations implemented in NNS dapp - remove detail page layout navigating guard # Notes In the login page we will continue to observe `$navigating` because this condition was not only used to solve the issue but, also to present a spinner while the application is loading.
1 parent aeaaeb3 commit 0c1000b

File tree

4 files changed

+15
-25
lines changed

4 files changed

+15
-25
lines changed

frontend/package-lock.json

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/src/lib/components/accounts/TransactionCard.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
$: seconds = date.getTime() / 1000;
5656
</script>
5757

58-
<article data-tid="transaction-card" transition:fade>
58+
<article data-tid="transaction-card" transition:fade|local>
5959
<div class="icon" class:send={!isReceive}>
6060
<IconNorthEast size="24px" />
6161
</div>

frontend/src/routes/(app)/(u)/(detail)/+layout.svelte

Lines changed: 0 additions & 9 deletions
This file was deleted.

frontend/src/routes/(login)/+layout.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
onMount(async () => await initAppAuth());
1515
</script>
1616

17-
<!-- Workaround for SvelteKit issue https://github.com/sveltejs/kit/issues/5434 -->
1817
{#if isNullish($navigating)}
1918
<Layout layout="stretch">
2019
<Banner />

0 commit comments

Comments
 (0)