+
+ {HOME_COPY.BADGE}
+
+
+
+
+ {HOME_COPY.HEADING}
+
+
+ {HOME_COPY.SUBTITLE}
+
+
-
- {isAuthenticated ? (
-
- ) : (
-
-
-
-
-
-
- {HOME_COPY.MOBILE_ORIENTATION_NOTICE}
-
-
-
+
);
}
diff --git a/src/pages/home/ui/HomeManifestNode.tsx b/src/pages/home/ui/HomeManifestNode.tsx
deleted file mode 100644
index a3782b36..00000000
--- a/src/pages/home/ui/HomeManifestNode.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import { cn } from "@/shared/lib";
-
-import type { HomeManifestNodeViewModel } from "../lib";
-
-type HomeManifestNodeProps = {
- node: HomeManifestNodeViewModel;
-};
-
-export function HomeManifestNode({ node }: HomeManifestNodeProps) {
- return (
-
-
-
- {node.indexLabel}
-
- {node.isLast ? null :
}
-
-
-
-
{node.title}
-
{node.description}
-
-
- );
-}
diff --git a/src/pages/home/ui/HomeManifestSection.tsx b/src/pages/home/ui/HomeManifestSection.tsx
deleted file mode 100644
index 4ea21853..00000000
--- a/src/pages/home/ui/HomeManifestSection.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-import { Badge } from "@/shared/ui";
-
-import type { HomeManifestNodeViewModel } from "../lib";
-
-import { HomeManifestNode } from "./HomeManifestNode";
-
-type HomeManifestSectionProps = {
- focusItem: {
- badge: string;
- description: string;
- title: string;
- toneClassName: string;
- };
- heading: string;
- nodes: readonly HomeManifestNodeViewModel[];
- subtitle: string;
-};
-
-export function HomeManifestSection({
- focusItem,
- heading,
- nodes,
- subtitle,
-}: HomeManifestSectionProps) {
- return (
-
-
-
- {heading}
-
-
- {subtitle}
-
-
-
-
-
-
-
-
-
-
- {nodes.map((node) => (
-
- ))}
-
-
-
-
-
-
-
-
- );
-}
diff --git a/src/pages/home/ui/HomePage.test.tsx b/src/pages/home/ui/HomePage.test.tsx
index bcf8f730..09dec85d 100644
--- a/src/pages/home/ui/HomePage.test.tsx
+++ b/src/pages/home/ui/HomePage.test.tsx
@@ -1,18 +1,12 @@
// @vitest-environment happy-dom
-import {
- cleanup,
- fireEvent,
- render,
- screen,
- within,
-} from "@testing-library/react";
+import { cleanup, fireEvent, render, screen } from "@testing-library/react";
import type { ReactNode } from "react";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { AUTH_STATUS } from "@/features/auth";
-import { HOME_COPY, HOME_STATUS_COPY } from "../config";
+import { HOME_COPY } from "../config";
import { HomePage } from "./HomePage";
@@ -61,7 +55,7 @@ const createAuthContext = (isAuthenticated: boolean) => ({
});
describe("HomePage", () => {
- it("renders the redesigned landing copy and concept sections", () => {
+ it("renders the runtime narrative, objective, concepts, and controls", () => {
mockUseAuthContext.mockReturnValue(createAuthContext(false));
render(
);
@@ -70,29 +64,27 @@ describe("HomePage", () => {
screen.getByRole("heading", { name: HOME_COPY.HEADING }),
).not.toBeNull();
expect(screen.getByText(HOME_COPY.SUBTITLE)).not.toBeNull();
- expect(screen.getByText("Node Inspector")).not.toBeNull();
- expect(screen.getByText(HOME_COPY.FEATURES_HEADING)).not.toBeNull();
- expect(screen.getByText("State")).not.toBeNull();
+ expect(
+ screen.getByRole("heading", { name: HOME_COPY.PROOF_HEADING }),
+ ).not.toBeNull();
+ expect(
+ screen.getByRole("heading", { name: HOME_COPY.RUN_HEADING }),
+ ).not.toBeNull();
+ expect(
+ screen.getByRole("heading", { name: HOME_COPY.FIELD_GUIDE_HEADING }),
+ ).not.toBeNull();
expect(screen.getByText("Room")).not.toBeNull();
- expect(screen.getByText("States become rooms")).not.toBeNull();
- expect(screen.getByText("Actors stay isolated")).not.toBeNull();
- expect(screen.getByText("What the dungeon teaches")).not.toBeNull();
- const teachingSection = screen
- .getByRole("heading", { name: HOME_COPY.FEATURES_HEADING })
- .closest("section");
- expect(teachingSection).not.toBeNull();
- const firstTeachingCard = within(
- teachingSection as HTMLElement,
- ).getAllByRole("listitem")[0];
- expect(firstTeachingCard?.className).toContain("lg:col-span-2");
- expect(screen.queryByText(HOME_COPY.RUNTIME_HEADING)).toBeNull();
-
- const mobileOrientationNotice = screen
- .getByText(HOME_COPY.MOBILE_ORIENTATION_NOTICE)
- .closest("div");
-
- expect(mobileOrientationNotice?.className).toContain("text-center");
- expect(mobileOrientationNotice?.className).toContain("sm:hidden");
+ expect(screen.getByText("State")).not.toBeNull();
+ expect(screen.getByText("Interact")).not.toBeNull();
+ expect(screen.getByText("Attack")).not.toBeNull();
+ expect(screen.getByText("E")).not.toBeNull();
+ expect(screen.getByText("F")).not.toBeNull();
+ expect(screen.getByText("Left joystick")).not.toBeNull();
+ expect(screen.getByText("Drag the viewport")).not.toBeNull();
+ expect(screen.getByText("Context buttons")).not.toBeNull();
+ expect(screen.getByText("Panels button")).not.toBeNull();
+ expect(screen.getByText(HOME_COPY.HERO_META)).not.toBeNull();
+ expect(screen.queryByText(/no (account|password|sign-in)/i)).toBeNull();
});
it("requests username entry before authentication", () => {
@@ -103,16 +95,14 @@ describe("HomePage", () => {
render(
);
fireEvent.click(
- screen.getByRole("button", {
+ screen.getAllByRole("button", {
name: HOME_COPY.CTA_LABEL,
- }),
+ })[0] as HTMLButtonElement,
);
expect(authContext.handleUsernameEntryRequest).toHaveBeenCalledOnce();
expect(
- screen.getByRole("link", {
- name: HOME_COPY.TUTORIAL_LABEL,
- }),
+ screen.getByRole("link", { name: HOME_COPY.TRACE_LABEL }),
).not.toBeNull();
});
@@ -128,7 +118,7 @@ describe("HomePage", () => {
).toBeGreaterThan(0);
});
- it("shows a retry action when bootstrap fails", () => {
+ it("shows a retry action when entry bootstrap fails", () => {
const handleSessionBootstrapRetry = vi.fn();
mockUseAuthContext.mockReturnValue({
@@ -141,9 +131,9 @@ describe("HomePage", () => {
render(
);
screen
- .getByRole("button", {
- name: HOME_STATUS_COPY.BOOTSTRAP_FAILED.actionLabel,
- })
+ .getAllByRole("button", {
+ name: HOME_COPY.RETRY_LABEL,
+ })[0]
.click();
expect(handleSessionBootstrapRetry).toHaveBeenCalledOnce();
diff --git a/src/pages/home/ui/HomePage.tsx b/src/pages/home/ui/HomePage.tsx
index 0e21aae6..47f176f2 100644
--- a/src/pages/home/ui/HomePage.tsx
+++ b/src/pages/home/ui/HomePage.tsx
@@ -1,26 +1,20 @@
import { useHomePage } from "../model";
+import { HomeFieldGuideSection } from "./HomeFieldGuideSection";
+import { HomeFinalSection } from "./HomeFinalSection";
import { HomeHeroSection } from "./HomeHeroSection";
-import { HomeManifestSection } from "./HomeManifestSection";
-import { HomeTeachingSection } from "./HomeTeachingSection";
-import { HomeTranslationRail } from "./HomeTranslationRail";
+import { HomeProofSection } from "./HomeProofSection";
+import { HomeRunSection } from "./HomeRunSection";
export function HomePage() {
- const {
- heroProps,
- manifestSectionProps,
- teachingSectionProps,
- translationRailItems,
- } = useHomePage();
+ const { entryProps } = useHomePage();
return (
<>
-
-
-
-
-
-
-
+
+
+
+
+
>
);
}
diff --git a/src/pages/home/ui/HomeProofSection.tsx b/src/pages/home/ui/HomeProofSection.tsx
new file mode 100644
index 00000000..ab4c3157
--- /dev/null
+++ b/src/pages/home/ui/HomeProofSection.tsx
@@ -0,0 +1,70 @@
+import { Activity, Box, Braces } from "lucide-react";
+
+import { HOME_COPY, HOME_SECTION_IDS, HOME_SYSTEM_VIEWS } from "../config";
+
+const HOME_SYSTEM_VIEW_ICONS = [Box, Activity, Braces] as const;
+
+export function HomeProofSection() {
+ return (
+
+
+
+
+
+ One run, three synchronized views
+ live
+
+
+
+
+
+
+ {HOME_COPY.PROOF_HEADING}
+
+
+ {HOME_COPY.PROOF_SUBTITLE}
+
+
+
+
+ {HOME_SYSTEM_VIEWS.map((view, index) => {
+ const Icon = HOME_SYSTEM_VIEW_ICONS[index] ?? Activity;
+ return (
+ -
+
+
+
{view.label}
+
+ {view.description}
+
+
+
+ );
+ })}
+
+
+
+
+ );
+}
diff --git a/src/pages/home/ui/HomeRunSection.tsx b/src/pages/home/ui/HomeRunSection.tsx
new file mode 100644
index 00000000..628850f7
--- /dev/null
+++ b/src/pages/home/ui/HomeRunSection.tsx
@@ -0,0 +1,39 @@
+import { HOME_COPY, HOME_RUN_STEPS } from "../config";
+
+export function HomeRunSection() {
+ return (
+
+
+
+ {HOME_COPY.RUN_HEADING}
+
+
+ {HOME_COPY.RUN_SUBTITLE}
+
+
+
+
+ {HOME_RUN_STEPS.map((step) => (
+ -
+
+ {step.index}
+
+
{step.title}
+
+ {step.description}
+
+
+ ))}
+
+
+ );
+}
diff --git a/src/pages/home/ui/HomeRuntimeDiagram.tsx b/src/pages/home/ui/HomeRuntimeDiagram.tsx
new file mode 100644
index 00000000..c98a5c84
--- /dev/null
+++ b/src/pages/home/ui/HomeRuntimeDiagram.tsx
@@ -0,0 +1,74 @@
+import { Check, LockKeyhole } from "lucide-react";
+
+import { cn } from "@/shared/lib";
+
+import { HOME_RUNTIME_ROOMS } from "../config";
+
+export function HomeRuntimeDiagram() {
+ return (
+
+
+ floorOne.machine
+
+
+ Running
+
+
+
+
+ {HOME_RUNTIME_ROOMS.map((room, index) => (
+ -
+
+ {String(index + 1).padStart(2, "0")}
+
+
+
+ {room.room}
+
+
+ state: {room.machineState}
+
+
+ {room.status === "guarded" ? (
+
+ ) : room.status === "active" ? (
+
+ ) : (
+
+ )}
+
+ ))}
+
+
+
+
+ context.key
+ false
+
+
+ guard.treasury
+ blocked
+
+
+
+ );
+}
diff --git a/src/pages/home/ui/HomeRuntimeReadingSection.tsx b/src/pages/home/ui/HomeRuntimeReadingSection.tsx
deleted file mode 100644
index 589082b5..00000000
--- a/src/pages/home/ui/HomeRuntimeReadingSection.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { cn } from "@/shared/lib";
-import { MARKETING_LAYOUT_CLASS_NAMES } from "@/widgets/marketing-shell";
-
-import { HOME_COPY, HOME_RUNTIME_PANELS } from "../config";
-
-export function HomeRuntimeReadingSection() {
- return (
-
-
-
- {HOME_COPY.RUNTIME_HEADING}
-
-
- {HOME_COPY.RUNTIME_SUBTITLE}
-
-
-
-
- {HOME_RUNTIME_PANELS.map((panel) => (
- -
-
-
-
-
- {panel.title}
-
-
- {panel.description}
-
-
-
-
- ))}
-
-
- );
-}
diff --git a/src/pages/home/ui/HomeTeachingItem.tsx b/src/pages/home/ui/HomeTeachingItem.tsx
deleted file mode 100644
index dc1c36f6..00000000
--- a/src/pages/home/ui/HomeTeachingItem.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import { cn } from "@/shared/lib";
-
-import type { HomeTeachingFeatureViewModel } from "../lib";
-
-type HomeTeachingItemProps = {
- feature: HomeTeachingFeatureViewModel;
-};
-
-export function HomeTeachingItem({ feature }: HomeTeachingItemProps) {
- return (
-
-
-
-
-
-
-
-
- {feature.title}
-
-
- {feature.description}
-
-
-
-
- );
-}
diff --git a/src/pages/home/ui/HomeTeachingSection.tsx b/src/pages/home/ui/HomeTeachingSection.tsx
deleted file mode 100644
index 80f87ef1..00000000
--- a/src/pages/home/ui/HomeTeachingSection.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import type { HomeTeachingFeatureViewModel } from "../lib";
-
-import { HomeTeachingItem } from "./HomeTeachingItem";
-
-type HomeTeachingSectionProps = {
- features: readonly HomeTeachingFeatureViewModel[];
- heading: string;
-};
-
-export function HomeTeachingSection({
- features,
- heading,
-}: HomeTeachingSectionProps) {
- return (
-
-
-
-
- {features.map((feature) => (
- -
-
-
- ))}
-
-
- );
-}
diff --git a/src/pages/home/ui/HomeTranslationRail.tsx b/src/pages/home/ui/HomeTranslationRail.tsx
deleted file mode 100644
index 383f2a45..00000000
--- a/src/pages/home/ui/HomeTranslationRail.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-import { ArrowRight } from "lucide-react";
-
-import { cn } from "@/shared/lib";
-import { MARKETING_LAYOUT_CLASS_NAMES } from "@/widgets/marketing-shell";
-
-import { HOME_TRANSLATION_ARROW_CLASS_NAME } from "../config";
-import type { HomeTranslationItemViewModel } from "../lib";
-
-type HomeTranslationRailProps = {
- items: readonly HomeTranslationItemViewModel[];
-};
-
-export function HomeTranslationRail({ items }: HomeTranslationRailProps) {
- return (
-
- {items.map((item) => (
- -
-
- {item.label}
-
-
-
- {item.target}
-
-
- ))}
-
- );
-}
diff --git a/src/pages/tutorial/config/index.ts b/src/pages/tutorial/config/index.ts
deleted file mode 100644
index ec5db816..00000000
--- a/src/pages/tutorial/config/index.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-export {
- TUTORIAL_CAMERA_MODES,
- TUTORIAL_CONTROL_GROUPS,
- TUTORIAL_CONTROL_TONES,
- type TutorialControlTone,
-} from "./tutorialControlConfig";
-export {
- TUTORIAL_CONTROLS_COPY,
- TUTORIAL_COPY,
- TUTORIAL_FIRST_RUN_COPY,
- TUTORIAL_TAB_IDS,
- TUTORIAL_TABS,
- type TutorialTabId,
-} from "./tutorialCopy";
-export {
- TUTORIAL_FIRST_RUN_STEPS,
- TUTORIAL_FIRST_RUN_TONE_CLASS_NAMES,
- TUTORIAL_FIRST_RUN_TONES,
- type TutorialFirstRunTone,
-} from "./tutorialFirstRunConfig";
-export {
- TUTORIAL_ICON_KEYS,
- type TutorialIconKey,
-} from "./tutorialIconConfig";
diff --git a/src/pages/tutorial/config/tutorialControlConfig.ts b/src/pages/tutorial/config/tutorialControlConfig.ts
deleted file mode 100644
index 49dfb290..00000000
--- a/src/pages/tutorial/config/tutorialControlConfig.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-import { TUTORIAL_ICON_KEYS } from "./tutorialIconConfig";
-
-export const TUTORIAL_CONTROL_TONES = {
- ACCENT: "accent",
- PRIMARY: "primary",
-} as const;
-
-export type TutorialControlTone =
- (typeof TUTORIAL_CONTROL_TONES)[keyof typeof TUTORIAL_CONTROL_TONES];
-
-export const TUTORIAL_CONTROL_GROUPS = [
- {
- heading: "Movement",
- rows: [
- {
- label: "Move",
- mobileIconKey: TUTORIAL_ICON_KEYS.GAMEPAD,
- mobileLabel: "Left joystick",
- shortcuts: ["W", "A", "S", "D"],
- },
- {
- label: "Run toggle",
- mobileIconKey: TUTORIAL_ICON_KEYS.FOOTPRINTS,
- mobileLabel: "Footprints button",
- shortcuts: ["Shift"],
- },
- {
- label: "Jump",
- mobileIconKey: TUTORIAL_ICON_KEYS.CHEVRONS_UP,
- mobileLabel: "Chevrons-up button",
- shortcuts: ["Space"],
- },
- ],
- tone: TUTORIAL_CONTROL_TONES.PRIMARY,
- },
- {
- heading: "Actions",
- rows: [
- {
- label: "Interact",
- shortcuts: ["E"],
- },
- {
- label: "Attack",
- shortcuts: ["F"],
- },
- ],
- tone: TUTORIAL_CONTROL_TONES.ACCENT,
- },
-] as const;
-
-export const TUTORIAL_CAMERA_MODES = [
- {
- code: "3P",
- key: "1",
- label: "3rd Person",
- },
- {
- code: "TD",
- key: "2",
- label: "Top Down",
- },
- {
- code: "1P",
- key: "3",
- label: "1st Person",
- },
- {
- code: "FO",
- key: "4",
- label: "Free Orbital",
- },
-] as const;
diff --git a/src/pages/tutorial/config/tutorialCopy.ts b/src/pages/tutorial/config/tutorialCopy.ts
deleted file mode 100644
index 10cfd14b..00000000
--- a/src/pages/tutorial/config/tutorialCopy.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-export const TUTORIAL_TAB_IDS = {
- CONTROLS: "controls",
- FIRST_RUN: "first-run",
-} as const;
-
-export type TutorialTabId =
- (typeof TUTORIAL_TAB_IDS)[keyof typeof TUTORIAL_TAB_IDS];
-
-export const TUTORIAL_COPY = {
- CTA_LABEL: "Enter Dungeon",
- HEADING: "Manual",
- SUBTITLE:
- "Navigate the functional structure of the playable architecture. Understand state transitions, entity data, and traversal paths.",
-} as const;
-
-export const TUTORIAL_TABS = [
- {
- id: TUTORIAL_TAB_IDS.CONTROLS,
- label: "Controls",
- },
- {
- id: TUTORIAL_TAB_IDS.FIRST_RUN,
- label: "First Run",
- },
-] as const;
-
-export const TUTORIAL_CONTROLS_COPY = {
- SECTION_HEADING: "Controls",
- SECTION_DESCRIPTION:
- "Master the tactile interface to navigate the architecture.",
- MOVEMENT_HEADING: "Movement",
- ACTIONS_HEADING: "Actions",
- CAMERA_HEADING: "Camera modes",
-} as const;
-
-export const TUTORIAL_FIRST_RUN_COPY = {
- SECTION_HEADING: "First run path",
-} as const;
diff --git a/src/pages/tutorial/config/tutorialFirstRunConfig.ts b/src/pages/tutorial/config/tutorialFirstRunConfig.ts
deleted file mode 100644
index 840de582..00000000
--- a/src/pages/tutorial/config/tutorialFirstRunConfig.ts
+++ /dev/null
@@ -1,78 +0,0 @@
-export const TUTORIAL_FIRST_RUN_TONES = {
- ACCENT: "accent",
- PRIMARY: "primary",
- SEALED: "sealed",
- SUCCESS: "success",
-} as const;
-
-export type TutorialFirstRunTone =
- (typeof TUTORIAL_FIRST_RUN_TONES)[keyof typeof TUTORIAL_FIRST_RUN_TONES];
-
-export const TUTORIAL_FIRST_RUN_TONE_CLASS_NAMES = {
- [TUTORIAL_FIRST_RUN_TONES.ACCENT]: "text-dungeon-gold",
- [TUTORIAL_FIRST_RUN_TONES.PRIMARY]: "text-dungeon-gold",
- [TUTORIAL_FIRST_RUN_TONES.SEALED]: "text-dungeon-rune-sealed",
- [TUTORIAL_FIRST_RUN_TONES.SUCCESS]: "text-success",
-} as const;
-
-export const TUTORIAL_FIRST_RUN_STEPS = [
- {
- detail:
- "Mount the run at Entrance, hydrate the active room, and publish the initial state snapshot.",
- label: "Enter the initial state",
- tokens: [
- {
- label: "ENTRANCE",
- tone: TUTORIAL_FIRST_RUN_TONES.PRIMARY,
- },
- ],
- },
- {
- detail:
- "Emit a movement event; the corridor transition resolves before the next room becomes active.",
- label: "Dispatch movement events",
- tokens: [
- {
- label: "CORRIDORS",
- tone: TUTORIAL_FIRST_RUN_TONES.ACCENT,
- },
- ],
- },
- {
- detail:
- "Evaluate the guard against keys and blockers; the path stays sealed until the predicate passes.",
- label: "Satisfy guards",
- tokens: [
- {
- label: "KEYS / BLOCKERS",
- tone: TUTORIAL_FIRST_RUN_TONES.SEALED,
- },
- ],
- },
- {
- detail:
- "Mutate combat state and inventory, then recalculate which transitions remain valid.",
- label: "Resolve combat and context",
- tokens: [
- {
- label: "ENEMY STATE",
- tone: TUTORIAL_FIRST_RUN_TONES.ACCENT,
- },
- {
- label: "INVENTORY",
- tone: TUTORIAL_FIRST_RUN_TONES.PRIMARY,
- },
- ],
- },
- {
- detail:
- "Write the terminal floor state and close the run once the final room resolves.",
- label: "Reach the final state",
- tokens: [
- {
- label: "COMPLETE FLOOR",
- tone: TUTORIAL_FIRST_RUN_TONES.SUCCESS,
- },
- ],
- },
-] as const;
diff --git a/src/pages/tutorial/config/tutorialIconConfig.ts b/src/pages/tutorial/config/tutorialIconConfig.ts
deleted file mode 100644
index 71154b8a..00000000
--- a/src/pages/tutorial/config/tutorialIconConfig.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export const TUTORIAL_ICON_KEYS = {
- CHEVRONS_UP: "chevrons-up",
- FOOTPRINTS: "footprints",
- GAMEPAD: "gamepad",
-} as const;
-
-export type TutorialIconKey =
- (typeof TUTORIAL_ICON_KEYS)[keyof typeof TUTORIAL_ICON_KEYS];
diff --git a/src/pages/tutorial/index.ts b/src/pages/tutorial/index.ts
deleted file mode 100644
index b1baa62e..00000000
--- a/src/pages/tutorial/index.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-export {
- TUTORIAL_CAMERA_MODES,
- TUTORIAL_CONTROL_GROUPS,
- TUTORIAL_CONTROLS_COPY,
- TUTORIAL_COPY,
- TUTORIAL_FIRST_RUN_COPY,
- TUTORIAL_FIRST_RUN_STEPS,
- TUTORIAL_FIRST_RUN_TONE_CLASS_NAMES,
- TUTORIAL_TAB_IDS,
- TUTORIAL_TABS,
- type TutorialTabId,
-} from "./config";
-export { TutorialPage } from "./ui";
diff --git a/src/pages/tutorial/lib/createTutorialPageViewModel.test.ts b/src/pages/tutorial/lib/createTutorialPageViewModel.test.ts
deleted file mode 100644
index dce2606b..00000000
--- a/src/pages/tutorial/lib/createTutorialPageViewModel.test.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { ChevronsUp, Footprints, Gamepad2 } from "lucide-react";
-import { describe, expect, it, vi } from "vitest";
-
-import { createTutorialPageViewModel } from "./createTutorialPageViewModel";
-
-describe("createTutorialPageViewModel", () => {
- it("maps auth state into hero props and control view models", () => {
- const handleUsernameEntryRequest = vi.fn();
-
- const viewModel = createTutorialPageViewModel({
- handleUsernameEntryRequest,
- isAuthenticated: false,
- });
-
- expect(viewModel.heroProps.isAuthenticated).toBe(false);
- expect(viewModel.heroProps.onEntryRequest).toBe(handleUsernameEntryRequest);
- expect(
- viewModel.controlsSectionProps.controlGroups[0]?.rows[0]?.mobileIcon,
- ).toBe(Gamepad2);
- expect(
- viewModel.controlsSectionProps.controlGroups[0]?.rows[1]?.mobileIcon,
- ).toBe(Footprints);
- expect(
- viewModel.controlsSectionProps.controlGroups[0]?.rows[2]?.mobileIcon,
- ).toBe(ChevronsUp);
- expect(viewModel.firstRunSectionProps.steps[0]?.label).toBe(
- "Enter the initial state",
- );
- });
-});
diff --git a/src/pages/tutorial/lib/createTutorialPageViewModel.ts b/src/pages/tutorial/lib/createTutorialPageViewModel.ts
deleted file mode 100644
index ffab28d8..00000000
--- a/src/pages/tutorial/lib/createTutorialPageViewModel.ts
+++ /dev/null
@@ -1,85 +0,0 @@
-import type { AuthContextValue } from "@/features/auth";
-
-import {
- TUTORIAL_CAMERA_MODES,
- TUTORIAL_CONTROL_GROUPS,
- TUTORIAL_CONTROLS_COPY,
- TUTORIAL_FIRST_RUN_COPY,
- TUTORIAL_FIRST_RUN_STEPS,
- type TutorialControlTone,
-} from "../config";
-
-import { resolveTutorialIcon } from "./resolveTutorialIcon";
-
-type CreateTutorialPageViewModelInput = Pick<
- AuthContextValue,
- "handleUsernameEntryRequest" | "isAuthenticated"
->;
-
-export type TutorialControlRowViewModel = {
- label: string;
- mobileIcon: ReturnType
| null;
- mobileLabel?: string;
- shortcuts: readonly string[];
-};
-
-export type TutorialControlGroupViewModel = {
- heading: string;
- rows: readonly TutorialControlRowViewModel[];
- tone: TutorialControlTone;
-};
-
-type TutorialPageViewModel = {
- controlsSectionProps: {
- description: string;
- cameraModes: typeof TUTORIAL_CAMERA_MODES;
- controlGroups: readonly TutorialControlGroupViewModel[];
- heading: string;
- cameraHeading: string;
- };
- firstRunSectionProps: {
- heading: string;
- steps: typeof TUTORIAL_FIRST_RUN_STEPS;
- };
- heroProps: {
- isAuthenticated: boolean;
- onEntryRequest: () => void;
- };
-};
-
-export const createTutorialPageViewModel = ({
- handleUsernameEntryRequest,
- isAuthenticated,
-}: CreateTutorialPageViewModelInput): TutorialPageViewModel => {
- const controlGroups = TUTORIAL_CONTROL_GROUPS.map((group) => ({
- heading: group.heading,
- rows: group.rows.map((row) => ({
- label: row.label,
- mobileIcon:
- "mobileIconKey" in row ? resolveTutorialIcon(row.mobileIconKey) : null,
- mobileLabel: "mobileLabel" in row ? row.mobileLabel : undefined,
- shortcuts: row.shortcuts,
- })),
- tone: group.tone,
- }));
-
- return {
- controlsSectionProps: {
- cameraModes: TUTORIAL_CAMERA_MODES,
- cameraHeading: TUTORIAL_CONTROLS_COPY.CAMERA_HEADING,
- controlGroups,
- description: TUTORIAL_CONTROLS_COPY.SECTION_DESCRIPTION,
- heading: TUTORIAL_CONTROLS_COPY.SECTION_HEADING,
- },
- firstRunSectionProps: {
- heading: TUTORIAL_FIRST_RUN_COPY.SECTION_HEADING,
- steps: TUTORIAL_FIRST_RUN_STEPS,
- },
- heroProps: {
- isAuthenticated,
- onEntryRequest: handleUsernameEntryRequest,
- },
- };
-};
-
-export type { CreateTutorialPageViewModelInput, TutorialPageViewModel };
diff --git a/src/pages/tutorial/lib/index.ts b/src/pages/tutorial/lib/index.ts
deleted file mode 100644
index a84e0abf..00000000
--- a/src/pages/tutorial/lib/index.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export {
- type CreateTutorialPageViewModelInput,
- createTutorialPageViewModel,
- type TutorialControlGroupViewModel,
- type TutorialControlRowViewModel,
- type TutorialPageViewModel,
-} from "./createTutorialPageViewModel";
-export { resolveTutorialIcon } from "./resolveTutorialIcon";
diff --git a/src/pages/tutorial/lib/resolveTutorialIcon.test.ts b/src/pages/tutorial/lib/resolveTutorialIcon.test.ts
deleted file mode 100644
index 6ce9a045..00000000
--- a/src/pages/tutorial/lib/resolveTutorialIcon.test.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { ChevronsUp, Footprints, Gamepad2 } from "lucide-react";
-import { describe, expect, it } from "vitest";
-
-import { TUTORIAL_ICON_KEYS } from "../config";
-import { resolveTutorialIcon } from "./resolveTutorialIcon";
-
-describe("resolveTutorialIcon", () => {
- it("resolves configured tutorial icons", () => {
- expect(resolveTutorialIcon(TUTORIAL_ICON_KEYS.GAMEPAD)).toBe(Gamepad2);
- expect(resolveTutorialIcon(TUTORIAL_ICON_KEYS.FOOTPRINTS)).toBe(Footprints);
- expect(resolveTutorialIcon(TUTORIAL_ICON_KEYS.CHEVRONS_UP)).toBe(
- ChevronsUp,
- );
- });
-});
diff --git a/src/pages/tutorial/lib/resolveTutorialIcon.ts b/src/pages/tutorial/lib/resolveTutorialIcon.ts
deleted file mode 100644
index 3190d738..00000000
--- a/src/pages/tutorial/lib/resolveTutorialIcon.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import {
- ChevronsUp,
- Footprints,
- Gamepad2,
- type LucideIcon,
-} from "lucide-react";
-
-import { TUTORIAL_ICON_KEYS, type TutorialIconKey } from "../config";
-
-export const resolveTutorialIcon = (iconKey: TutorialIconKey): LucideIcon => {
- switch (iconKey) {
- case TUTORIAL_ICON_KEYS.CHEVRONS_UP:
- return ChevronsUp;
- case TUTORIAL_ICON_KEYS.FOOTPRINTS:
- return Footprints;
- case TUTORIAL_ICON_KEYS.GAMEPAD:
- return Gamepad2;
- }
-};
diff --git a/src/pages/tutorial/model/index.ts b/src/pages/tutorial/model/index.ts
deleted file mode 100644
index 85e0cac5..00000000
--- a/src/pages/tutorial/model/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { useTutorialPage } from "./useTutorialPage";
diff --git a/src/pages/tutorial/model/useTutorialPage.ts b/src/pages/tutorial/model/useTutorialPage.ts
deleted file mode 100644
index ad146c67..00000000
--- a/src/pages/tutorial/model/useTutorialPage.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { useAuthContext } from "@/features/auth";
-
-import { createTutorialPageViewModel } from "../lib";
-
-export const useTutorialPage = () => {
- const { handleUsernameEntryRequest, isAuthenticated } = useAuthContext();
-
- return createTutorialPageViewModel({
- handleUsernameEntryRequest,
- isAuthenticated,
- });
-};
diff --git a/src/pages/tutorial/ui/TutorialCameraModesCard.tsx b/src/pages/tutorial/ui/TutorialCameraModesCard.tsx
deleted file mode 100644
index bb888251..00000000
--- a/src/pages/tutorial/ui/TutorialCameraModesCard.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import { Camera } from "lucide-react";
-
-import { cn } from "@/shared/lib";
-import { Card, CardContent } from "@/shared/ui";
-
-import type { TutorialPageViewModel } from "../lib";
-
-type TutorialCameraModesCardProps = {
- cameraHeading: TutorialPageViewModel["controlsSectionProps"]["cameraHeading"];
- cameraModes: TutorialPageViewModel["controlsSectionProps"]["cameraModes"];
-};
-
-export function TutorialCameraModesCard({
- cameraHeading,
- cameraModes,
-}: TutorialCameraModesCardProps) {
- return (
-
-
-
-
-
-
-
- {cameraHeading}
-
-
-
-
- {cameraModes.map((mode) => (
- -
-
-
- {mode.label}
-
-
-
- {mode.code}
-
-
- {mode.key}
-
-
-
-
- ))}
-
-
-
- );
-}
diff --git a/src/pages/tutorial/ui/TutorialControlGroupCard.tsx b/src/pages/tutorial/ui/TutorialControlGroupCard.tsx
deleted file mode 100644
index 3341284c..00000000
--- a/src/pages/tutorial/ui/TutorialControlGroupCard.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import { Keyboard, Zap } from "lucide-react";
-
-import { cn } from "@/shared/lib";
-import { Card, CardContent } from "@/shared/ui";
-
-import { TUTORIAL_CONTROL_TONES } from "../config";
-import type { TutorialControlGroupViewModel } from "../lib";
-
-import { TutorialControlRow } from "./TutorialControlRow";
-
-type TutorialControlGroupCardProps = {
- group: TutorialControlGroupViewModel;
-};
-
-export function TutorialControlGroupCard({
- group,
-}: TutorialControlGroupCardProps) {
- return (
-
-
-
-
- {group.tone === TUTORIAL_CONTROL_TONES.ACCENT ? (
-
- ) : (
-
- )}
-
-
- {group.heading}
-
-
-
-
- {group.rows.map((row) => (
-
- ))}
-
-
-
- );
-}
diff --git a/src/pages/tutorial/ui/TutorialControlRow.tsx b/src/pages/tutorial/ui/TutorialControlRow.tsx
deleted file mode 100644
index 7e8455b1..00000000
--- a/src/pages/tutorial/ui/TutorialControlRow.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-import type { LucideIcon } from "lucide-react";
-
-import { cn } from "@/shared/lib";
-
-type TutorialControlRowData = {
- label: string;
- mobileIcon?: LucideIcon | null;
- mobileLabel?: string;
- shortcuts: readonly string[];
-};
-
-type TutorialControlRowProps = {
- row: TutorialControlRowData;
-};
-
-export function TutorialControlRow({ row }: TutorialControlRowProps) {
- const MobileShortcutIcon = row.mobileIcon;
- const hasMobileIcon = MobileShortcutIcon != null;
-
- return (
-
- {row.label}
-
- {hasMobileIcon && MobileShortcutIcon ? (
-
-
-
-
-
- {row.mobileLabel}
-
-
- ) : null}
-
-
- {row.shortcuts.map((shortcut) => (
-
- {shortcut}
-
- ))}
-
-
-
- );
-}
-
-export type { TutorialControlRowData };
diff --git a/src/pages/tutorial/ui/TutorialControlsPanel.tsx b/src/pages/tutorial/ui/TutorialControlsPanel.tsx
deleted file mode 100644
index 33e53597..00000000
--- a/src/pages/tutorial/ui/TutorialControlsPanel.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import type { TutorialPageViewModel } from "../lib";
-
-import { TutorialCameraModesCard } from "./TutorialCameraModesCard";
-import { TutorialControlGroupCard } from "./TutorialControlGroupCard";
-
-type TutorialControlsPanelProps = TutorialPageViewModel["controlsSectionProps"];
-
-export function TutorialControlsPanel({
- cameraHeading,
- cameraModes,
- controlGroups,
- description,
- heading,
-}: TutorialControlsPanelProps) {
- return (
-
-
-
- {heading}
-
-
- {description}
-
-
-
-
-
- {controlGroups.map((group) => (
-
- ))}
-
-
-
-
-
- );
-}
diff --git a/src/pages/tutorial/ui/TutorialFirstRunPanel.tsx b/src/pages/tutorial/ui/TutorialFirstRunPanel.tsx
deleted file mode 100644
index cb43918c..00000000
--- a/src/pages/tutorial/ui/TutorialFirstRunPanel.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-import { cn } from "@/shared/lib";
-import { Badge } from "@/shared/ui";
-
-import {
- TUTORIAL_FIRST_RUN_TONE_CLASS_NAMES,
- TUTORIAL_FIRST_RUN_TONES,
-} from "../config";
-import type { TutorialPageViewModel } from "../lib";
-
-type TutorialFirstRunPanelProps = TutorialPageViewModel["firstRunSectionProps"];
-
-export function TutorialFirstRunPanel({
- heading,
- steps,
-}: TutorialFirstRunPanelProps) {
- return (
-
-
-
-
- {steps.map((step, index) => (
- -
-
-
- {String(index + 1).padStart(2, "0")}
-
- {index < steps.length - 1 ? (
-
- ) : null}
-
-
-
-
-
-
- {step.label}
-
-
- {step.tokens.map((token) => (
-
- {token.label}
-
- ))}
-
-
- {step.detail}
-
-
-
-
- ))}
-
-
- );
-}
diff --git a/src/pages/tutorial/ui/TutorialHero.tsx b/src/pages/tutorial/ui/TutorialHero.tsx
deleted file mode 100644
index 048cc92a..00000000
--- a/src/pages/tutorial/ui/TutorialHero.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import { Link } from "@tanstack/react-router";
-import { BookOpen, DoorOpen } from "lucide-react";
-
-import { Button } from "@/shared/ui";
-import { MARKETING_ROUTES } from "@/widgets/marketing-shell";
-
-import { TUTORIAL_COPY } from "../config";
-
-type TutorialHeroProps = {
- isAuthenticated: boolean;
- onEntryRequest: () => void;
-};
-
-export function TutorialHero({
- isAuthenticated,
- onEntryRequest,
-}: TutorialHeroProps) {
- return (
-
- );
-}
diff --git a/src/pages/tutorial/ui/TutorialPage.test.tsx b/src/pages/tutorial/ui/TutorialPage.test.tsx
deleted file mode 100644
index b7a78939..00000000
--- a/src/pages/tutorial/ui/TutorialPage.test.tsx
+++ /dev/null
@@ -1,160 +0,0 @@
-// @vitest-environment happy-dom
-
-import {
- cleanup,
- fireEvent,
- render,
- screen,
- waitFor,
- within,
-} from "@testing-library/react";
-import type { ReactNode } from "react";
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
-
-import { TutorialPage } from "./TutorialPage";
-
-const mockUseAuthContext = vi.hoisted(() => vi.fn());
-
-vi.mock("@/features/auth", async () => {
- const actual =
- await vi.importActual("@/features/auth");
-
- return {
- ...actual,
- useAuthContext: mockUseAuthContext,
- };
-});
-
-vi.mock("@tanstack/react-router", () => ({
- Link: ({ children, to, ...props }: { children: ReactNode; to: string }) => (
-
- {children}
-
- ),
-}));
-
-afterEach(cleanup);
-
-beforeEach(() => {
- mockUseAuthContext.mockReturnValue({
- handleUsernameEntryRequest: vi.fn(),
- isAuthenticated: true,
- });
-});
-
-const activateTab = (name: string) => {
- const tab = screen.getByRole("tab", { name });
-
- fireEvent.pointerDown(tab);
- fireEvent.mouseDown(tab);
- fireEvent.click(tab);
-};
-
-describe("TutorialPage", () => {
- it("renders the guide with stable tabs", () => {
- render();
-
- expect(screen.getByText("Manual")).not.toBeNull();
- expect(screen.getByRole("tab", { name: "Controls" })).not.toBeNull();
- expect(screen.getByRole("tab", { name: "First Run" })).not.toBeNull();
- expect(screen.queryByRole("tab", { name: "Concepts" })).toBeNull();
- });
-
- it("renders accurate desktop controls", () => {
- render();
-
- expect(
- screen.getByText(
- "Master the tactile interface to navigate the architecture.",
- ),
- ).not.toBeNull();
- expect(screen.getByText("Movement")).not.toBeNull();
- expect(screen.getByText("Actions")).not.toBeNull();
- expect(screen.getByText("Camera modes")).not.toBeNull();
- expect(screen.getByText("3rd Person")).not.toBeNull();
- expect(screen.getByText("Top Down")).not.toBeNull();
- expect(screen.getByText("1st Person")).not.toBeNull();
- expect(screen.getByText("Free Orbital")).not.toBeNull();
- expect(screen.getByText("W", { selector: "kbd" })).not.toBeNull();
- expect(screen.getByText("Shift", { selector: "kbd" })).not.toBeNull();
- expect(screen.getByText("Space", { selector: "kbd" })).not.toBeNull();
- expect(screen.getByText("E", { selector: "kbd" })).not.toBeNull();
- expect(screen.getByText("F", { selector: "kbd" })).not.toBeNull();
- expect(screen.getByText("Left joystick")).not.toBeNull();
- expect(screen.getByText("Footprints button")).not.toBeNull();
- expect(screen.getByText("Chevrons-up button")).not.toBeNull();
- });
-
- it("renders first run content without developer setup copy", async () => {
- render();
-
- activateTab("First Run");
-
- await waitFor(() =>
- expect(screen.getByText("First run path")).not.toBeNull(),
- );
- expect(screen.getByText("Enter the initial state")).not.toBeNull();
- expect(screen.getByText("Dispatch movement events")).not.toBeNull();
- expect(screen.getByText("Satisfy guards")).not.toBeNull();
- expect(screen.getByText("Resolve combat and context")).not.toBeNull();
- expect(screen.getByText("Reach the final state")).not.toBeNull();
- expect(
- screen.getByText(
- "Mount the run at Entrance, hydrate the active room, and publish the initial state snapshot.",
- ),
- ).not.toBeNull();
- expect(
- screen.getByText(
- "Emit a movement event; the corridor transition resolves before the next room becomes active.",
- ),
- ).not.toBeNull();
- expect(
- screen.getByText(
- "Evaluate the guard against keys and blockers; the path stays sealed until the predicate passes.",
- ),
- ).not.toBeNull();
- expect(
- screen.getByText(
- "Mutate combat state and inventory, then recalculate which transitions remain valid.",
- ),
- ).not.toBeNull();
- expect(
- screen.getByText(
- "Write the terminal floor state and close the run once the final room resolves.",
- ),
- ).not.toBeNull();
- expect(screen.getByText("ENTRANCE")).not.toBeNull();
- expect(screen.getByText("CORRIDORS")).not.toBeNull();
- expect(screen.getByText("KEYS / BLOCKERS")).not.toBeNull();
- expect(screen.getByText("ENEMY STATE")).not.toBeNull();
- expect(screen.getByText("INVENTORY")).not.toBeNull();
- expect(screen.getByText("COMPLETE FLOOR")).not.toBeNull();
- expect(screen.queryByText(/git clone/i)).toBeNull();
- expect(screen.queryByText(/pnpm/i)).toBeNull();
- expect(screen.queryByText(/deployment/i)).toBeNull();
- });
-
- it("requests username entry when unauthenticated", () => {
- const handleUsernameEntryRequest = vi.fn();
-
- mockUseAuthContext.mockReturnValue({
- handleUsernameEntryRequest,
- isAuthenticated: false,
- });
-
- render();
-
- const hero = screen
- .getByRole("heading", { name: "Manual" })
- .closest("header");
-
- expect(hero).not.toBeNull();
- const entryButton = within(hero as HTMLElement).getByRole("button", {
- name: "Enter Dungeon",
- });
-
- fireEvent.click(entryButton);
-
- expect(handleUsernameEntryRequest).toHaveBeenCalledOnce();
- });
-});
diff --git a/src/pages/tutorial/ui/TutorialPage.tsx b/src/pages/tutorial/ui/TutorialPage.tsx
deleted file mode 100644
index af8df724..00000000
--- a/src/pages/tutorial/ui/TutorialPage.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/shared/ui";
-
-import { TUTORIAL_TAB_IDS, TUTORIAL_TABS } from "../config";
-import { useTutorialPage } from "../model";
-
-import { TutorialControlsPanel } from "./TutorialControlsPanel";
-import { TutorialFirstRunPanel } from "./TutorialFirstRunPanel";
-import { TutorialHero } from "./TutorialHero";
-
-export function TutorialPage() {
- const { controlsSectionProps, firstRunSectionProps, heroProps } =
- useTutorialPage();
-
- return (
- <>
-
-
-
-
- {TUTORIAL_TABS.map((tab) => (
-
- {tab.label}
-
- ))}
-
-
-
-
-
-
-
-
-
-
- >
- );
-}
diff --git a/src/pages/tutorial/ui/index.ts b/src/pages/tutorial/ui/index.ts
deleted file mode 100644
index 50a9dfd6..00000000
--- a/src/pages/tutorial/ui/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { TutorialPage } from "./TutorialPage";
diff --git a/src/widgets/marketing-shell/config/marketingLayoutConfig.ts b/src/widgets/marketing-shell/config/marketingLayoutConfig.ts
index 2a9d905f..49b4820c 100644
--- a/src/widgets/marketing-shell/config/marketingLayoutConfig.ts
+++ b/src/widgets/marketing-shell/config/marketingLayoutConfig.ts
@@ -1,39 +1,8 @@
export const MARKETING_LAYOUT_CLASS_NAMES = {
PAGE_FRAME:
- "mx-auto flex w-full max-w-7xl flex-col gap-12 px-4 py-10 sm:gap-14 sm:px-6 sm:py-14 lg:gap-16 lg:px-8 lg:py-16",
+ "flex w-full flex-col gap-20 py-6 sm:gap-24 sm:py-8 lg:gap-28 lg:py-10",
+ CONTENT_GUTTER: "px-3 sm:px-4",
CONTENT_WIDTH: "max-w-7xl",
SHELL_BACKGROUND:
- "pointer-events-none absolute inset-0 overflow-hidden bg-background",
- SHELL_GLOW_PRIMARY:
- "absolute -left-24 -top-24 size-96 rounded-full bg-dungeon-gold/10 blur-3xl",
- SHELL_GLOW_ACCENT:
- "absolute right-[-6rem] top-16 size-96 rounded-full bg-dungeon-gold/10 blur-3xl",
- SHELL_GRID:
- "absolute inset-0 bg-[url('/marketing/hex-grid.svg')] bg-[size:120px_104px] opacity-[0.08]",
- SHELL_EDGE_FADE:
- "absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-background/82 to-transparent",
- SECTION_GAP: "space-y-6 sm:space-y-8",
- SPLIT_GRID: "grid gap-6 lg:grid-cols-[1.1fr_0.9fr]",
- CARD_GRID: "grid gap-5 sm:grid-cols-2 xl:grid-cols-3",
- CARD_SURFACE: "rounded-lg border border-border bg-card/80 shadow-none ring-0",
- CARD_CONTENT: "p-5 sm:p-6",
- SUBTLE_PANEL: "rounded-lg border border-border bg-card/70 shadow-none ring-0",
- MAJOR_PANEL: "rounded-xl border border-border bg-card/80 shadow-none ring-0",
- CTA_BAND: "rounded-xl border border-border bg-card/70 px-5 py-5 sm:px-6",
- TOKEN_RAIL:
- "flex w-full items-center gap-2 overflow-x-auto border-y border-border bg-card/40 px-4 py-3 backdrop-blur no-scrollbar",
- LIGHT_ROW: "rounded-lg border border-border bg-card/70 transition-colors",
- LIGHT_ROW_INTERACTIVE:
- "rounded-lg border border-border bg-card/70 transition-colors hover:border-dungeon-gold/40 hover:bg-dungeon-gold/5",
- TIMELINE_LIST:
- "relative grid gap-4 rounded-xl border border-border bg-card/50 p-4 sm:p-5",
- TIMELINE_ITEM:
- "relative grid grid-cols-[auto_minmax(0,1fr)] gap-3 rounded-lg border border-border bg-card/80 px-4 py-4 sm:gap-4 sm:px-5",
- TIMELINE_RAIL: "flex flex-col items-center pt-1",
- TIMELINE_NODE:
- "flex size-8 items-center justify-center rounded-full border border-dungeon-gold/45 bg-dungeon-gold/10 text-[0.7rem] font-bold text-dungeon-gold",
- MAPPING_RAIL:
- "grid gap-4 rounded-xl border border-border bg-card/50 p-4 sm:p-5",
- MAPPING_ROW:
- "grid gap-4 rounded-lg border border-border bg-card/80 p-4 sm:grid-cols-[minmax(0,0.75fr)_auto_minmax(0,1fr)] sm:items-center sm:p-5",
+ "observatory-backdrop pointer-events-none absolute inset-0 overflow-hidden",
} as const;
diff --git a/src/widgets/marketing-shell/config/marketingShellConfig.ts b/src/widgets/marketing-shell/config/marketingShellConfig.ts
index d277b271..3ea1922b 100644
--- a/src/widgets/marketing-shell/config/marketingShellConfig.ts
+++ b/src/widgets/marketing-shell/config/marketingShellConfig.ts
@@ -1,6 +1,6 @@
export const MARKETING_NAVIGATION_ITEM_IDS = {
- GUIDE: "guide",
- CONCEPTS: "concepts",
+ HOW_IT_WORKS: "how-it-works",
+ FIELD_GUIDE: "field-guide",
} as const;
export type MarketingNavigationItemId =
@@ -20,42 +20,48 @@ export const MARKETING_SHELL_COPY = {
BRAND_STONE_SEGMENT: "STONE",
COMPACT_BRAND_RUNE_SEGMENT: "R",
COMPACT_BRAND_STONE_SEGMENT: "S",
- ENTER_DUNGEON_LABEL: "Enter Dungeon",
+ ENTER_DUNGEON_LABEL: "Enter Floor I",
NAVIGATION_SHEET_TITLE: "Runestone",
- NAVIGATION_SHEET_DESCRIPTION: "Navigate the playable architecture guide.",
+ NAVIGATION_SHEET_DESCRIPTION:
+ "Inspect Floor I, the running machine, and its controls.",
FOOTER_COPYRIGHT: "© 2026 Runestone",
- FOOTER_TAGLINE: "Playable architecture",
+ FOOTER_TAGLINE: "Executable logic, made physical",
GITHUB_LABEL: "GitHub",
OPEN_NAVIGATION_LABEL: "Open navigation",
} as const;
export const MARKETING_NAVIGATION_ITEMS = [
{
- id: MARKETING_NAVIGATION_ITEM_IDS.GUIDE,
- label: "Guide",
- to: MARKETING_ROUTES.GUIDE,
+ id: MARKETING_NAVIGATION_ITEM_IDS.HOW_IT_WORKS,
+ label: "How it works",
+ href: "/#how-it-works",
},
{
- id: MARKETING_NAVIGATION_ITEM_IDS.CONCEPTS,
- label: "Concepts",
- to: MARKETING_ROUTES.CONCEPTS,
+ id: MARKETING_NAVIGATION_ITEM_IDS.FIELD_GUIDE,
+ label: "Field guide",
+ href: "/#machine",
},
] as const;
export const MARKETING_FOOTER_LINKS = [
{
- label: "Guide",
- to: MARKETING_ROUTES.GUIDE,
- type: "internal",
+ label: "How it works",
+ href: "/#how-it-works",
+ type: "anchor",
},
{
- label: "Concepts",
- to: MARKETING_ROUTES.CONCEPTS,
- type: "internal",
+ label: "The machine",
+ href: "/#machine",
+ type: "anchor",
+ },
+ {
+ label: "Controls",
+ href: "/#controls",
+ type: "anchor",
},
{
label: "GitHub",
- to: MARKETING_ROUTES.GITHUB_REPOSITORY,
+ href: MARKETING_ROUTES.GITHUB_REPOSITORY,
type: "external",
},
] as const;
diff --git a/src/widgets/marketing-shell/lib/createMarketingNavigationViewModel.test.ts b/src/widgets/marketing-shell/lib/createMarketingNavigationViewModel.test.ts
index 95668e3f..7377d332 100644
--- a/src/widgets/marketing-shell/lib/createMarketingNavigationViewModel.test.ts
+++ b/src/widgets/marketing-shell/lib/createMarketingNavigationViewModel.test.ts
@@ -10,19 +10,19 @@ import { createMarketingNavigationViewModel } from "./createMarketingNavigationV
describe("createMarketingNavigationViewModel", () => {
it("marks the active navigation item", () => {
const viewModel = createMarketingNavigationViewModel({
- activeNavigationItemId: MARKETING_NAVIGATION_ITEM_IDS.CONCEPTS,
+ activeNavigationItemId: MARKETING_NAVIGATION_ITEM_IDS.FIELD_GUIDE,
footerLinks: MARKETING_FOOTER_LINKS,
navigationItems: MARKETING_NAVIGATION_ITEMS,
});
expect(
viewModel.navigationItems.find(
- (item) => item.id === MARKETING_NAVIGATION_ITEM_IDS.CONCEPTS,
+ (item) => item.id === MARKETING_NAVIGATION_ITEM_IDS.FIELD_GUIDE,
)?.isActive,
).toBe(true);
expect(
viewModel.navigationItems.find(
- (item) => item.id === MARKETING_NAVIGATION_ITEM_IDS.GUIDE,
+ (item) => item.id === MARKETING_NAVIGATION_ITEM_IDS.HOW_IT_WORKS,
)?.isActive,
).toBe(false);
});
diff --git a/src/widgets/marketing-shell/lib/resolveMarketingNavigationItemId.test.ts b/src/widgets/marketing-shell/lib/resolveMarketingNavigationItemId.test.ts
index e86444ba..edc55ed1 100644
--- a/src/widgets/marketing-shell/lib/resolveMarketingNavigationItemId.test.ts
+++ b/src/widgets/marketing-shell/lib/resolveMarketingNavigationItemId.test.ts
@@ -7,13 +7,13 @@ import { resolveMarketingNavigationItemId } from "./resolveMarketingNavigationIt
describe("resolveMarketingNavigationItemId", () => {
it("resolves the guide navigation item for the tutorial route", () => {
expect(resolveMarketingNavigationItemId(MARKETING_ROUTES.GUIDE)).toBe(
- MARKETING_NAVIGATION_ITEM_IDS.GUIDE,
+ MARKETING_NAVIGATION_ITEM_IDS.FIELD_GUIDE,
);
});
it("resolves the concepts navigation item for the concepts route", () => {
expect(resolveMarketingNavigationItemId(MARKETING_ROUTES.CONCEPTS)).toBe(
- MARKETING_NAVIGATION_ITEM_IDS.CONCEPTS,
+ MARKETING_NAVIGATION_ITEM_IDS.FIELD_GUIDE,
);
});
diff --git a/src/widgets/marketing-shell/lib/resolveMarketingNavigationItemId.ts b/src/widgets/marketing-shell/lib/resolveMarketingNavigationItemId.ts
index 240a35e5..757caca8 100644
--- a/src/widgets/marketing-shell/lib/resolveMarketingNavigationItemId.ts
+++ b/src/widgets/marketing-shell/lib/resolveMarketingNavigationItemId.ts
@@ -9,9 +9,9 @@ export const resolveMarketingNavigationItemId = (
): MarketingNavigationItemId | null => {
switch (pathname) {
case MARKETING_ROUTES.GUIDE:
- return MARKETING_NAVIGATION_ITEM_IDS.GUIDE;
+ return MARKETING_NAVIGATION_ITEM_IDS.FIELD_GUIDE;
case MARKETING_ROUTES.CONCEPTS:
- return MARKETING_NAVIGATION_ITEM_IDS.CONCEPTS;
+ return MARKETING_NAVIGATION_ITEM_IDS.FIELD_GUIDE;
default:
return null;
}
diff --git a/src/widgets/marketing-shell/model/index.ts b/src/widgets/marketing-shell/model/index.ts
index d165d811..7812a6ef 100644
--- a/src/widgets/marketing-shell/model/index.ts
+++ b/src/widgets/marketing-shell/model/index.ts
@@ -1,3 +1,4 @@
export { useMarketingLayoutRoute } from "./useMarketingLayoutRoute";
export { useMarketingNavigation } from "./useMarketingNavigation";
+export { useMarketingNavigationSheet } from "./useMarketingNavigationSheet";
export { useRunestoneLogo } from "./useRunestoneLogo";
diff --git a/src/widgets/marketing-shell/model/useMarketingLayoutRoute.test.tsx b/src/widgets/marketing-shell/model/useMarketingLayoutRoute.test.tsx
index 42c89aaa..d55362f3 100644
--- a/src/widgets/marketing-shell/model/useMarketingLayoutRoute.test.tsx
+++ b/src/widgets/marketing-shell/model/useMarketingLayoutRoute.test.tsx
@@ -1,12 +1,11 @@
// @vitest-environment happy-dom
-import { renderHook } from "@testing-library/react";
-import { describe, expect, it, vi } from "vitest";
+import { cleanup, renderHook } from "@testing-library/react";
+import { afterEach, describe, expect, it, vi } from "vitest";
import { AUTH_STATUS } from "@/features/auth";
const mockUseAuthContext = vi.hoisted(() => vi.fn());
-const mockNavigate = vi.hoisted(() => vi.fn());
const mockUseLocation = vi.hoisted(() => vi.fn());
vi.mock("@/features/auth", async () => {
@@ -21,9 +20,6 @@ vi.mock("@/features/auth", async () => {
vi.mock("@tanstack/react-router", () => ({
useLocation: mockUseLocation,
- useRouter: () => ({
- navigate: mockNavigate,
- }),
}));
import { MARKETING_NAVIGATION_ITEM_IDS, MARKETING_ROUTES } from "../config";
@@ -45,6 +41,11 @@ const createAuthContext = () => ({
authStatus: AUTH_STATUS.REQUIRES_USERNAME,
});
+afterEach(() => {
+ cleanup();
+ document.body.replaceChildren();
+});
+
describe("useMarketingLayoutRoute", () => {
it("resolves the active navigation item and keeps the modal flow routed through the hook", () => {
const authContext = createAuthContext();
@@ -55,7 +56,7 @@ describe("useMarketingLayoutRoute", () => {
const { result } = renderHook(() => useMarketingLayoutRoute());
expect(result.current.shellProps.activeNavigationItemId).toBe(
- MARKETING_NAVIGATION_ITEM_IDS.CONCEPTS,
+ MARKETING_NAVIGATION_ITEM_IDS.FIELD_GUIDE,
);
expect(result.current.shellProps.isAuthenticated).toBe(false);
expect(result.current.shellProps.onEntryRequest).toBe(
@@ -70,11 +71,24 @@ describe("useMarketingLayoutRoute", () => {
authContext.handleUsernameFormSubmit,
);
+ const hiddenEntryTrigger = document.createElement("button");
+ hiddenEntryTrigger.dataset.entryTrigger = "true";
+ hiddenEntryTrigger.getClientRects = () => [] as unknown as DOMRectList;
+ const visibleEntryTrigger = document.createElement("button");
+ visibleEntryTrigger.dataset.entryTrigger = "true";
+ visibleEntryTrigger.getClientRects = () => [{}] as unknown as DOMRectList;
+ document.body.append(hiddenEntryTrigger, visibleEntryTrigger);
+ const closeEvent = new Event("close", { cancelable: true });
+
+ result.current.usernameModalProps.onCloseAutoFocus(closeEvent);
+
+ expect(closeEvent.defaultPrevented).toBe(true);
+ expect(document.activeElement).toBe(visibleEntryTrigger);
+
result.current.shellProps.onEntryRequest();
result.current.usernameModalProps.onKeepReading();
expect(authContext.handleUsernameEntryRequest).toHaveBeenCalledOnce();
expect(authContext.handleUsernameEntryDismiss).toHaveBeenCalledOnce();
- expect(mockNavigate).toHaveBeenCalledWith({ to: MARKETING_ROUTES.HOME });
});
});
diff --git a/src/widgets/marketing-shell/model/useMarketingLayoutRoute.ts b/src/widgets/marketing-shell/model/useMarketingLayoutRoute.ts
index 0276f860..49f76230 100644
--- a/src/widgets/marketing-shell/model/useMarketingLayoutRoute.ts
+++ b/src/widgets/marketing-shell/model/useMarketingLayoutRoute.ts
@@ -1,8 +1,8 @@
-import { useLocation, useRouter } from "@tanstack/react-router";
+import { useLocation } from "@tanstack/react-router";
import { type UsernameFormInput, useAuthContext } from "@/features/auth";
-import { MARKETING_ROUTES, type MarketingNavigationItemId } from "../config";
+import type { MarketingNavigationItemId } from "../config";
import { resolveMarketingNavigationItemId } from "../lib";
type MarketingLayoutRouteViewModel = {
@@ -16,6 +16,7 @@ type MarketingLayoutRouteViewModel = {
isOpen: boolean;
isSubmitting: boolean;
suggestedUsername: string;
+ onCloseAutoFocus: (event: Event) => void;
onKeepReading: () => void;
onSubmit: (input: UsernameFormInput) => Promise;
};
@@ -33,7 +34,6 @@ export const useMarketingLayoutRoute = (): MarketingLayoutRouteViewModel => {
suggestedUsername,
} = useAuthContext();
const { pathname } = useLocation();
- const router = useRouter();
const activeNavigationItemId = resolveMarketingNavigationItemId(pathname);
return {
@@ -47,9 +47,19 @@ export const useMarketingLayoutRoute = (): MarketingLayoutRouteViewModel => {
isOpen: isUsernameModalOpen,
isSubmitting: isUsernameSubmitting,
suggestedUsername,
+ onCloseAutoFocus: (event) => {
+ event.preventDefault();
+ const entryTriggers = document.querySelectorAll(
+ "[data-entry-trigger]",
+ );
+ const visibleEntryTrigger = Array.from(entryTriggers).find(
+ (entryTrigger) => entryTrigger.getClientRects().length > 0,
+ );
+
+ (visibleEntryTrigger ?? entryTriggers.item(0))?.focus();
+ },
onKeepReading: () => {
handleUsernameEntryDismiss();
- void router.navigate({ to: MARKETING_ROUTES.HOME });
},
onSubmit: handleUsernameFormSubmit,
},
diff --git a/src/widgets/marketing-shell/model/useMarketingNavigationSheet.test.tsx b/src/widgets/marketing-shell/model/useMarketingNavigationSheet.test.tsx
new file mode 100644
index 00000000..8ceb1fb9
--- /dev/null
+++ b/src/widgets/marketing-shell/model/useMarketingNavigationSheet.test.tsx
@@ -0,0 +1,36 @@
+// @vitest-environment happy-dom
+
+import { act, renderHook } from "@testing-library/react";
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+
+import { useMarketingNavigationSheet } from "./useMarketingNavigationSheet";
+
+describe("useMarketingNavigationSheet", () => {
+ beforeEach(() => {
+ vi.useFakeTimers();
+ });
+
+ afterEach(() => {
+ vi.useRealTimers();
+ document.body.replaceChildren();
+ });
+
+ it("scrolls to the selected anchor after the sheet releases scroll lock", () => {
+ const target = document.createElement("section");
+ target.id = "machine";
+ target.scrollIntoView = vi.fn();
+ document.body.append(target);
+ const anchor = document.createElement("a");
+ anchor.href = "/#machine";
+ const { result } = renderHook(() => useMarketingNavigationSheet());
+
+ act(() => {
+ result.current.handleAnchorNavigation({
+ currentTarget: anchor,
+ } as React.MouseEvent);
+ vi.runAllTimers();
+ });
+
+ expect(target.scrollIntoView).toHaveBeenCalledOnce();
+ });
+});
diff --git a/src/widgets/marketing-shell/model/useMarketingNavigationSheet.ts b/src/widgets/marketing-shell/model/useMarketingNavigationSheet.ts
new file mode 100644
index 00000000..c92771c0
--- /dev/null
+++ b/src/widgets/marketing-shell/model/useMarketingNavigationSheet.ts
@@ -0,0 +1,16 @@
+import type { MouseEvent } from "react";
+
+type MarketingNavigationSheetViewModel = {
+ handleAnchorNavigation: (event: MouseEvent) => void;
+};
+
+export const useMarketingNavigationSheet =
+ (): MarketingNavigationSheetViewModel => ({
+ handleAnchorNavigation: (event) => {
+ const targetId = event.currentTarget.hash.slice(1);
+
+ window.setTimeout(() => {
+ document.getElementById(targetId)?.scrollIntoView();
+ }, 0);
+ },
+ });
diff --git a/src/widgets/marketing-shell/ui/MarketingFooter.tsx b/src/widgets/marketing-shell/ui/MarketingFooter.tsx
index f6942e23..7d6c7cb6 100644
--- a/src/widgets/marketing-shell/ui/MarketingFooter.tsx
+++ b/src/widgets/marketing-shell/ui/MarketingFooter.tsx
@@ -15,22 +15,22 @@ type MarketingFooterProps = {
export function MarketingFooter({ viewModel }: MarketingFooterProps) {
return (
-