Skip to content

Commit a56d193

Browse files
justjuanguiclaude
andcommitted
fix(ui): resolve Svelte 5 state_referenced_locally warning in PhaseView
Use untrack() to explicitly mark initial prop capture as intentionally non-reactive. The expanded state is initialized once from defaultExpanded and depth props, then managed independently by user interaction. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 126ef5d commit a56d193

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib/ui/phase/PhaseView.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script lang="ts">
2+
import { untrack } from "svelte";
23
import type { PhaseInfo } from "./types";
34
import ContributionTable from "./ContributionTable.svelte";
45
import PhaseView from "./PhaseView.svelte";
@@ -13,8 +14,8 @@
1314
1415
const { phase, depth = 0, defaultExpanded = true }: Props = $props();
1516
16-
// Initial expanded state based on depth
17-
let expanded = $state(depth === 0 && defaultExpanded);
17+
// Initial expanded state based on depth (intentionally non-reactive)
18+
let expanded = $state(untrack(() => depth === 0 && defaultExpanded));
1819
const contribCount = $derived(getContributionCount(phase));
1920
const hasContent = $derived(
2021
phase.contributions.length > 0 || phase.nestedGroups.length > 0

0 commit comments

Comments
 (0)