Skip to content

Commit c9e86ed

Browse files
committed
chore: fix demo code review commends (#360)
1 parent f4dc29e commit c9e86ed

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

apps/demo/src/lib/components/EventsPanel.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script lang="ts">
2+
import { onDestroy } from 'svelte';
23
import type { createFlowState } from '$lib/stores/pgflow-state.svelte';
34
import { Card, CardContent, CardHeader, CardTitle } from '$lib/components/ui/card';
45
import { Play, CheckCircle2, XCircle } from '@lucide/svelte';
@@ -26,6 +27,10 @@
2627
};
2728
2829
mediaQuery.addEventListener('change', updateMobile);
30+
31+
onDestroy(() => {
32+
mediaQuery.removeEventListener('change', updateMobile);
33+
});
2934
}
3035
3136
// Helper to get short step name

apps/demo/src/lib/components/ExplanationPanel.svelte

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { createEventDispatcher, onMount } from 'svelte';
2+
import { createEventDispatcher, onMount, onDestroy } from 'svelte';
33
import { fade } from 'svelte/transition';
44
import { Button } from '$lib/components/ui/button';
55
import { codeToHtml } from 'shiki';
@@ -46,7 +46,11 @@
4646
reliabilityFeatures: [
4747
{
4848
setting: 'maxAttempts: 2',
49-
explanation: 'Automatically retries failed steps up to 3 times before giving up'
49+
explanation: 'Automatically retries failed steps up to 2 times before giving up'
50+
},
51+
{
52+
setting: 'baseDelay: 1',
53+
explanation: 'Initial retry delay of 1 second, doubling with each retry (1s, 2s, 4s...)'
5054
}
5155
],
5256
inputType: `{
@@ -169,6 +173,10 @@
169173
};
170174
171175
mediaQuery.addEventListener('change', updateMobile);
176+
177+
onDestroy(() => {
178+
mediaQuery.removeEventListener('change', updateMobile);
179+
});
172180
}
173181
174182
// Replace long strings with placeholders for mobile display
@@ -596,20 +604,23 @@
596604
</div>
597605
</details>
598606

599-
<!-- Reliability Features -->
600-
<div>
601-
<div class="font-semibold text-muted-foreground mb-1.5 text-sm">
602-
Reliability Configuration
603-
</div>
604-
<div class="space-y-2">
607+
<!-- Reliability Configuration (collapsible) -->
608+
<details class="concept-explainer bg-background/50 border border-border rounded-lg">
609+
<summary
610+
class="font-semibold text-sm text-foreground cursor-pointer hover:bg-background/80 flex items-center gap-2 p-3 rounded-lg transition-colors"
611+
>
612+
<span class="concept-caret">▸</span>
613+
<span class="flex-1">Reliability configuration</span>
614+
</summary>
615+
<div class="text-xs text-muted-foreground leading-relaxed px-3 pb-3 space-y-2">
605616
{#each flowInfo.reliabilityFeatures as feature (feature.setting)}
606-
<div class="bg-secondary/50 rounded p-2.5">
607-
<code class="text-xs font-mono text-primary">{feature.setting}</code>
608-
<p class="text-xs text-muted-foreground mt-1">{feature.explanation}</p>
617+
<div>
618+
<code class="bg-muted px-1 rounded font-mono text-primary">{feature.setting}</code>
619+
- {feature.explanation}
609620
</div>
610621
{/each}
611622
</div>
612-
</div>
623+
</details>
613624

614625
<!-- Steps -->
615626
<div>

0 commit comments

Comments
 (0)