Skip to content

Commit 0629713

Browse files
committed
feat(claw): add cycling fun messages to provisioning spinner
Add Sims/RCT-style loading messages that fade-cycle during instance provisioning to keep users entertained while they wait.
1 parent 6572f77 commit 0629713

1 file changed

Lines changed: 37 additions & 1 deletion

File tree

src/app/(app)/claw/components/ProvisioningStep.tsx

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import { useEffect, useRef } from 'react';
3+
import { useEffect, useRef, useState } from 'react';
44
import { Volume2 } from 'lucide-react';
55
import { toast } from 'sonner';
66
import { Button } from '@/components/ui/button';
@@ -113,8 +113,36 @@ export function ProvisioningStep({
113113
return <ProvisioningStepView />;
114114
}
115115

116+
const PROVISIONING_MESSAGES = [
117+
'Reticulating splines...',
118+
'Warming up the flux capacitor...',
119+
'Convincing the hamsters to run faster...',
120+
'Downloading more RAM...',
121+
'Generating witty loading messages...',
122+
'Consulting the magic 8-ball...',
123+
'Untangling the internet tubes...',
124+
'Feeding the code monkeys...',
125+
'Aligning the bits...',
126+
'Compiling the compilers...',
127+
'Herding the electrons...',
128+
'Calibrating the cloud...',
129+
];
130+
116131
/** Pure visual shell — extracted so Storybook can render it without wiring up mutations. */
117132
export function ProvisioningStepView() {
133+
const [messageIndex, setMessageIndex] = useState(0);
134+
const [visible, setVisible] = useState(true);
135+
136+
useEffect(() => {
137+
const interval = setInterval(() => {
138+
setVisible(false);
139+
setTimeout(() => {
140+
setMessageIndex(i => (i + 1) % PROVISIONING_MESSAGES.length);
141+
setVisible(true);
142+
}, 300);
143+
}, 3500);
144+
return () => clearInterval(interval);
145+
}, []);
118146
return (
119147
<OnboardingStepView
120148
currentStep={4}
@@ -169,6 +197,14 @@ export function ProvisioningStepView() {
169197
</p>
170198
</div>
171199

200+
{/* Cycling fun message */}
201+
<p
202+
className="text-muted-foreground h-5 text-sm italic transition-opacity duration-300"
203+
style={{ opacity: visible ? 1 : 0 }}
204+
>
205+
{PROVISIONING_MESSAGES[messageIndex]}
206+
</p>
207+
172208
{/* Sound banner */}
173209
<div className="border-border flex w-full items-center gap-3 rounded-lg border p-4">
174210
<Volume2 className="text-muted-foreground h-5 w-5 shrink-0" />

0 commit comments

Comments
 (0)