Skip to content

Commit 22acb58

Browse files
committed
Remove upcoming features in hero page
1 parent 94fdf56 commit 22acb58

4 files changed

Lines changed: 64 additions & 53 deletions

File tree

PLANS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Implementation is intentionally deferred. Keep every item unchecked until the co
6969

7070
- [x] Welcome users and link the available tracker features.
7171
- [x] Show linked counts for owned characters, owned monsterlings, cleared codex entries, and loadouts.
72-
- [x] Preview planned Checklist, Artifact, Equipment, and complete Loadout features.
72+
- [x] Hide the optional roadmap section when no upcoming features are configured.
7373

7474
## SEO: Available
7575

src/components/home/home-feature-sections.tsx

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -67,41 +67,43 @@ export const HomeFeatureSections = ({
6767
</div>
6868
</section>
6969

70-
<section aria-labelledby="upcoming-heading">
71-
<div className="mb-4 flex items-end justify-between gap-4">
72-
<div>
73-
<h2
74-
id="upcoming-heading"
75-
className="text-2xl font-semibold tracking-tight"
76-
>
77-
Coming next
78-
</h2>
79-
<p className="mt-1 text-sm text-muted-foreground">
80-
More ways to plan and track your account are on the roadmap.
81-
</p>
70+
{upcomingFeatures.length > 0 && (
71+
<section aria-labelledby="upcoming-heading">
72+
<div className="mb-4 flex items-end justify-between gap-4">
73+
<div>
74+
<h2
75+
id="upcoming-heading"
76+
className="text-2xl font-semibold tracking-tight"
77+
>
78+
Coming next
79+
</h2>
80+
<p className="mt-1 text-sm text-muted-foreground">
81+
More ways to plan and track your account are on the roadmap.
82+
</p>
83+
</div>
84+
<span className="hidden rounded-full border px-3 py-1 text-xs font-medium text-muted-foreground sm:inline-flex">
85+
Planned
86+
</span>
8287
</div>
83-
<span className="hidden rounded-full border px-3 py-1 text-xs font-medium text-muted-foreground sm:inline-flex">
84-
Planned
85-
</span>
86-
</div>
87-
<div className="grid gap-3 sm:grid-cols-2">
88-
{upcomingFeatures.map(({ title, description, icon: Icon }) => (
89-
<Card
90-
key={title}
91-
className="gap-3 border-dashed bg-muted/20 py-4 shadow-none"
92-
>
93-
<CardHeader className="grid-cols-[auto_1fr] items-center gap-x-3 px-4">
94-
<span className="row-span-2 rounded-lg border bg-background p-2 text-muted-foreground">
95-
<Icon className="size-4" aria-hidden="true" />
96-
</span>
97-
<CardTitle className="text-sm">{title}</CardTitle>
98-
<CardDescription className="col-start-2 leading-5">
99-
{description}
100-
</CardDescription>
101-
</CardHeader>
102-
</Card>
103-
))}
104-
</div>
105-
</section>
88+
<div className="grid gap-3 sm:grid-cols-2">
89+
{upcomingFeatures.map(({ title, description, icon: Icon }) => (
90+
<Card
91+
key={title}
92+
className="gap-3 border-dashed bg-muted/20 py-4 shadow-none"
93+
>
94+
<CardHeader className="grid-cols-[auto_1fr] items-center gap-x-3 px-4">
95+
<span className="row-span-2 rounded-lg border bg-background p-2 text-muted-foreground">
96+
<Icon className="size-4" aria-hidden="true" />
97+
</span>
98+
<CardTitle className="text-sm">{title}</CardTitle>
99+
<CardDescription className="col-start-2 leading-5">
100+
{description}
101+
</CardDescription>
102+
</CardHeader>
103+
</Card>
104+
))}
105+
</div>
106+
</section>
107+
)}
106108
</>
107109
);

src/components/home/home-page.test.tsx

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// @vitest-environment jsdom
22
import { cleanup, fireEvent, render, screen } from "@testing-library/react";
3+
import { ShieldCheck } from "lucide-react";
34
import type { ComponentProps } from "react";
45
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
6+
import { HomeFeatureSections } from "@/components/home/home-feature-sections";
57
import { HomePage } from "@/components/home/home-page";
68
import {
79
initialCodexFilters,
@@ -93,12 +95,34 @@ describe("HomePage", () => {
9395
expect(screen.getAllByText("—")).toHaveLength(6);
9496
});
9597

96-
it("presents upcoming features without linking to unfinished pages", () => {
98+
it("hides the roadmap when no upcoming features are configured", () => {
9799
render(<HomePage />);
98100

99-
expect(screen.getByText("Equipment")).toBeTruthy();
101+
expect(screen.queryByRole("heading", { name: "Coming next" })).toBeNull();
102+
expect(screen.queryByText("Equipment")).toBeNull();
100103
expect(
101104
screen.getByRole("link", { name: "Explore Checklist" }),
102105
).toBeTruthy();
106+
expect(
107+
screen.getByRole("link", { name: "Explore Artifacts" }),
108+
).toBeTruthy();
109+
});
110+
111+
it("shows the roadmap when upcoming features are configured", () => {
112+
render(
113+
<HomeFeatureSections
114+
features={[]}
115+
upcomingFeatures={[
116+
{
117+
title: "Equipment",
118+
description: "Manage equipment across slots and categories.",
119+
icon: ShieldCheck,
120+
},
121+
]}
122+
/>,
123+
);
124+
125+
expect(screen.getByRole("heading", { name: "Coming next" })).toBeTruthy();
126+
expect(screen.getByText("Equipment")).toBeTruthy();
103127
});
104128
});

src/components/home/home-page.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ import {
55
Camera,
66
Gem,
77
PawPrint,
8-
ShieldCheck,
98
UserRoundCheck,
109
} from "lucide-react";
1110
import {
1211
type HomeFeature,
1312
HomeFeatureSections,
14-
type UpcomingFeature,
1513
} from "@/components/home/home-feature-sections";
1614
import { HomeHero } from "@/components/home/home-hero";
1715
import {
@@ -79,19 +77,6 @@ const features: HomeFeature[] = [
7977
},
8078
];
8179

82-
const upcomingFeatures: UpcomingFeature[] = [
83-
{
84-
title: "Equipment",
85-
description: "Manage equipment across slots and categories.",
86-
icon: ShieldCheck,
87-
},
88-
{
89-
title: "Complete Loadouts",
90-
description: "Assign artifacts and equipment to each loadout character.",
91-
icon: Blocks,
92-
},
93-
];
94-
9580
export const HomePage = () => {
9681
const charactersOwned = useAppStore((state) => state.charactersOwned);
9782
const monsterlingsOwned = useAppStore((state) => state.monsterlingsOwned);

0 commit comments

Comments
 (0)