|
| 1 | +// Copyright 2026, Command Line Inc. |
| 2 | +// SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +import Logo from "@/app/asset/logo.svg"; |
| 5 | +import { EmojiButton } from "@/app/element/emojibutton"; |
| 6 | +import { RpcApi } from "@/app/store/wshclientapi"; |
| 7 | +import { TabRpcClient } from "@/app/store/wshrpcutil"; |
| 8 | +import { useState } from "react"; |
| 9 | +import { CurrentOnboardingVersion } from "./onboarding-common"; |
| 10 | +import { OnboardingFooter } from "./onboarding-features-footer"; |
| 11 | + |
| 12 | +export const DurableSessionPage = ({ |
| 13 | + onNext, |
| 14 | + onSkip, |
| 15 | + onPrev, |
| 16 | +}: { |
| 17 | + onNext: () => void; |
| 18 | + onSkip: () => void; |
| 19 | + onPrev?: () => void; |
| 20 | +}) => { |
| 21 | + const [fireClicked, setFireClicked] = useState(false); |
| 22 | + |
| 23 | + const handleFireClick = () => { |
| 24 | + setFireClicked(!fireClicked); |
| 25 | + if (!fireClicked) { |
| 26 | + RpcApi.RecordTEventCommand(TabRpcClient, { |
| 27 | + event: "onboarding:fire", |
| 28 | + props: { |
| 29 | + "onboarding:feature": "durable", |
| 30 | + "onboarding:version": CurrentOnboardingVersion, |
| 31 | + }, |
| 32 | + }); |
| 33 | + } |
| 34 | + }; |
| 35 | + |
| 36 | + return ( |
| 37 | + <div className="flex flex-col h-full"> |
| 38 | + <header className="flex items-center gap-4 mb-6 w-full unselectable flex-shrink-0"> |
| 39 | + <div> |
| 40 | + <Logo /> |
| 41 | + </div> |
| 42 | + <div className="text-[25px] font-normal text-foreground">Durable SSH Sessions</div> |
| 43 | + </header> |
| 44 | + <div className="flex-1 flex flex-row gap-0 min-h-0"> |
| 45 | + <div className="flex-1 flex flex-col items-center justify-center gap-8 pr-6 unselectable"> |
| 46 | + <div className="flex flex-col items-start gap-6 max-w-md"> |
| 47 | + <div className="flex h-[52px] ml-[-4px] pl-3 pr-4 items-center rounded-lg bg-hover text-[18px]"> |
| 48 | + <i className="fa-sharp fa-solid fa-shield text-sky-500" /> |
| 49 | + <span className="font-bold ml-2 text-primary">Your SSH Sessions, Protected</span> |
| 50 | + </div> |
| 51 | + |
| 52 | + <div className="flex flex-col items-start gap-4 text-secondary"> |
| 53 | + <p>Close your laptop, switch networks, restart Wave — your remote sessions keep running.</p> |
| 54 | + |
| 55 | + <div className="flex items-start gap-3 w-full"> |
| 56 | + <i className="fa-sharp fa-solid fa-link text-accent text-lg mt-1 flex-shrink-0" /> |
| 57 | + <p>Shell state, running programs, and terminal history are all preserved</p> |
| 58 | + </div> |
| 59 | + |
| 60 | + <div className="flex items-start gap-3 w-full"> |
| 61 | + <i className="fa-sharp fa-solid fa-rotate text-accent text-lg mt-1 flex-shrink-0" /> |
| 62 | + <p>Sessions automatically reconnect when your connection is restored</p> |
| 63 | + </div> |
| 64 | + |
| 65 | + <div className="flex items-start gap-3 w-full"> |
| 66 | + <i className="fa-sharp fa-solid fa-box text-accent text-lg mt-1 flex-shrink-0" /> |
| 67 | + <p>Buffered output streams back in — you never miss a line</p> |
| 68 | + </div> |
| 69 | + |
| 70 | + <p className="italic"> |
| 71 | + All the persistence of tmux, built into your terminal. Look for the shield icon to |
| 72 | + enable durability on any SSH session. |
| 73 | + </p> |
| 74 | + |
| 75 | + <EmojiButton emoji="🔥" isClicked={fireClicked} onClick={handleFireClick} /> |
| 76 | + </div> |
| 77 | + </div> |
| 78 | + </div> |
| 79 | + <div className="w-[2px] bg-border flex-shrink-0"></div> |
| 80 | + <div className="flex items-center justify-center pl-6 flex-shrink-0 w-[400px]"> |
| 81 | + <div className="flex flex-col gap-6 text-secondary"> |
| 82 | + <div className="text-lg font-semibold text-foreground">Session States</div> |
| 83 | + |
| 84 | + <div className="flex items-start gap-3"> |
| 85 | + <i className="fa-sharp fa-solid fa-shield text-sky-500 text-xl mt-0.5" /> |
| 86 | + <div> |
| 87 | + <div className="font-semibold text-foreground">Attached</div> |
| 88 | + <div className="text-sm">Session is protected and connected</div> |
| 89 | + </div> |
| 90 | + </div> |
| 91 | + |
| 92 | + <div className="flex items-start gap-3"> |
| 93 | + <i className="fa-sharp fa-solid fa-shield text-sky-300 text-xl mt-0.5" /> |
| 94 | + <div> |
| 95 | + <div className="font-semibold text-foreground">Detached</div> |
| 96 | + <div className="text-sm">Session running, currently disconnected</div> |
| 97 | + </div> |
| 98 | + </div> |
| 99 | + |
| 100 | + <div className="flex items-start gap-3"> |
| 101 | + <i className="fa-sharp fa-regular fa-shield text-muted text-xl mt-0.5" /> |
| 102 | + <div> |
| 103 | + <div className="font-semibold text-foreground">Standard</div> |
| 104 | + <div className="text-sm">Connection drops will end the session</div> |
| 105 | + </div> |
| 106 | + </div> |
| 107 | + |
| 108 | + <div className="mt-4 p-4 bg-hover rounded-lg border border-border/50"> |
| 109 | + <div className="text-sm"> |
| 110 | + <div className="font-semibold text-foreground mb-2">Common use cases:</div> |
| 111 | + <ul className="space-y-1.5 ml-2"> |
| 112 | + <li>• Alternative to tmux or screen</li> |
| 113 | + <li>• Long-running builds and deployments</li> |
| 114 | + <li>• Working from unstable networks</li> |
| 115 | + <li>• Surviving Wave restarts</li> |
| 116 | + </ul> |
| 117 | + </div> |
| 118 | + </div> |
| 119 | + </div> |
| 120 | + </div> |
| 121 | + </div> |
| 122 | + <OnboardingFooter currentStep={2} totalSteps={4} onNext={onNext} onPrev={onPrev} onSkip={onSkip} /> |
| 123 | + </div> |
| 124 | + ); |
| 125 | +}; |
0 commit comments