Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
695 changes: 318 additions & 377 deletions apps/web/src/components/GitActionsControl.tsx

Large diffs are not rendered by default.

105 changes: 51 additions & 54 deletions apps/web/src/components/cloud/ConnectOnboardingDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,10 @@ import { useEnvironments, usePrimaryEnvironment } from "~/state/environments";
import { CloudEnvironmentConnectRows } from "./CloudEnvironmentConnectList";
import { Button } from "../ui/button";
import { Checkbox } from "../ui/checkbox";
import {
Dialog,
DialogDescription,
DialogFooter,
DialogHeader,
DialogPanel,
DialogPopup,
DialogTitle,
} from "../ui/dialog";
import { Dialog } from "../ui/dialog";
import { Switch } from "../ui/switch";
import { toastManager } from "../ui/toast";
import { WizardSteps } from "../ui/wizard-steps";
import { WizardSteps, WizardPopup, WizardHeader, WizardPanel, WizardFooter } from "../ui/wizard";

/**
* Post-sign-in onboarding wizard for T3 Connect. Opens on every in-session
Expand Down Expand Up @@ -216,23 +208,29 @@ function ConfiguredConnectOnboardingDialog() {
if (!open && !isApplying) complete();
}}
>
<DialogPopup className="max-w-xl">
<DialogHeader>
<DialogTitle>Set up T3 Connect</DialogTitle>
<DialogDescription>
Mesh your devices together — publish this environment and connect the rest, all in one
place.
</DialogDescription>
<WizardPopup>
<WizardHeader
title="Set up T3 Connect"
description={
<>
Mesh your devices together — publish this environment and connect the rest, all in one
place.
</>
}
>
{steps.length > 1 ? (
<WizardSteps
steps={steps.map((id) => ({ id, label: STEP_LABELS[id] }))}
currentStep={step}
disabled={isApplying}
onStepSelect={setStep}
steps={steps.map((id) => STEP_LABELS[id])}
currentStep={steps.indexOf(step)}
isStepDisabled={() => isApplying}
onStepChange={(index) => {
const next = steps[index];
if (next) setStep(next);
}}
/>
) : null}
</DialogHeader>
<DialogPanel>
</WizardHeader>
<WizardPanel>
{step === "publish" ? (
<PublishStep
exposeEnvironment={exposeEnvironment}
Expand All @@ -245,38 +243,37 @@ function ConfiguredConnectOnboardingDialog() {
) : (
<DevicesStep />
)}
</DialogPanel>
<DialogFooter variant="bare" className="sm:justify-between">
<label className="flex cursor-pointer items-center gap-2 self-start text-xs text-muted-foreground sm:self-center">
<Checkbox
checked={dontShowAgain}
onCheckedChange={(checked) => setDontShowAgain(checked === true)}
/>
Don&apos;t show this again
</label>
<div className="flex flex-col-reverse gap-2 sm:flex-row">
{step === "publish" ? (
<>
<Button variant="ghost" disabled={isApplying} onClick={() => setStep("devices")}>
Not now
</Button>
<Button
disabled={
isApplying || (controller.linkState.isPending && linkStateData === null)
}
onClick={() => void applyPublishSelection()}
>
{isApplying ? "Enabling…" : "Continue"}
</Button>
</>
) : (
<Button disabled={isApplying} onClick={complete}>
Done
</WizardPanel>
<WizardFooter
leading={
<label className="flex cursor-pointer items-center gap-2 self-start text-xs text-muted-foreground sm:self-center">
<Checkbox
checked={dontShowAgain}
onCheckedChange={(checked) => setDontShowAgain(checked === true)}
/>
Don&apos;t show this again
</label>
}
>
{step === "publish" ? (
<>
<Button variant="ghost" disabled={isApplying} onClick={() => setStep("devices")}>
Not now
</Button>
)}
</div>
</DialogFooter>
</DialogPopup>
<Button
disabled={isApplying || (controller.linkState.isPending && linkStateData === null)}
onClick={() => void applyPublishSelection()}
>
{isApplying ? "Enabling…" : "Continue"}
</Button>
</>
) : (
<Button disabled={isApplying} onClick={complete}>
Done
</Button>
)}
</WizardFooter>
</WizardPopup>
</Dialog>
);
}
Expand Down
110 changes: 55 additions & 55 deletions apps/web/src/components/onboarding/WelcomeWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ import { Input } from "../ui/input";
import { Tooltip, TooltipTrigger, TooltipPopup } from "../ui/tooltip";
import { ScrollArea } from "../ui/scroll-area";
import { Spinner } from "../ui/spinner";
import { WizardPanel, WizardSteps } from "../ui/wizard";
import { Dialog, DialogHeader, DialogPopup, DialogTitle } from "../ui/dialog";
import { WizardPanel, WizardSteps, WizardPopup, WizardHeader } from "../ui/wizard";
import { Dialog } from "../ui/dialog";
import { toastManager } from "../ui/toast";
import { cn } from "../../lib/utils";
import { formatRelativeTime } from "../../timestampFormat";
Expand Down Expand Up @@ -183,71 +183,71 @@ export function WelcomeWizard({

return (
<Dialog open disablePointerDismissal onOpenChange={(_, event) => event.cancel()}>
<DialogPopup
className="max-w-xl overflow-x-hidden overflow-y-auto"
<WizardPopup
bottomStickOnMobile={false}
showCloseButton={false}
initialFocus={() => document.getElementById("onboarding-pairing-url") ?? true}
>
<DialogTitle className="sr-only">Set up T3 Code</DialogTitle>
<div className="flex min-h-0 flex-col">
<DialogHeader className="gap-4">
<WizardHeader
title="Set up T3 Code"
identity={
<div className="flex items-baseline gap-1.5" role="img" aria-label="T3 Code">
<T3Wordmark className="h-4 w-auto shrink-0" aria-hidden />
<span className="text-[1.4rem] font-medium tracking-tight text-muted-foreground">
Code
</span>
</div>
<WizardSteps
steps={ONBOARDING_STAGES}
currentStep={stageIndex}
isStepDisabled={(index) => isImporting || index >= stageIndex}
onStepChange={(index) => {
if (isImporting || index > stageIndex) return;
setStep(index === 0 ? "connection" : "agents");
}
>
<WizardSteps
steps={ONBOARDING_STAGES}
currentStep={stageIndex}
isStepDisabled={(index) => isImporting || index >= stageIndex}
onStepChange={(index) => {
if (isImporting || index > stageIndex) return;
setStep(index === 0 ? "connection" : "agents");
}}
/>
</WizardHeader>

<WizardPanel holdHeight={isLoadingProjects}>
{step === "connection" ? (
<ConnectionStep
expandPairingInitially={!localAvailable && !hasCloudPublicConfig()}
selectedIds={selectedIds}
autoSelectedComputers={autoSelectedComputers.current}
onSelectionChange={setSelection}
onToggleEnvironment={(environmentId, checked) =>
setSelection((current) => {
const next = new Set(current ?? selectedIds);
if (checked) next.add(environmentId);
else next.delete(environmentId);
return next;
})
}
onContinue={() =>
startSetup(
environments
.filter((environment) => selectedIds.has(environment.environmentId))
.map((environment) => environment.environmentId),
)
}
onPaired={(environmentId) => {
setSelection(new Set([...selectedIds, environmentId]));
}}
/>
</DialogHeader>

<WizardPanel className="min-w-0" holdHeight={isLoadingProjects}>
{step === "connection" ? (
<ConnectionStep
expandPairingInitially={!localAvailable && !hasCloudPublicConfig()}
selectedIds={selectedIds}
autoSelectedComputers={autoSelectedComputers.current}
onSelectionChange={setSelection}
onToggleEnvironment={(environmentId, checked) =>
setSelection((current) => {
const next = new Set(current ?? selectedIds);
if (checked) next.add(environmentId);
else next.delete(environmentId);
return next;
})
}
onContinue={() =>
startSetup(
environments
.filter((environment) => selectedIds.has(environment.environmentId))
.map((environment) => environment.environmentId),
)
}
onPaired={(environmentId) => {
setSelection(new Set([...selectedIds, environmentId]));
}}
/>
) : step === "agents" ? (
<AgentsStep environmentIds={setupIds} onContinue={() => setStep("import")} />
) : (
<ImportStep
scans={scans}
isImporting={isImporting}
setIsImporting={setIsImporting}
onDone={finish}
/>
)}
</WizardPanel>
</div>
</DialogPopup>
) : step === "agents" ? (
<AgentsStep environmentIds={setupIds} onContinue={() => setStep("import")} />
) : (
<ImportStep
scans={scans}
isImporting={isImporting}
setIsImporting={setIsImporting}
onDone={finish}
/>
)}
</WizardPanel>
</WizardPopup>
</Dialog>
);
}
Expand Down
Loading
Loading