Add guided onboarding tour for first toolbox creation
All checks were successful
Deploy Sokko G / deploy (push) Successful in 14s

This commit is contained in:
Shinuwa 2026-08-14 13:20:47 +02:00
parent 3007aa1389
commit 4f73e0068b
20 changed files with 470 additions and 20 deletions

View file

@ -5,6 +5,12 @@ import { ConfirmModal, CreateToolboxModal, LinkToolboxModal, NotificationToast }
import { navigate } from "../router/hashRouter.js";
import { uid } from "../features/toolboxes/storage/toolboxStorage.js";
function scrollToTopAfterNavigation() {
window.requestAnimationFrame(() => {
window.requestAnimationFrame(() => window.scrollTo({ top: 0, left: 0, behavior: "auto" }));
});
}
export function InlineNotice({ className = "", iconName = "link", message, tone = "warning" }) {
if (!message) return null;
const classes = ["inline-notice", `is-${tone}`, className].filter(Boolean).join(" ");
@ -34,7 +40,8 @@ export function AppOverlays({
toastPosition,
getGame,
toolboxes,
links
links,
setPendingTutorialToolboxId
}) {
return (
<>
@ -47,9 +54,13 @@ export function AppOverlays({
const gameId = createModal.gameId || "";
setCreateModal(null);
if (!name) return;
const toolbox = actions.createToolbox(name, gameId);
const toolbox = actions.createToolbox(name, gameId, { tutorial: createModal.tutorial === true });
if (toolbox && createModal.tutorial === true) setPendingTutorialToolboxId?.(toolbox.id);
if (toolbox && gameId) setDrawerGameId(gameId);
else if (toolbox) navigate(`/toolbox/${toolbox.id}`);
else if (toolbox) {
navigate(`/toolbox/${toolbox.id}`);
scrollToTopAfterNavigation();
}
}} />}
{linkModalGameId && <LinkToolboxModal gameId={linkModalGameId} toolboxes={toolboxes} selectedId={links[linkModalGameId] || ""} onClose={(toolboxId) => {
const gameId = linkModalGameId;