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
10 changes: 9 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -711,11 +711,19 @@ export default function App() {
// First visit: a short welcome, unless a link already brought them here with a purpose.
const [showOnboarding, setShowOnboarding] = useState(() => {
const params = new URLSearchParams(window.location.search);
// ?welcome replays it on purpose (from Settings).
if (params.has("welcome")) return true;
return !params.has("challenge") && !params.has("daily") && !params.has("drill") && shouldOnboard();
});
const finishOnboarding = useCallback((choice: OnboardingChoice | null) => {
markOnboarded();
setShowOnboarding(false);
if (new URLSearchParams(window.location.search).has("welcome")) {
setSearchParams((params) => {
params.delete("welcome");
return params;
}, { replace: true });
}
if (choice?.kind === "code") {
if (devCategory !== "public") handleDevCategoryChange("public");
handleLanguageChange(choice.language);
Expand All @@ -726,7 +734,7 @@ export default function App() {
handleDevCategoryChange("passages");
}
focusWorkspace();
}, [devCategory, handleDevCategoryChange, handleLanguageChange, handleTextLanguageChange, focusWorkspace]);
}, [devCategory, handleDevCategoryChange, handleLanguageChange, handleTextLanguageChange, focusWorkspace, setSearchParams]);

const handleNextSnippet = useCallback(() => {
setResult(null);
Expand Down
3 changes: 3 additions & 0 deletions src/routes/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,9 @@ export default function Settings() {
<span className="rounded-md border border-border/50 bg-background/60 px-1.5 py-0.5">Esc: restart</span>
<span className="rounded-md border border-border/50 bg-background/60 px-1.5 py-0.5">Tab: indent / stop</span>
<span className="rounded-md border border-border/50 bg-background/60 px-1.5 py-0.5">Enter: retry</span>
<Link to="/?welcome" className="ml-auto flex items-center gap-1 rounded-md px-1.5 py-0.5 font-sans font-semibold text-amber-600 hover:underline dark:text-amber-400">
<Sparkles className="size-3" /> Replay welcome tour
</Link>
</div>
</div>

Expand Down
Loading