Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

feat(site): sync product preview with home, inbox and my tasks

Tin30ba82531a0d
diff --git a/apps/site/components/landing/app-preview/activity-feed.tsx b/apps/site/components/landing/app-preview/activity-feed.tsx
new file mode 100644
index 000000000..710d2ba60
--- /dev/null
+++ b/apps/site/components/landing/app-preview/activity-feed.tsx
@@ -0,0 +1,71 @@
+import { Avatar, AvatarFallback } from "@/components/ui/avatar";
+import messages from "../../../../../i18n/en-US.json";
+import type { AssignedTask } from "./assigned-tasks";
+import type { PreviewActivity } from "./mock-activity";
+import { formatRelativeTime } from "./relative-time";
+import { SectionHeader } from "./section-header";
+
+// Same entries as apps/web's home/activity-feed.
+export function ActivityFeed({
+ activities,
+ tasks,
+ onTaskClick,
+}: {
+ activities: PreviewActivity[];
+ tasks: Map<string, AssignedTask>;
+ onTaskClick: (task: AssignedTask) => void;
+}) {
+ return (
+ <section>
+ <SectionHeader title={messages.workspace.home.activity.title} />
+ <ul className="flex flex-col gap-4 pt-4">
+ {activities.map((activity) => {
+ const task = tasks.get(activity.taskId);
+ if (!task) return null;
+
+ return (
+ <li key={activity.id} className="flex gap-2.5">
+ <Avatar className="size-6 shrink-0">
+ <AvatarFallback className="border border-border/30 text-[10px] font-medium">
+ {activity.actorName
+ .split(" ")
+ .map((name) => name[0])
+ .join("")}
+ </AvatarFallback>
+ </Avatar>
+ <div className="flex min-w-0 flex-1 flex-col gap-1">
+ <p className="text-[13px] leading-[18px] text-muted-foreground">
+ <span className="font-medium text-foreground">
+ {activity.actorName}
+ </span>{" "}
+ {activity.action}
+ </p>
+ {activity.comment && (
+ <p className="line-clamp-3 rounded-lg bg-muted/70 px-2.5 py-2 text-[13px] leading-[18px] text-foreground/85">
+ {activity.comment}
+ </p>
+ )}
+ <p className="flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground">
+ <button
+ type="button"
+ onClick={() => onTaskClick(task)}
+ className="min-w-0 truncate text-left hover:text-foreground"
+ >
+ <span className="font-medium">
+ {task.projectSlug}-{task.number}
+ </span>{" "}
+ {task.title}
+ </button>
+ <span aria-hidden="true">·</span>
+ <time dateTime={activity.createdAt} className="shrink-0">
+ {formatRelativeTime(activity.createdAt)}
+ </time>
+ </p>
+ </div>
+ </li>
+ );
+ })}
+ </ul>
+ </section>
+ );
+}
diff --git a/apps/site/components/landing/app-preview/assigned-task-row.tsx b/apps/site/components/landing/app-preview/assigned-task-row.tsx
new file mode 100644
index 000000000..5755046b6
--- /dev/null
+++ b/apps/site/components/landing/app-preview/assigned-task-row.tsx
@@ -0,0 +1,61 @@
+import { getColumnIcon } from "@/lib/column";
+import { getPriorityIcon } from "@/lib/priority";
+import type { AssignedTask } from "./assigned-tasks";
+import { DueDateText } from "./due-date-text";
+import { resolveLabelColor } from "./label-color";
+
+// Same row as apps/web's my-work/assigned-task-row.
+export function AssignedTaskRow({
+ task,
+ showLabels = false,
+ onTaskClick,
+}: {
+ task: AssignedTask;
+ showLabels?: boolean;
+ onTaskClick: (task: AssignedTask) => void;
+}) {
+ return (
+ <button
+ type="button"
+ onClick={() => onTaskClick(task)}
+ className="flex h-11 w-full items-center gap-3 border-b border-border/50 px-1 text-left outline-none transition-colors hover:bg-accent/50 focus-visible:bg-accent/50"
+ >
+ <span className="flex w-4 shrink-0 justify-center [&_svg]:size-3.5">
+ {getPriorityIcon(task.priority ?? "")}
+ </span>
+ <span className="shrink-0" title={task.statusName}>
+ {getColumnIcon(task.status)}
+ </span>
+ <span className="w-16 shrink-0 truncate text-xs font-medium text-muted-foreground">
+ {task.projectSlug}-{task.number}
+ </span>
+ <span className="min-w-0 flex-1 truncate text-sm text-foreground">
+ {task.title}
+ </span>
+ {showLabels && !!task.labels?.length && (
+ <span className="flex w-44 shrink-0 items-center gap-2.5 overflow-hidden">
+ {task.labels.slice(0, 2).map((label) => (
+ <span
+ key={label.id}
+ className="flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground"
+ >
+ <span
+ aria-hidden="true"
+ className="size-1.5 shrink-0 rounded-full"
+ style={{ backgroundColor: resolveLabelColor(label.color) }}
+ />
+ <span className="truncate">{label.name}</span>
+ </span>
+ ))}
+ </span>
+ )}
+ <span className="w-28 shrink-0 truncate text-xs text-muted-foreground">
+ {task.projectName}
+ </span>
+ <DueDateText
+ dueDate={task.dueDate}
+ className="w-20 shrink-0 text-right"
+ />
+ </button>
+ );
+}
diff --git a/apps/site/components/landing/app-preview/assigned-tasks.ts b/apps/site/components/landing/app-preview/assigned-tasks.ts
new file mode 100644
index 000000000..376bcb1a0
--- /dev/null
+++ b/apps/site/components/landing/app-preview/assigned-tasks.ts
@@ -0,0 +1,77 @@
+import type { ProjectWithTasks } from "@/types/project";
+import type { TaskWithExtras } from "./mock-data";
+
+export type AssignedTask = TaskWithExtras & {
+ projectName: string;
+ projectSlug: string;
+ statusName: string;
+};
+
+const PRIORITY_RANK: Record<string, number> = {
+ urgent: 4,
+ high: 3,
+ medium: 2,
+ low: 1,
+};
+
+// Every task with the project context the workspace pages show beside it.
+export function indexTasks(projects: ProjectWithTasks[]) {
+ return new Map(
+ projects.flatMap((project) =>
+ project.columns.flatMap((column) =>
+ column.tasks.map((task): [string, AssignedTask] => [
+ task.id,
+ {
+ ...task,
+ projectName: project.name,
+ projectSlug: project.slug,
+ statusName: column.name,
+ },
+ ]),
+ ),
+ ),
+ );
+}
+
+// Mirrors GET /task/assigned: open tasks only, soonest due first.
+export function getAssignedTasks(
+ projects: ProjectWithTasks[],
+ userId: string,
+): AssignedTask[] {
+ const finalStatuses = new Set(
+ projects.flatMap((project) =>
+ project.columns
+ .filter((column) => column.isFinal)
+ .map((column) => `${project.id}:${column.id}`),
+ ),
+ );
+
+ return [...indexTasks(projects).values()]
+ .filter(
+ (task) =>
+ task.userId === userId &&
+ !finalStatuses.has(`${task.projectId}:${task.status}`),
+ )
+ .sort((left, right) => {
+ const leftDue = left.dueDate ? new Date(left.dueDate).getTime() : null;
+ const rightDue = right.dueDate ? new Date(right.dueDate).getTime() : null;
+ if (leftDue !== rightDue) {
+ if (leftDue === null) return 1;
+ if (rightDue === null) return -1;
+ return leftDue - rightDue;
+ }
+ return (
+ (PRIORITY_RANK[right.priority ?? ""] ?? 0) -
+ (PRIORITY_RANK[left.priority ?? ""] ?? 0)
+ );
+ });
+}
+
+export function getCompletionPercentage(project: ProjectWithTasks) {
+ const tasks = project.columns.flatMap((column) => column.tasks);
+ if (tasks.length === 0) return 0;
+ const done = project.columns
+ .filter((column) => column.isFinal)
+ .reduce((sum, column) => sum + column.tasks.length, 0);
+ return Math.round((done / tasks.length) * 100);
+}
diff --git a/apps/site/components/landing/app-preview/board-view.tsx b/apps/site/components/landing/app-preview/board-view.tsx
index 9796b5af7..b95102276 100644
--- a/apps/site/components/landing/app-preview/board-view.tsx
+++ b/apps/site/components/landing/app-preview/board-view.tsx
@@ -5,6 +5,7 @@ import { DEFAULT_COLUMNS } from "@/constants/columns";
import { getColumnIcon } from "@/lib/column";
import type { ProjectWithTasks } from "@/types/project";
import type Task from "@/types/task";
+import messages from "../../../../../i18n/en-US.json";
import type { PreviewTaskDetails } from "./mock-data";
import { PreviewTaskCard } from "./task-card";
@@ -58,28 +59,29 @@ export function PreviewBoard({
</div>
{/* Task list */}
- <div className="min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-2 py-2 flex flex-col gap-1.5">
- {column.tasks.map((task: Task) => (
- <PreviewTaskCard
- key={task.id}
- task={task}
- details={details[task.id]}
- projectSlug={project.slug}
- isCompleted={column.isFinal}
- onTaskClick={onTaskClick}
- />
- ))}
- </div>
-
- {/* Add task footer, revealed on column hover */}
- <div className="shrink-0 border-t border-border/60 p-1.5 md:opacity-0 md:group-hover:opacity-100 transition-opacity duration-150">
- <button
- type="button"
- className="flex w-full items-center gap-1.5 rounded-md px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground"
- >
- <Plus className="h-3.5 w-3.5" />
- Add task
- </button>
+ <div className="min-h-0 flex-1 overflow-y-auto overflow-x-hidden p-2">
+ <div className="flex flex-col gap-2">
+ {column.tasks.map((task: Task) => (
+ <PreviewTaskCard
+ key={task.id}
+ task={task}
+ details={details[task.id]}
+ projectSlug={project.slug}
+ isCompleted={column.isFinal}
+ onTaskClick={onTaskClick}
+ />
+ ))}
+ </div>
+ {/* New work starts in an open column; finished ones only collect. */}
+ {!column.isFinal && (
+ <button
+ type="button"
+ className="mt-1 flex h-9 w-full cursor-pointer items-center gap-2 rounded-lg px-3 text-[13px] text-muted-foreground outline-none transition-colors hover:bg-accent/50 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ <Plus aria-hidden="true" className="size-3.5" />
+ {messages.tasks.kanban.addTask}
+ </button>
+ )}
</div>
</div>
</div>
diff --git a/apps/site/components/landing/app-preview/build-week.ts b/apps/site/components/landing/app-preview/build-week.ts
new file mode 100644
index 000000000..fa162045f
--- /dev/null
+++ b/apps/site/components/landing/app-preview/build-week.ts
@@ -0,0 +1,28 @@
+import { addDays, isSameDay, startOfDay } from "date-fns";
+import type { AssignedTask } from "./assigned-tasks";
+
+export type WeekDay = {
+ date: Date;
+ isToday: boolean;
+ isPast: boolean;
+ tasks: AssignedTask[];
+};
+
+// Centred on today, like apps/web's home/build-week.
+export function buildWeek(tasks: AssignedTask[], now = new Date()): WeekDay[] {
+ const today = startOfDay(now);
+
+ return Array.from({ length: 7 }, (_, index) => {
+ const offset = index - 3;
+ const date = addDays(today, offset);
+
+ return {
+ date,
+ isToday: offset === 0,
+ isPast: offset < 0,
+ tasks: tasks.filter(
+ (task) => task.dueDate && isSameDay(new Date(task.dueDate), date),
+ ),
+ };
+ });
+}
diff --git a/apps/site/components/landing/app-preview/due-date-text.tsx b/apps/site/components/landing/app-preview/due-date-text.tsx
new file mode 100644
index 000000000..a5a2bf721
--- /dev/null
+++ b/apps/site/components/landing/app-preview/due-date-text.tsx
@@ -0,0 +1,42 @@
+import { differenceInCalendarDays, format } from "date-fns";
+import { cn } from "@/lib/utils";
+import messages from "../../../../../i18n/en-US.json";
+
+const due = messages.workspace.myWork.due;
+
+// Same wording as apps/web's my-work/due-date-text.
+export function DueDateText({
+ dueDate,
+ className,
+}: {
+ dueDate: string | null;
+ className?: string;
+}) {
+ if (!dueDate) return null;
+
+ const days = differenceInCalendarDays(new Date(dueDate), new Date());
+ const text =
+ days === 0
+ ? due.today
+ : days === 1
+ ? due.tomorrow
+ : days > 1 && days <= 6
+ ? format(new Date(dueDate), "EEEE")
+ : format(new Date(dueDate), "MMM d");
+
+ return (
+ <span
+ className={cn(
+ "text-xs tabular-nums",
+ days < 0
+ ? "font-medium text-destructive-foreground"
+ : days === 0
+ ? "font-medium text-foreground"
+ : "text-muted-foreground",
+ className,
+ )}
+ >
+ {text}
+ </span>
+ );
+}
diff --git a/apps/site/components/landing/app-preview/fill-message.ts b/apps/site/components/landing/app-preview/fill-message.ts
new file mode 100644
index 000000000..ea8726f84
--- /dev/null
+++ b/apps/site/components/landing/app-preview/fill-message.ts
@@ -0,0 +1,16 @@
+// Fills i18next-style {{placeholders}}, so the preview reuses the app's copy.
+export function fillMessage(
+ template: string,
+ values: Record<string, string | number>,
+) {
+ return template.replace(/\{\{(\w+)\}\}/g, (match, key: string) =>
+ key in values ? String(values[key]) : match,
+ );
+}
+
+export function pluralMessage(
+ messages: { one: string; other: string },
+ count: number,
+) {
+ return fillMessage(count === 1 ? messages.one : messages.other, { count });
+}
diff --git a/apps/site/components/landing/app-preview/group-assigned-tasks.ts b/apps/site/components/landing/app-preview/group-assigned-tasks.ts
new file mode 100644
index 000000000..c7a5a30fd
--- /dev/null
+++ b/apps/site/components/landing/app-preview/group-assigned-tasks.ts
@@ -0,0 +1,52 @@
+import { differenceInCalendarDays } from "date-fns";
+import type { AssignedTask } from "./assigned-tasks";
+
+export const DUE_BUCKETS = [
+ "overdue",
+ "today",
+ "thisWeek",
+ "later",
+ "noDueDate",
+] as const;
+
+export type DueBucket = (typeof DUE_BUCKETS)[number];
+
+export type AssignedTaskGroup = {
+ id: string;
+ bucket?: DueBucket;
+ title?: string;
+ tasks: AssignedTask[];
+};
+
+export function getDueBucket(
+ dueDate: string | null,
+ now = new Date(),
+): DueBucket {
+ if (!dueDate) return "noDueDate";
+ const days = differenceInCalendarDays(new Date(dueDate), now);
+ if (days < 0) return "overdue";
+ if (days === 0) return "today";
+ if (days <= 7) return "thisWeek";
+ return "later";
+}
+
+export function groupByDueDate(tasks: AssignedTask[]): AssignedTaskGroup[] {
+ return DUE_BUCKETS.flatMap((bucket) => {
+ const group = tasks.filter((task) => getDueBucket(task.dueDate) === bucket);
+ return group.length ? [{ id: bucket, bucket, tasks: group }] : [];
+ });
+}
+
+export function groupByProject(tasks: AssignedTask[]): AssignedTaskGroup[] {
+ const groups = new Map<string, AssignedTaskGroup>();
+ for (const task of tasks) {
+ const group = groups.get(task.projectId) ?? {
+ id: task.projectId,
+ title: task.projectName,
+ tasks: [],
+ };
+ group.tasks.push(task);
+ groups.set(task.projectId, group);
+ }
+ return [...groups.values()];
+}
diff --git a/apps/site/components/landing/app-preview/home-projects.tsx b/apps/site/components/landing/app-preview/home-projects.tsx
new file mode 100644
index 000000000..136ce7a2f
--- /dev/null
+++ b/apps/site/components/landing/app-preview/home-projects.tsx
@@ -0,0 +1,73 @@
+import type { ProjectWithTasks } from "@/types/project";
+import messages from "../../../../../i18n/en-US.json";
+import { getCompletionPercentage } from "./assigned-tasks";
+import { pluralMessage } from "./fill-message";
+import { getProjectIcon } from "./project-icon";
+import { SectionHeader } from "./section-header";
+
+const copy = messages.workspace.home.projects;
+
+export function HomeProjects({
+ projects,
+ onProjectSelect,
+}: {
+ projects: ProjectWithTasks[];
+ onProjectSelect: (id: string) => void;
+}) {
+ return (
+ <section className="flex flex-col gap-3">
+ <SectionHeader
+ title={copy.title}
+ action={
+ <span className="shrink-0 text-[13px] font-medium text-muted-foreground">
+ {copy.all}
+ </span>
+ }
+ />
+ <div className="grid grid-cols-3 gap-3">
+ {projects.slice(0, 3).map((project) => {
+ const ProjectIcon = getProjectIcon(project.icon);
+ const completion = getCompletionPercentage(project);
+ const totalTasks = project.columns.reduce(
+ (sum, column) => sum + column.tasks.length,
+ 0,
+ );
+
+ return (
+ <button
+ key={project.id}
+ type="button"
+ onClick={() => onProjectSelect(project.id)}
+ className="flex flex-col gap-3.5 rounded-lg border border-border p-3.5 text-left outline-none transition-colors hover:bg-accent/40 focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ <div className="flex w-full items-center gap-2">
+ <ProjectIcon
+ aria-hidden="true"
+ className="size-4 shrink-0 text-muted-foreground"
+ />
+ <span className="min-w-0 flex-1 truncate text-sm font-medium text-foreground">
+ {project.name}
+ </span>
+ <span className="text-xs tabular-nums text-muted-foreground">
+ {completion}%
+ </span>
+ </div>
+ <div className="h-1 w-full overflow-hidden rounded-full bg-muted">
+ <div
+ className="h-full rounded-full bg-foreground/80"
+ style={{ width: `${completion}%` }}
+ />
+ </div>
+ <span className="text-xs text-muted-foreground">
+ {pluralMessage(
+ { one: copy.tasks_one, other: copy.tasks_other },
+ totalTasks,
+ )}
+ </span>
+ </button>
+ );
+ })}
+ </div>
+ </section>
+ );
+}
diff --git a/apps/site/components/landing/app-preview/home-view.tsx b/apps/site/components/landing/app-preview/home-view.tsx
new file mode 100644
index 000000000..d49e61531
--- /dev/null
+++ b/apps/site/components/landing/app-preview/home-view.tsx
@@ -0,0 +1,110 @@
+import { format } from "date-fns";
+import { Plus } from "lucide-react";
+import { Button } from "@/components/ui/button";
+import type { ProjectWithTasks } from "@/types/project";
+import messages from "../../../../../i18n/en-US.json";
+import { ActivityFeed } from "./activity-feed";
+import { AssignedTaskRow } from "./assigned-task-row";
+import type { AssignedTask } from "./assigned-tasks";
+import { pluralMessage } from "./fill-message";
+import { HomeProjects } from "./home-projects";
+import { MOCK_ACTIVITY } from "./mock-activity";
+import { PreviewPageHeader } from "./page-header";
+import { SectionHeader } from "./section-header";
+import { WeekStrip } from "./week-strip";
+
+const copy = messages.workspace.home;
+
+function greeting(date = new Date()) {
+ const hour = date.getHours();
+ if (hour >= 5 && hour < 12) return copy.greeting.morning;
+ if (hour >= 12 && hour < 18) return copy.greeting.afternoon;
+ return copy.greeting.evening;
+}
+
+// apps/web's workspace Home: the week, what's next, projects and activity.
+export function HomeView({
+ projects,
+ assignedTasks,
+ tasks,
+ onTaskClick,
+ onProjectSelect,
+ onViewAllTasks,
+}: {
+ projects: ProjectWithTasks[];
+ assignedTasks: AssignedTask[];
+ tasks: Map<string, AssignedTask>;
+ onTaskClick: (task: AssignedTask) => void;
+ onProjectSelect: (id: string) => void;
+ onViewAllTasks: () => void;
+}) {
+ return (
+ <>
+ <PreviewPageHeader title={copy.pageTitle} />
+ <div className="min-h-0 flex-1 overflow-y-auto">
+ <div className="mx-auto flex w-full max-w-5xl flex-col gap-9 px-10 py-10">
+ <header className="flex items-end justify-between gap-4">
+ <div className="flex flex-col gap-1.5">
+ <p className="text-[13px] font-medium text-muted-foreground">
+ {format(new Date(), "EEEE, MMMM d")}
+ </p>
+ <h1 className="text-3xl font-semibold tracking-tight text-foreground">
+ {greeting()}
+ </h1>
+ </div>
+ <Button size="sm">
+ <Plus />
+ {copy.newTask}
+ </Button>
+ </header>
+
+ <WeekStrip tasks={assignedTasks} onTaskClick={onTaskClick} />
+
+ <div className="grid grid-cols-[minmax(0,1fr)_20rem] gap-10">
+ <div className="flex min-w-0 flex-col gap-9">
+ <section>
+ <SectionHeader
+ title={copy.upNext.title}
+ detail={pluralMessage(
+ {
+ one: copy.upNext.assigned_one,
+ other: copy.upNext.assigned_other,
+ },
+ assignedTasks.length,
+ )}
+ action={
+ <button
+ type="button"
+ onClick={onViewAllTasks}
+ className="shrink-0 text-[13px] font-medium text-muted-foreground hover:text-foreground"
+ >
+ {copy.upNext.viewAll}
+ </button>
+ }
+ />
+ <div className="flex flex-col">
+ {assignedTasks.slice(0, 5).map((task) => (
+ <AssignedTaskRow
+ key={task.id}
+ task={task}
+ onTaskClick={onTaskClick}
+ />
+ ))}
+ </div>
+ </section>
+ <HomeProjects
+ projects={projects}
+ onProjectSelect={onProjectSelect}
+ />
+ </div>
+ <ActivityFeed
+ activities={MOCK_ACTIVITY}
+ tasks={tasks}
+ onTaskClick={onTaskClick}
+ />
+ </div>
+ </div>
+ </div>
+ </>
+ );
+}
diff --git a/apps/site/components/landing/app-preview/inbox-detail.tsx b/apps/site/components/landing/app-preview/inbox-detail.tsx
new file mode 100644
index 000000000..23ee00894
--- /dev/null
+++ b/apps/site/components/landing/app-preview/inbox-detail.tsx
@@ -0,0 +1,153 @@
+import { ArrowUpRight } from "lucide-react";
+import { Button } from "@/components/ui/button";
+import { getColumnIcon } from "@/lib/column";
+import { getPriorityIcon } from "@/lib/priority";
+import messages from "../../../../../i18n/en-US.json";
+import type { AssignedTask } from "./assigned-tasks";
+import { DueDateText } from "./due-date-text";
+import { MOCK_ACTIVITY } from "./mock-activity";
+import type { PreviewNotification } from "./mock-inbox";
+import { NotificationIcon } from "./notification-icon";
+import { formatRelativeTime } from "./relative-time";
+
+const copy = messages.notifications.inbox;
+
+// apps/web's inbox detail: the notification, then the task it points at.
+export function InboxDetail({
+ notification,
+ task,
+ onOpenTask,
+}: {
+ notification: PreviewNotification;
+ task: AssignedTask | undefined;
+ onOpenTask: (task: AssignedTask) => void;
+}) {
+ const activity = MOCK_ACTIVITY.filter(
+ (entry) => entry.taskId === notification.taskId,
+ );
+
+ return (
+ <div className="flex h-full min-h-0 flex-col">
+ <div className="flex h-12 shrink-0 items-center gap-2 border-b border-border/60 px-8">
+ <time
+ dateTime={notification.createdAt}
+ className="text-xs text-muted-foreground"
+ >
+ {formatRelativeTime(notification.createdAt)}
+ </time>
+ </div>
+
+ <div className="min-h-0 flex-1 overflow-y-auto">
+ <div className="flex w-full max-w-3xl flex-col gap-7 px-8 py-8">
+ <div className="flex gap-2.5 rounded-lg bg-muted/50 px-3 py-2.5">
+ <NotificationIcon type={notification.type} />
+ <div className="flex min-w-0 flex-col gap-0.5">
+ <p className="text-[13px] font-medium text-foreground">
+ {notification.title}
+ </p>
+ <p className="text-[13px] text-muted-foreground">
+ {notification.content}
+ </p>
+ </div>
+ </div>
+
+ {task ? (
+ <div className="flex flex-col gap-7">
+ <div className="flex flex-col gap-3.5">
+ <div className="flex flex-wrap items-start justify-between gap-3">
+ <h2 className="min-w-0 flex-1 text-2xl font-semibold tracking-tight text-foreground">
+ {task.title}
+ </h2>
+ <Button
+ variant="outline"
+ size="xs"
+ onClick={() => onOpenTask(task)}
+ >
+ {copy.openTask}
+ <ArrowUpRight />
+ </Button>
+ </div>
+ <dl className="flex flex-wrap items-center gap-x-5 gap-y-2 text-[13px] text-foreground/85">
+ <div className="flex items-center gap-1.5">
+ <dt className="sr-only">{messages.tasks.status.label}</dt>
+ <dd className="flex items-center gap-1.5">
+ {getColumnIcon(task.status)}
+ {task.statusName}
+ </dd>
+ </div>
+ <div className="flex items-center gap-1.5">
+ <dt className="sr-only">{messages.tasks.priority.label}</dt>
+ <dd className="flex items-center gap-1.5 [&_svg]:size-3.5">
+ {getPriorityIcon(task.priority ?? "")}
+ {
+ messages.tasks.priority[
+ (task.priority ??
+ "no-priority") as keyof typeof messages.tasks.priority
+ ]
+ }
+ </dd>
+ </div>
+ {task.dueDate && (
+ <div className="flex items-center gap-1.5">
+ <dt className="sr-only">
+ {messages.tasks.dueDate.label}
+ </dt>
+ <dd>
+ <DueDateText
+ dueDate={task.dueDate}
+ className="text-[13px]"
+ />
+ </dd>
+ </div>
+ )}
+ {task.assigneeName && (
+ <div className="flex items-center gap-1.5">
+ <dt className="sr-only">
+ {messages.tasks.assignee.label}
+ </dt>
+ <dd>{task.assigneeName}</dd>
+ </div>
+ )}
+ </dl>
+ <p className="text-sm leading-6 text-foreground/85">
+ {task.description}
+ </p>
+ </div>
+
+ {activity.length > 0 && (
+ <div className="flex flex-col gap-3 border-t border-border/60 pt-5">
+ <h3 className="text-xs font-medium text-muted-foreground">
+ {copy.recentActivity}
+ </h3>
+ {activity.map((entry) => (
+ <div key={entry.id} className="flex flex-col gap-1">
+ <p className="text-[13px] text-muted-foreground">
+ <span className="font-medium text-foreground">
+ {entry.actorName}
+ </span>{" "}
+ {entry.action}
+ <span aria-hidden="true"> · </span>
+ <time dateTime={entry.createdAt}>
+ {formatRelativeTime(entry.createdAt)}
+ </time>
+ </p>
+ {entry.comment && (
+ <p className="rounded-lg border border-border/70 px-3 py-2 text-[13px] text-foreground/85">
+ {entry.comment}
+ </p>
+ )}
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+ ) : (
+ <p className="text-sm text-muted-foreground">
+ {copy.taskUnavailable}
+ </p>
+ )}
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/apps/site/components/landing/app-preview/inbox-list-item.tsx b/apps/site/components/landing/app-preview/inbox-list-item.tsx
new file mode 100644
index 000000000..499d22bfb
--- /dev/null
+++ b/apps/site/components/landing/app-preview/inbox-list-item.tsx
@@ -0,0 +1,77 @@
+import { cn } from "@/lib/utils";
+import messages from "../../../../../i18n/en-US.json";
+import type { PreviewNotification } from "./mock-inbox";
+import { NotificationIcon } from "./notification-icon";
+import { formatRelativeTime } from "./relative-time";
+
+export function InboxListItem({
+ notification,
+ isSelected,
+ onSelect,
+}: {
+ notification: PreviewNotification;
+ isSelected: boolean;
+ onSelect: (notification: PreviewNotification) => void;
+}) {
+ return (
+ <li>
+ <button
+ type="button"
+ data-tour-target={
+ notification.id === "n-1" ? "inbox-notification" : undefined
+ }
+ aria-current={isSelected ? "true" : undefined}
+ onClick={() => onSelect(notification)}
+ className={cn(
+ "flex w-full cursor-pointer gap-2.5 rounded-lg px-3 py-2.5 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",
+ isSelected ? "bg-accent" : "hover:bg-accent/50",
+ )}
+ >
+ <NotificationIcon type={notification.type} />
+ <span className="flex min-w-0 flex-1 flex-col gap-0.5">
+ <span className="flex items-center gap-2">
+ <span
+ className={cn(
+ "min-w-0 flex-1 truncate text-[13px]",
+ notification.isRead
+ ? "text-foreground/80"
+ : "font-semibold text-foreground",
+ )}
+ >
+ {notification.title}
+ </span>
+ <time
+ dateTime={notification.createdAt}
+ className="shrink-0 text-xs text-muted-foreground"
+ >
+ {formatRelativeTime(notification.createdAt)}
+ </time>
+ {/* Always takes its slot so times line up across read and unread rows. */}
+ <span
+ className={cn(
+ "size-1.5 shrink-0 rounded-full",
+ !notification.isRead && "bg-info",
+ )}
+ >
+ {!notification.isRead && (
+ <span className="sr-only">
+ {messages.notifications.inbox.unread}
+ </span>
+ )}
+ </span>
+ </span>
+ <span
+ className={cn(
+ "truncate text-[13px]",
+ notification.isRead
+ ? "text-muted-foreground/80"
+ : "text-muted-foreground",
+ )}
+ >
+ {notification.content}
+ </span>
+ </span>
+ </button>
+ </li>
+ );
+}
diff --git a/apps/site/components/landing/app-preview/inbox-view.tsx b/apps/site/components/landing/app-preview/inbox-view.tsx
new file mode 100644
index 000000000..fbcf1ed4d
--- /dev/null
+++ b/apps/site/components/landing/app-preview/inbox-view.tsx
@@ -0,0 +1,190 @@
+import { isSameDay } from "date-fns";
+import { CheckCheck, Inbox, Trash2 } from "lucide-react";
+import { useState } from "react";
+import { Button } from "@/components/ui/button";
+import { cn } from "@/lib/utils";
+import messages from "../../../../../i18n/en-US.json";
+import type { AssignedTask } from "./assigned-tasks";
+import { InboxDetail } from "./inbox-detail";
+import { InboxListItem } from "./inbox-list-item";
+import type { PreviewNotification } from "./mock-inbox";
+import { PreviewPageHeader } from "./page-header";
+
+type InboxFilter = "all" | "unread" | "mentions";
+
+const copy = messages.notifications.inbox;
+
+// apps/web's Inbox: the notification list beside the opened notification.
+export function InboxView({
+ notifications,
+ onNotificationsChange,
+ tasks,
+ onOpenTask,
+}: {
+ notifications: PreviewNotification[];
+ onNotificationsChange: (notifications: PreviewNotification[]) => void;
+ tasks: Map<string, AssignedTask>;
+ onOpenTask: (task: AssignedTask) => void;
+}) {
+ const [filter, setFilter] = useState<InboxFilter>("all");
+ const [selectedId, setSelectedId] = useState<string>();
+ const selected = notifications.find(
+ (notification) => notification.id === selectedId,
+ );
+ const unreadCount = notifications.filter(
+ (notification) => !notification.isRead,
+ ).length;
+
+ const visible = notifications.filter((notification) =>
+ filter === "unread"
+ ? !notification.isRead
+ : filter === "mentions"
+ ? notification.type === "task_mention"
+ : true,
+ );
+ const now = new Date();
+ const groups = [
+ {
+ id: "today",
+ title: copy.today,
+ items: visible.filter((item) => isSameDay(new Date(item.createdAt), now)),
+ },
+ {
+ id: "earlier",
+ title: copy.earlier,
+ items: visible.filter(
+ (item) => !isSameDay(new Date(item.createdAt), now),
+ ),
+ },
+ ].filter((group) => group.items.length > 0);
+
+ const filters: Array<{ value: InboxFilter; label: string; count?: number }> =
+ [
+ { value: "all", label: copy.filters.all },
+ { value: "unread", label: copy.filters.unread, count: unreadCount },
+ { value: "mentions", label: copy.filters.mentions },
+ ];
+
+ const select = (notification: PreviewNotification) => {
+ setSelectedId(notification.id);
+ if (!notification.isRead) {
+ onNotificationsChange(
+ notifications.map((item) =>
+ item.id === notification.id ? { ...item, isRead: true } : item,
+ ),
+ );
+ }
+ };
+
+ return (
+ <>
+ <PreviewPageHeader title={copy.pageTitle} />
+ <div className="flex min-h-0 flex-1">
+ <div className="flex w-[26rem] shrink-0 flex-col border-r border-border/60">
+ <div className="flex h-12 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3">
+ <fieldset className="inline-flex items-center gap-0.5 rounded-lg bg-muted/70 p-0.5">
+ <legend className="sr-only">{copy.filters.label}</legend>
+ {filters.map((option) => (
+ <button
+ key={option.value}
+ type="button"
+ aria-pressed={filter === option.value}
+ onClick={() => setFilter(option.value)}
+ className={cn(
+ "flex h-6.5 cursor-pointer items-center gap-1.5 rounded-md px-2.5 text-[13px] font-medium outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",
+ filter === option.value
+ ? "bg-background text-foreground shadow-xs"
+ : "text-muted-foreground hover:text-foreground",
+ )}
+ >
+ {option.label}
+ {option.count ? (
+ <span className="text-xs font-normal tabular-nums text-muted-foreground">
+ {option.count}
+ </span>
+ ) : null}
+ </button>
+ ))}
+ </fieldset>
+ <div className="flex items-center gap-0.5">
+ <Button
+ variant="ghost"
+ size="xs"
+ disabled={unreadCount === 0}
+ onClick={() =>
+ onNotificationsChange(
+ notifications.map((item) => ({ ...item, isRead: true })),
+ )
+ }
+ className="text-muted-foreground"
+ >
+ <CheckCheck />
+ {messages.common.actions.markAllRead}
+ </Button>
+ <Button
+ variant="ghost"
+ size="icon-xs"
+ disabled={notifications.length === 0}
+ onClick={() => onNotificationsChange([])}
+ className="text-muted-foreground"
+ title={messages.notifications.clearAll}
+ >
+ <Trash2 />
+ <span className="sr-only">
+ {messages.notifications.clearAll}
+ </span>
+ </Button>
+ </div>
+ </div>
+
+ <div className="min-h-0 flex-1 overflow-y-auto pb-3">
+ {groups.length === 0 ? (
+ <div className="flex flex-col items-center gap-1 px-6 py-16 text-center">
+ <Inbox className="mb-1 size-5 text-muted-foreground/50" />
+ <p className="text-sm text-muted-foreground">
+ {notifications.length === 0
+ ? messages.notifications.emptyTitle
+ : copy.emptyFilter}
+ </p>
+ </div>
+ ) : (
+ groups.map((group) => (
+ <section key={group.id}>
+ <h2 className="px-5 pt-3.5 pb-1.5 text-xs font-medium text-muted-foreground">
+ {group.title}
+ </h2>
+ <ul className="flex flex-col gap-0.5 px-2">
+ {group.items.map((notification) => (
+ <InboxListItem
+ key={notification.id}
+ notification={notification}
+ isSelected={notification.id === selected?.id}
+ onSelect={select}
+ />
+ ))}
+ </ul>
+ </section>
+ ))
+ )}
+ </div>
+ </div>
+ <div className="min-w-0 flex-1">
+ {selected ? (
+ <InboxDetail
+ notification={selected}
+ task={tasks.get(selected.taskId)}
+ onOpenTask={onOpenTask}
+ />
+ ) : (
+ <div className="flex h-full flex-col items-center justify-center gap-2 text-center">
+ <Inbox className="size-5 text-muted-foreground/50" />
+ <p className="text-sm text-muted-foreground">
+ {copy.selectPrompt}
+ </p>
+ </div>
+ )}
+ </div>
+ </div>
+ </>
+ );
+}
diff --git a/apps/site/components/landing/app-preview/index.tsx b/apps/site/components/landing/app-preview/index.tsx
index b00ffe446..e7344e9c0 100644
--- a/apps/site/components/landing/app-preview/index.tsx
+++ b/apps/site/components/landing/app-preview/index.tsx
@@ -14,10 +14,8 @@ import {
import {
CalendarDays,
CalendarRange,
- ChevronDown,
ChevronLeft,
ChevronRight,
- MoreHorizontal,
SearchIcon,
SquareKanban,
SquircleDashed,
@@ -33,57 +31,42 @@ import {
} from "react";
import BoardToolbar from "@/components/project-board-toolbar";
import { PrivateListView } from "@/components/project-private-list-view";
-import { Avatar, AvatarFallback } from "@/components/ui/avatar";
import { Button } from "@/components/ui/button";
-import {
- Collapsible,
- CollapsiblePanel,
- CollapsibleTrigger,
-} from "@/components/ui/collapsible";
import { Input } from "@/components/ui/input";
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuGroup,
- DropdownMenuItem,
- DropdownMenuLabel,
- DropdownMenuSeparator,
- DropdownMenuTrigger,
-} from "@/components/ui/menu";
-import {
- Sidebar,
- SidebarContent,
- SidebarFooter,
- SidebarGroup,
- SidebarGroupContent,
- SidebarGroupLabel,
- SidebarHeader,
- SidebarInset,
- SidebarMenu,
- SidebarMenuButton,
- SidebarMenuItem,
- SidebarProvider,
-} from "@/components/ui/sidebar";
+import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar";
import { useTaskFilters } from "@/hooks/use-task-filters";
import { cn } from "@/lib/utils";
import type Task from "@/types/task";
import messages from "../../../../../i18n/en-US.json";
-import { version } from "../../../../../package.json";
+import { getAssignedTasks, indexTasks } from "./assigned-tasks";
import { PreviewBoard } from "./board-view";
import { PreviewCalendar } from "./calendar-view";
+import { HomeView } from "./home-view";
+import { InboxView } from "./inbox-view";
import {
+ CURRENT_USER,
MOCK_PROJECTS,
MOCK_TASK_DETAILS,
MOCK_USERS,
MOCK_WORKSPACE,
MOCK_WORKSPACE_LABELS,
} from "./mock-data";
+import { MOCK_NOTIFICATIONS } from "./mock-inbox";
+import { MyTasksView } from "./my-tasks-view";
+import { type PreviewPage, PreviewSidebar } from "./sidebar";
import { PreviewTaskDetailsPanel } from "./task-details";
const PREVIEW_W = 1400;
const PREVIEW_H = 860;
-export type PreviewMode = "board" | "list" | "calendar" | "gantt";
+export type PreviewView = "board" | "list" | "calendar" | "gantt";
+export type PreviewMode = PreviewView | PreviewPage;
+
+const PAGES: readonly PreviewMode[] = ["home", "inbox", "my-tasks"];
+
+function isPage(mode: PreviewMode): mode is PreviewPage {
+ return PAGES.includes(mode);
+}
type ScheduledTask = Task & {
scheduleStart: Date;
@@ -418,184 +401,6 @@ function MockGanttView({
);
}
-// ─────────────────────────────────────────────────────────────────────────────
-// MockSidebar: visually identical to app-sidebar.tsx, driven by mock data
-// ─────────────────────────────────────────────────────────────────────────────
-function MockSidebar({
- activeProjectId,
- onProjectSelect,
-}: {
- activeProjectId: string;
- onProjectSelect: (id: string) => void;
-}) {
- return (
- <Sidebar
- collapsible="offcanvas"
- variant="inset"
- className="border-none pt-1.5"
- >
- {/* Header: WorkspaceSwitcher */}
- <SidebarHeader className="pt-1 pb-1.5">
- <div className="flex items-center justify-between w-full gap-2">
- <SidebarMenu>
- <SidebarMenuItem>
- <DropdownMenu>
- <DropdownMenuTrigger
- render={
- <SidebarMenuButton
- className="group h-8 w-full rounded-md px-2 text-sidebar-foreground data-[active=true]:bg-sidebar-accent/50"
- size="default"
- />
- }
- >
- <div className="flex items-center min-w-0 w-full">
- <span className="truncate text-sm font-medium text-sidebar-foreground">
- {MOCK_WORKSPACE.name}
- </span>
- </div>
- <ChevronDown className="ml-1 size-3.5 text-sidebar-foreground/72 opacity-90 transition-all duration-200 ease-out group-hover:opacity-100" />
- </DropdownMenuTrigger>
- <DropdownMenuContent
- className="min-w-40 text-sidebar-foreground"
- align="start"
- side="bottom"
- sideOffset={4}
- >
- <DropdownMenuGroup>
- <DropdownMenuLabel>Workspaces</DropdownMenuLabel>
- <DropdownMenuItem className="h-7 text-sm data-highlighted:bg-sidebar-accent">
- {MOCK_WORKSPACE.name}
- </DropdownMenuItem>
- </DropdownMenuGroup>
- <DropdownMenuSeparator />
- <DropdownMenuGroup>
- <DropdownMenuItem className="h-7 text-sm data-highlighted:bg-sidebar-accent">
- Add workspace
- </DropdownMenuItem>
- </DropdownMenuGroup>
- </DropdownMenuContent>
- </DropdownMenu>
- </SidebarMenuItem>
- </SidebarMenu>
- <div className="h-7 w-7 shrink-0 flex items-center justify-center">
- <Avatar className="h-6 w-6">
- <AvatarFallback className="text-[10px] font-medium">
- AC
- </AvatarFallback>
- </Avatar>
- </div>
- </div>
- </SidebarHeader>
-
- <SidebarContent className="overflow-hidden gap-1 py-1">
- {/* Search (visual only) */}
- <SidebarGroup className="pb-1">
- <button
- type="button"
- className="inline-flex h-8 w-full cursor-pointer rounded-md border border-input bg-background px-2 py-1.5 text-foreground text-sm shadow-xs outline-none transition-[color,box-shadow]"
- >
- <span className="flex grow items-center">
- <SearchIcon
- aria-hidden="true"
- className="-ms-1 me-3 text-muted-foreground/80"
- size={16}
- />
- <span className="font-normal text-muted-foreground/70">
- Search
- </span>
- </span>
- <kbd className="-me-0.5 ms-6 inline-flex h-4 max-h-full items-center rounded border border-border/70 bg-background px-1 font-[inherit] font-medium text-[0.625rem] text-muted-foreground/60">
- ⌘K
- </kbd>
- </button>
- </SidebarGroup>
-
- {/* NavMain: Overview */}
- <Collapsible defaultOpen>
- <SidebarGroup className="gap-1 p-2">
- <CollapsibleTrigger
- nativeButton={false}
- className="data-panel-open:[&_svg]:rotate-90"
- render={
- <SidebarGroupLabel className="h-7 cursor-pointer justify-between px-0 text-sidebar-accent-foreground" />
- }
- >
- <span>Overview</span>
- <ChevronRight className="h-3.5 w-3.5 text-sidebar-foreground/60 transition-transform duration-200" />
- </CollapsibleTrigger>
- <CollapsiblePanel>
- <SidebarGroupContent>
- <SidebarMenu className="gap-0.5">
- {["Projects", "Members", "Invitations"].map((title) => (
- <SidebarMenuItem key={title}>
- <SidebarMenuButton
- size="default"
- className="h-8 ps-3.5 text-sm hover:bg-transparent hover:text-sidebar-accent-foreground active:bg-transparent cursor-default"
- >
- <span>{title}</span>
- </SidebarMenuButton>
- </SidebarMenuItem>
- ))}
- </SidebarMenu>
- </SidebarGroupContent>
- </CollapsiblePanel>
- </SidebarGroup>
- </Collapsible>
-
- {/* NavProjects: Projects */}
- <Collapsible defaultOpen>
- <SidebarGroup className="gap-1 p-2 pt-1">
- <CollapsibleTrigger
- nativeButton={false}
- className="data-panel-open:[&_svg]:rotate-90"
- render={
- <SidebarGroupLabel className="h-7 cursor-pointer justify-between px-0 text-sidebar-accent-foreground" />
- }
- >
- <span>Projects</span>
- <ChevronRight className="h-3.5 w-3.5 text-sidebar-foreground/60 transition-transform duration-200" />
- </CollapsibleTrigger>
- <CollapsiblePanel>
- <SidebarGroupContent>
- <SidebarMenu className="gap-0">
- {MOCK_PROJECTS.map((project) => (
- <SidebarMenuItem key={project.id}>
- <SidebarMenuButton
- data-tour-target={
- project.id === MOCK_PROJECTS[0].id
- ? "project-main"
- : "project-other"
- }
- isActive={project.id === activeProjectId}
- size="default"
- className="group/proj h-8 text-sm"
- onClick={() => onProjectSelect(project.id)}
- >
- <span className="truncate">{project.name}</span>
-
- <span className="ml-1 h-5 w-5 flex items-center justify-center opacity-0 group-hover/proj:opacity-100 rounded-sm">
- <MoreHorizontal className="h-3.5 w-3.5" />
- </span>
- </SidebarMenuButton>
- </SidebarMenuItem>
- ))}
- </SidebarMenu>
- </SidebarGroupContent>
- </CollapsiblePanel>
- </SidebarGroup>
- </Collapsible>
- </SidebarContent>
-
- {/* Footer: version only */}
- <SidebarFooter>
- <div className="flex items-center justify-center px-2 py-1.5">
- <span className="text-xs text-muted-foreground">v{version}</span>
- </div>
- </SidebarFooter>
- </Sidebar>
- );
-}
-
// ─────────────────────────────────────────────────────────────────────────────
// AppPreview
// ─────────────────────────────────────────────────────────────────────────────
@@ -648,8 +453,13 @@ export function AppPreview({
[onModeChange],
);
const viewMode = mode ?? selectedViewMode;
+ const page = isPage(viewMode) ? viewMode : null;
+ // The project view to return to after visiting a workspace page.
+ const lastView = useRef<PreviewView>("board");
+ const view = isPage(viewMode) ? lastView.current : viewMode;
const previousView = useRef(viewMode);
useEffect(() => {
+ if (!isPage(viewMode)) lastView.current = viewMode;
if (previousView.current !== viewMode) {
setSelectedTaskId(null);
previousView.current = viewMode;
@@ -665,27 +475,38 @@ export function AppPreview({
}),
[],
);
- const activeProject = useMemo(() => {
- const project =
- MOCK_PROJECTS.find((p) => p.id === activeProjectId) ?? MOCK_PROJECTS[0];
- const tasks = project.columns
- .flatMap((column) => column.tasks)
- .map((task) => ({
- ...task,
- status: taskStatuses[task.id] ?? task.status,
- }));
- return {
- ...project,
- columns: project.columns.map((column) => ({
- ...column,
- tasks: tasks.filter((task) => task.status === column.id),
- })),
- };
- }, [activeProjectId, taskStatuses]);
+ const projects = useMemo(
+ () =>
+ MOCK_PROJECTS.map((project) => {
+ const tasks = project.columns
+ .flatMap((column) => column.tasks)
+ .map((task) => ({
+ ...task,
+ status: taskStatuses[task.id] ?? task.status,
+ }));
+ return {
+ ...project,
+ columns: project.columns.map((column) => ({
+ ...column,
+ tasks: tasks.filter((task) => task.status === column.id),
+ })),
+ };
+ }),
+ [taskStatuses],
+ );
+ const activeProject =
+ projects.find((project) => project.id === activeProjectId) ?? projects[0];
+ const tasks = useMemo(() => indexTasks(projects), [projects]);
+ const assignedTasks = useMemo(
+ () => getAssignedTasks(projects, CURRENT_USER.id),
+ [projects],
+ );
+ const [notifications, setNotifications] = useState(MOCK_NOTIFICATIONS);
+ const unreadCount = notifications.filter(
+ (notification) => !notification.isRead,
+ ).length;
- const selectedTask = activeProject.columns
- .flatMap((column) => column.tasks)
- .find((task) => task.id === selectedTaskId);
+ const selectedTask = selectedTaskId ? tasks.get(selectedTaskId) : undefined;
const {
filters,
@@ -696,10 +517,14 @@ export function AppPreview({
hasActiveFilters,
} = useTaskFilters(activeProject, activeProjectId);
- const handleProjectSelect = useCallback((id: string) => {
- setSelectedTaskId(null);
- setActiveProjectId(id);
- }, []);
+ const handleProjectSelect = useCallback(
+ (id: string) => {
+ setSelectedTaskId(null);
+ setActiveProjectId(id);
+ if (page) setViewMode(lastView.current);
+ },
+ [page, setViewMode],
+ );
const setBoardToolbarMode = useCallback(
(mode: "board" | "list") => {
@@ -746,144 +571,169 @@ export function AppPreview({
<SidebarProvider
defaultOpen
style={
- { "--sidebar-width": "14rem", minHeight: 0 } as React.CSSProperties
+ { "--sidebar-width": "15rem", minHeight: 0 } as React.CSSProperties
}
className="h-full"
>
- <MockSidebar
+ <PreviewSidebar
+ projects={projects}
+ activePage={page}
activeProjectId={activeProjectId}
+ unreadCount={unreadCount}
+ assignedCount={assignedTasks.length}
+ onPageSelect={setViewMode}
onProjectSelect={handleProjectSelect}
/>
<SidebarInset className="m-2 flex flex-1 flex-col overflow-hidden rounded-xl border border-border/80 bg-background shadow-sm/5">
- {/* ── Project header (matches project-layout.tsx) ───────────── */}
- <header className="h-11 flex shrink-0 items-center gap-2 border-b border-border/80 bg-card px-2">
- <div className="flex w-full items-center justify-between gap-2">
- <div className="flex min-w-0 items-center gap-2">
- {/* Breadcrumb */}
- <div className="flex min-w-0 items-center gap-1">
- <span className="text-sm text-muted-foreground truncate">
- {MOCK_WORKSPACE.name}
- </span>
- <span className="text-muted-foreground/70 text-xs">/</span>
- <span className="text-sm font-medium truncate">
- {activeProject.name}
- </span>
- </div>
+ {page === "home" ? (
+ <HomeView
+ projects={projects}
+ assignedTasks={assignedTasks}
+ tasks={tasks}
+ onTaskClick={openTask}
+ onProjectSelect={handleProjectSelect}
+ onViewAllTasks={() => setViewMode("my-tasks")}
+ />
+ ) : page === "inbox" ? (
+ <InboxView
+ notifications={notifications}
+ onNotificationsChange={setNotifications}
+ tasks={tasks}
+ onOpenTask={openTask}
+ />
+ ) : page === "my-tasks" ? (
+ <MyTasksView tasks={assignedTasks} onTaskClick={openTask} />
+ ) : (
+ <>
+ {/* ── Project header (matches project-layout.tsx) ───────────── */}
+ <header className="h-11 flex shrink-0 items-center gap-2 border-b border-border/80 bg-card px-2">
+ <div className="flex w-full items-center justify-between gap-2">
+ <div className="flex min-w-0 items-center gap-2">
+ {/* Breadcrumb */}
+ <div className="flex min-w-0 items-center gap-1">
+ <span className="text-sm text-muted-foreground truncate">
+ {MOCK_WORKSPACE.name}
+ </span>
+ <span className="text-muted-foreground/70 text-xs">
+ /
+ </span>
+ <span className="text-sm font-medium truncate">
+ {activeProject.name}
+ </span>
+ </div>
- {/* View switcher */}
- <div className="h-8 items-center gap-0.5 rounded-lg border border-border/80 bg-background p-0.5 inline-flex">
- <Button
- variant={viewMode === "list" ? "secondary" : "ghost"}
- size="xs"
- data-tour-target="list"
- onClick={() => setViewMode("list")}
- className={cn(
- "h-6 gap-1.5 rounded-md px-2 text-xs",
- viewMode !== "list" && "text-muted-foreground",
- )}
- >
- <SquircleDashed className="size-3.5" />
- Backlog
- </Button>
- <Button
- variant={viewMode === "board" ? "secondary" : "ghost"}
- size="xs"
- data-tour-target="board"
- onClick={() => setViewMode("board")}
- className={cn(
- "h-6 gap-1.5 rounded-md px-2 text-xs",
- viewMode !== "board" && "text-muted-foreground",
- )}
- >
- <SquareKanban className="size-3.5" />
- Board
- </Button>
- <Button
- variant={viewMode === "calendar" ? "secondary" : "ghost"}
- size="xs"
- data-tour-target="calendar"
- onClick={() => setViewMode("calendar")}
- className={cn(
- "h-6 gap-1.5 rounded-md px-2 text-xs",
- viewMode !== "calendar" && "text-muted-foreground",
- )}
- >
- <CalendarRange className="size-3.5" />
- {messages.tasks.calendar.title}
- </Button>
- <Button
- variant={viewMode === "gantt" ? "secondary" : "ghost"}
- size="xs"
- data-tour-target="gantt"
- onClick={() => setViewMode("gantt")}
- className={cn(
- "h-6 gap-1.5 rounded-md px-2 text-xs",
- viewMode !== "gantt" && "text-muted-foreground",
- )}
- >
- <CalendarDays className="size-3.5" />
- Gantt
- </Button>
+ {/* View switcher */}
+ <div className="h-8 items-center gap-0.5 rounded-lg border border-border/80 bg-background p-0.5 inline-flex">
+ <Button
+ variant={view === "list" ? "secondary" : "ghost"}
+ size="xs"
+ data-tour-target="list"
+ onClick={() => setViewMode("list")}
+ className={cn(
+ "h-6 gap-1.5 rounded-md px-2 text-xs",
+ view !== "list" && "text-muted-foreground",
+ )}
+ >
+ <SquircleDashed className="size-3.5" />
+ Backlog
+ </Button>
+ <Button
+ variant={view === "board" ? "secondary" : "ghost"}
+ size="xs"
+ data-tour-target="board"
+ onClick={() => setViewMode("board")}
+ className={cn(
+ "h-6 gap-1.5 rounded-md px-2 text-xs",
+ view !== "board" && "text-muted-foreground",
+ )}
+ >
+ <SquareKanban className="size-3.5" />
+ Board
+ </Button>
+ <Button
+ variant={view === "calendar" ? "secondary" : "ghost"}
+ size="xs"
+ data-tour-target="calendar"
+ onClick={() => setViewMode("calendar")}
+ className={cn(
+ "h-6 gap-1.5 rounded-md px-2 text-xs",
+ view !== "calendar" && "text-muted-foreground",
+ )}
+ >
+ <CalendarRange className="size-3.5" />
+ {messages.tasks.calendar.title}
+ </Button>
+ <Button
+ variant={view === "gantt" ? "secondary" : "ghost"}
+ size="xs"
+ data-tour-target="gantt"
+ onClick={() => setViewMode("gantt")}
+ className={cn(
+ "h-6 gap-1.5 rounded-md px-2 text-xs",
+ view !== "gantt" && "text-muted-foreground",
+ )}
+ >
+ <CalendarDays className="size-3.5" />
+ Gantt
+ </Button>
+ </div>
+ </div>
</div>
+ </header>
+
+ {/* ── Board Toolbar ─────────────────────────────────────────── */}
+ {view === "board" || view === "list" ? (
+ <BoardToolbar
+ project={activeProject}
+ filters={filters}
+ updateFilter={updateFilter}
+ updateLabelFilter={updateLabelFilter}
+ clearFilters={clearFilters}
+ hasActiveFilters={hasActiveFilters}
+ users={MOCK_USERS}
+ workspaceLabels={MOCK_WORKSPACE_LABELS}
+ viewMode={view}
+ setViewMode={setBoardToolbarMode}
+ />
+ ) : null}
+
+ {/* ── View content ─────────────────────────────────────────── */}
+ <div className="relative flex-1 overflow-hidden flex flex-col min-h-0 bg-linear-to-b from-muted/20 to-background">
+ {view === "calendar" ? (
+ <PreviewCalendar
+ project={activeProject}
+ onTaskClick={openTask}
+ />
+ ) : view === "gantt" ? (
+ <MockGanttView
+ key={activeProject.id}
+ project={activeProject}
+ onTaskClick={openTask}
+ />
+ ) : view === "board" ? (
+ <PreviewBoard
+ details={taskDetails}
+ project={filteredProject ?? activeProject}
+ onTaskClick={openTask}
+ />
+ ) : (
+ <PrivateListView
+ project={filteredProject ?? activeProject}
+ onTaskClick={openTask}
+ />
+ )}
</div>
- </div>
- </header>
-
- {/* ── Board Toolbar ─────────────────────────────────────────── */}
- {viewMode === "board" || viewMode === "list" ? (
- <BoardToolbar
- project={activeProject}
- filters={filters}
- updateFilter={updateFilter}
- updateLabelFilter={updateLabelFilter}
- clearFilters={clearFilters}
- hasActiveFilters={hasActiveFilters}
- users={MOCK_USERS}
- workspaceLabels={MOCK_WORKSPACE_LABELS}
- viewMode={viewMode}
- setViewMode={setBoardToolbarMode}
- />
- ) : null}
-
- {/* ── View content ─────────────────────────────────────────── */}
- <div className="relative flex-1 overflow-hidden flex flex-col min-h-0 bg-linear-to-b from-muted/20 to-background">
- {viewMode === "calendar" ? (
- <PreviewCalendar
- project={activeProject}
- onTaskClick={openTask}
- />
- ) : viewMode === "gantt" ? (
- <MockGanttView
- key={activeProject.id}
- project={activeProject}
- onTaskClick={openTask}
- />
- ) : viewMode === "board" ? (
- <PreviewBoard
- details={taskDetails}
- project={filteredProject ?? activeProject}
- onTaskClick={openTask}
- />
- ) : (
- <PrivateListView
- project={filteredProject ?? activeProject}
- onTaskClick={openTask}
- />
- )}
- </div>
+ </>
+ )}
</SidebarInset>
</SidebarProvider>
{selectedTask && (
<PreviewTaskDetailsPanel
key={selectedTask.id}
task={selectedTask}
- projectSlug={activeProject.slug}
- statusName={
- activeProject.columns.find(
- (column) => column.id === selectedTask.status,
- )?.name ?? selectedTask.status
- }
+ projectSlug={selectedTask.projectSlug}
+ statusName={selectedTask.statusName}
details={taskDetails[selectedTask.id]}
onChange={(details) =>
setTaskDetails((current) => ({
diff --git a/apps/site/components/landing/app-preview/label-color.ts b/apps/site/components/landing/app-preview/label-color.ts
new file mode 100644
index 000000000..8db7449b5
--- /dev/null
+++ b/apps/site/components/landing/app-preview/label-color.ts
@@ -0,0 +1,9 @@
+import labelColors from "@/constants/label-colors";
+
+export function resolveLabelColor(value: string) {
+ return (
+ labelColors.find((color) => color.value === value)?.color ||
+ value ||
+ "var(--color-neutral-400)"
+ );
+}
diff --git a/apps/site/components/landing/app-preview/mock-activity.ts b/apps/site/components/landing/app-preview/mock-activity.ts
new file mode 100644
index 000000000..d092847c4
--- /dev/null
+++ b/apps/site/components/landing/app-preview/mock-activity.ts
@@ -0,0 +1,59 @@
+import messages from "../../../../../i18n/en-US.json";
+import { fillMessage } from "./fill-message";
+
+export type PreviewActivity = {
+ id: string;
+ actorName: string;
+ // What the actor did, phrased to follow their name.
+ action: string;
+ comment?: string;
+ taskId: string;
+ createdAt: string;
+};
+
+const minutesAgo = (minutes: number) =>
+ new Date(Date.now() - minutes * 60_000).toISOString();
+
+export const MOCK_ACTIVITY: PreviewActivity[] = [
+ {
+ id: "a-1",
+ actorName: "Dwight Schrute",
+ action: messages.workspace.home.activity.commented,
+ comment:
+ "Beet research is a legitimate business expense. @Jim the receipts are in your drawer.",
+ taskId: "t-105",
+ createdAt: minutesAgo(12),
+ },
+ {
+ id: "a-2",
+ actorName: "Michael Scott",
+ action: messages.workspace.home.activity.commented,
+ comment: "Needs more menace. Way more menace.",
+ taskId: "t-203",
+ createdAt: minutesAgo(48),
+ },
+ {
+ id: "a-3",
+ actorName: "Pam Beesly",
+ action: fillMessage(messages.activity.changedStatus, {
+ from: "To Do",
+ to: "In Progress",
+ }),
+ taskId: "t-201",
+ createdAt: minutesAgo(130),
+ },
+ {
+ id: "a-4",
+ actorName: "Michael Scott",
+ action: fillMessage(messages.activity.assignedTo, { name: "Jim Halpert" }),
+ taskId: "t-108",
+ createdAt: minutesAgo(60 * 5),
+ },
+ {
+ id: "a-5",
+ actorName: "Dwight Schrute",
+ action: messages.activity.created,
+ taskId: "t-104",
+ createdAt: minutesAgo(60 * 27),
+ },
+];
diff --git a/apps/site/components/landing/app-preview/mock-data.ts b/apps/site/components/landing/app-preview/mock-data.ts
index edbf62469..927b13ab5 100644
--- a/apps/site/components/landing/app-preview/mock-data.ts
+++ b/apps/site/components/landing/app-preview/mock-data.ts
@@ -41,6 +41,9 @@ export const MOCK_USERS = {
],
};
+// The person signed in to the preview: Home, Inbox and My tasks are theirs.
+export const CURRENT_USER = { id: "u-3", name: "Jim Halpert" };
+
// ------------------------------------------------------------------
// Helper timestamps / dates
// ------------------------------------------------------------------
@@ -140,6 +143,26 @@ const scrTasks: TaskWithExtras[] = [
assigneeImage: null,
labels: [],
},
+ {
+ id: "t-108",
+ number: 8,
+ title: "Put Dwight's stapler in Jell-O",
+ description:
+ "Third time this quarter. Use the lime flavor so he can still identify it.",
+ priority: "low",
+ status: "to-do",
+ position: 3,
+ startDate: d(-4),
+ dueDate: d(-2),
+ userId: "u-3",
+ projectId: SCR_ID,
+ workspaceId: WS_ID,
+ createdAt: CREATED_AT,
+ updatedAt: UPDATED_AT,
+ assigneeName: "Jim Halpert",
+ assigneeImage: null,
+ labels: [],
+ },
{
id: "t-105",
number: 5,
@@ -207,7 +230,7 @@ export const WEB_PROJECT: ProjectWithTasks = {
name: "Scranton Branch",
slug: "SCR",
description: "Day-to-day operations of the Scranton office.",
- icon: null,
+ icon: "Building2",
workspaceId: WS_ID,
isPublic: false,
createdAt: CREATED_AT,
@@ -362,7 +385,7 @@ export const MOB_PROJECT: ProjectWithTasks = {
name: "Threat Level Midnight",
slug: "TLM",
description: "Michael Scott's magnum opus. In production since 1996.",
- icon: null,
+ icon: "Video",
workspaceId: WS_ID,
isPublic: false,
createdAt: CREATED_AT,
diff --git a/apps/site/components/landing/app-preview/mock-inbox.ts b/apps/site/components/landing/app-preview/mock-inbox.ts
new file mode 100644
index 000000000..2a61ac9fd
--- /dev/null
+++ b/apps/site/components/landing/app-preview/mock-inbox.ts
@@ -0,0 +1,101 @@
+import messages from "../../../../../i18n/en-US.json";
+import { fillMessage } from "./fill-message";
+
+export type PreviewNotification = {
+ id: string;
+ type: string;
+ isRead: boolean;
+ createdAt: string;
+ taskId: string;
+ title: string;
+ content: string;
+};
+
+const events = messages.notifications.events;
+
+const minutesAgo = (minutes: number) =>
+ new Date(Date.now() - minutes * 60_000).toISOString();
+
+// Jim's notifications, written with the app's own notification copy.
+export const MOCK_NOTIFICATIONS: PreviewNotification[] = [
+ {
+ id: "n-1",
+ type: "task_mention",
+ isRead: false,
+ createdAt: minutesAgo(12),
+ taskId: "t-105",
+ title: fillMessage(events.task_mention.title, {
+ mentionerName: "Dwight Schrute",
+ }),
+ content: fillMessage(events.task_mention.content, {
+ mentionerName: "Dwight Schrute",
+ taskTitle: "Review Dwight's beet farm expense report",
+ }),
+ },
+ {
+ id: "n-2",
+ type: "task_comment",
+ isRead: false,
+ createdAt: minutesAgo(48),
+ taskId: "t-203",
+ title: fillMessage(events.task_comment.title, {
+ commenterName: "Michael Scott",
+ }),
+ content: fillMessage(events.task_comment.content, {
+ taskTitle: "Review Golden Face's villain monologue",
+ commentPreview: "Needs more menace. Way more menace.",
+ }),
+ },
+ {
+ id: "n-3",
+ type: "task_overdue",
+ isRead: false,
+ createdAt: minutesAgo(95),
+ taskId: "t-108",
+ title: events.task_overdue.title,
+ content: fillMessage(events.task_overdue.content, {
+ taskTitle: "Put Dwight's stapler in Jell-O",
+ }),
+ },
+ {
+ id: "n-4",
+ type: "task_assignee_changed",
+ isRead: true,
+ createdAt: minutesAgo(60 * 26),
+ taskId: "t-102",
+ title: events.task_assignee_changed.title,
+ content: fillMessage(events.task_assignee_changed.content, {
+ taskTitle: "Negotiate new paper contract with Prince Family Paper",
+ }),
+ },
+ {
+ id: "n-5",
+ type: "due_date_reminder",
+ isRead: true,
+ createdAt: minutesAgo(60 * 30),
+ taskId: "t-203",
+ title: events.due_date_reminder.title,
+ content: fillMessage(events.due_date_reminder.content, {
+ taskTitle: "Review Golden Face's villain monologue",
+ leadTime: fillMessage(
+ messages.notifications.reminderLeadTime.days_other,
+ {
+ count: 2,
+ },
+ ),
+ }),
+ },
+ {
+ id: "n-6",
+ type: "task_status_changed",
+ isRead: true,
+ createdAt: minutesAgo(60 * 50),
+ taskId: "t-105",
+ title: events.task_status_changed.title,
+ content: fillMessage(events.task_status_changed.content, {
+ taskTitle: "Review Dwight's beet farm expense report",
+ oldStatus: "In Progress",
+ newStatus: "In Review",
+ }),
+ },
+];
diff --git a/apps/site/components/landing/app-preview/my-tasks-view.tsx b/apps/site/components/landing/app-preview/my-tasks-view.tsx
new file mode 100644
index 000000000..fbe678a9d
--- /dev/null
+++ b/apps/site/components/landing/app-preview/my-tasks-view.tsx
@@ -0,0 +1,87 @@
+import { useState } from "react";
+import { Button } from "@/components/ui/button";
+import { cn } from "@/lib/utils";
+import messages from "../../../../../i18n/en-US.json";
+import { AssignedTaskRow } from "./assigned-task-row";
+import type { AssignedTask } from "./assigned-tasks";
+import { groupByDueDate, groupByProject } from "./group-assigned-tasks";
+import { PreviewPageHeader } from "./page-header";
+
+type GroupBy = "dueDate" | "project";
+
+const copy = messages.workspace;
+
+// apps/web's My tasks: everything assigned to you, grouped.
+export function MyTasksView({
+ tasks,
+ onTaskClick,
+}: {
+ tasks: AssignedTask[];
+ onTaskClick: (task: AssignedTask) => void;
+}) {
+ const [groupBy, setGroupBy] = useState<GroupBy>("dueDate");
+ const groups =
+ groupBy === "project" ? groupByProject(tasks) : groupByDueDate(tasks);
+ const options: Array<{ value: GroupBy; label: string }> = [
+ { value: "dueDate", label: copy.myTasks.groupBy.dueDate },
+ { value: "project", label: copy.myTasks.groupBy.project },
+ ];
+
+ return (
+ <>
+ <PreviewPageHeader
+ title={copy.myTasks.pageTitle}
+ actions={
+ <fieldset className="inline-flex items-center gap-0.5">
+ <legend className="sr-only">{copy.myTasks.groupBy.label}</legend>
+ {options.map((option) => (
+ <Button
+ key={option.value}
+ variant={groupBy === option.value ? "secondary" : "ghost"}
+ size="xs"
+ aria-pressed={groupBy === option.value}
+ onClick={() => setGroupBy(option.value)}
+ className={cn(
+ groupBy !== option.value && "text-muted-foreground",
+ )}
+ >
+ {option.label}
+ </Button>
+ ))}
+ </fieldset>
+ }
+ />
+ <div className="min-h-0 flex-1 overflow-y-auto">
+ {groups.map((group) => (
+ <section key={group.id}>
+ <h2 className="flex h-9 items-center gap-2 border-b border-border/50 bg-muted/40 px-5 text-[13px]">
+ <span
+ className={cn(
+ "font-semibold",
+ group.bucket === "overdue"
+ ? "text-destructive-foreground"
+ : "text-foreground",
+ )}
+ >
+ {group.bucket ? copy.myWork.due[group.bucket] : group.title}
+ </span>
+ <span className="text-xs font-normal tabular-nums text-muted-foreground">
+ {group.tasks.length}
+ </span>
+ </h2>
+ <div className="flex flex-col px-4">
+ {group.tasks.map((task) => (
+ <AssignedTaskRow
+ key={task.id}
+ task={task}
+ showLabels
+ onTaskClick={onTaskClick}
+ />
+ ))}
+ </div>
+ </section>
+ ))}
+ </div>
+ </>
+ );
+}
diff --git a/apps/site/components/landing/app-preview/notification-icon.tsx b/apps/site/components/landing/app-preview/notification-icon.tsx
new file mode 100644
index 000000000..1155ab396
--- /dev/null
+++ b/apps/site/components/landing/app-preview/notification-icon.tsx
@@ -0,0 +1,37 @@
+import {
+ AtSign,
+ Bell,
+ CalendarClock,
+ CalendarX,
+ History,
+ type LucideIcon,
+ MessageSquare,
+ UserRound,
+} from "lucide-react";
+import { cn } from "@/lib/utils";
+
+const icons: Record<string, LucideIcon> = {
+ task_mention: AtSign,
+ task_comment: MessageSquare,
+ task_assignee_changed: UserRound,
+ task_status_changed: History,
+ due_date_reminder: CalendarClock,
+ task_overdue: CalendarX,
+};
+
+export function NotificationIcon({ type }: { type: string }) {
+ const Icon = icons[type] ?? Bell;
+
+ return (
+ <span
+ className={cn(
+ "flex size-7 shrink-0 items-center justify-center rounded-full",
+ type === "task_overdue"
+ ? "bg-destructive/10 text-destructive-foreground"
+ : "bg-muted text-muted-foreground",
+ )}
+ >
+ <Icon aria-hidden="true" className="size-3.5" />
+ </span>
+ );
+}
diff --git a/apps/site/components/landing/app-preview/page-header.tsx b/apps/site/components/landing/app-preview/page-header.tsx
new file mode 100644
index 000000000..b89b5652e
--- /dev/null
+++ b/apps/site/components/landing/app-preview/page-header.tsx
@@ -0,0 +1,45 @@
+import { PanelLeftIcon } from "lucide-react";
+import type { ReactNode } from "react";
+import {
+ Breadcrumb,
+ BreadcrumbItem,
+ BreadcrumbList,
+ BreadcrumbSeparator,
+} from "@/components/ui/breadcrumb";
+import { MOCK_WORKSPACE } from "./mock-data";
+
+// The header of apps/web's workspace-layout: workspace / page, then actions.
+export function PreviewPageHeader({
+ title,
+ actions,
+}: {
+ title: string;
+ actions?: ReactNode;
+}) {
+ return (
+ <header className="flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border bg-card p-2">
+ <div className="flex w-full items-center gap-1">
+ <span className="-ml-1 flex size-6 items-center justify-center text-foreground">
+ <PanelLeftIcon aria-hidden="true" className="size-4" />
+ </span>
+ <div className="mx-1.5 h-4 w-px shrink-0 bg-border/80" />
+ <Breadcrumb className="flex w-full items-center gap-1 text-xs">
+ <BreadcrumbList>
+ <BreadcrumbItem>
+ <span className="text-xs font-normal text-card-foreground">
+ {MOCK_WORKSPACE.name}
+ </span>
+ </BreadcrumbItem>
+ <BreadcrumbSeparator />
+ <BreadcrumbItem>
+ <span className="text-xs font-normal text-card-foreground">
+ {title}
+ </span>
+ </BreadcrumbItem>
+ </BreadcrumbList>
+ </Breadcrumb>
+ </div>
+ {actions && <div className="flex items-center gap-1.5">{actions}</div>}
+ </header>
+ );
+}
diff --git a/apps/site/components/landing/app-preview/project-icon.ts b/apps/site/components/landing/app-preview/project-icon.ts
new file mode 100644
index 000000000..8ddeba186
--- /dev/null
+++ b/apps/site/components/landing/app-preview/project-icon.ts
@@ -0,0 +1,8 @@
+import { Building2, Layout, type LucideIcon, Video } from "lucide-react";
+
+// The few entries of apps/web's project-icons the mock projects use.
+const icons: Record<string, LucideIcon> = { Building2, Video };
+
+export function getProjectIcon(icon: string | null): LucideIcon {
+ return (icon && icons[icon]) || Layout;
+}
diff --git a/apps/site/components/landing/app-preview/project-progress.tsx b/apps/site/components/landing/app-preview/project-progress.tsx
new file mode 100644
index 000000000..11b21c3e4
--- /dev/null
+++ b/apps/site/components/landing/app-preview/project-progress.tsx
@@ -0,0 +1,42 @@
+import { cn } from "@/lib/utils";
+
+const RADIUS = 2.25;
+const CIRCUMFERENCE = 2 * Math.PI * RADIUS;
+
+// Same wedge as apps/web's project-progress.
+export function ProjectProgress({
+ percentage,
+ className,
+}: {
+ percentage: number;
+ className?: string;
+}) {
+ const clamped = Math.min(100, Math.max(0, percentage));
+
+ return (
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 14 14"
+ className={cn("size-3.5 shrink-0", className)}
+ >
+ <circle
+ cx="7"
+ cy="7"
+ r="6"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="1.5"
+ />
+ <circle
+ cx="7"
+ cy="7"
+ r={RADIUS}
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={RADIUS * 2}
+ strokeDasharray={`${(clamped / 100) * CIRCUMFERENCE} ${CIRCUMFERENCE}`}
+ transform="rotate(-90 7 7)"
+ />
+ </svg>
+ );
+}
diff --git a/apps/site/components/landing/app-preview/relative-time.ts b/apps/site/components/landing/app-preview/relative-time.ts
new file mode 100644
index 000000000..45624a2cc
--- /dev/null
+++ b/apps/site/components/landing/app-preview/relative-time.ts
@@ -0,0 +1,22 @@
+const UNITS: Array<[Intl.RelativeTimeFormatUnit, number]> = [
+ ["year", 60 * 60 * 24 * 365],
+ ["month", 60 * 60 * 24 * 30],
+ ["week", 60 * 60 * 24 * 7],
+ ["day", 60 * 60 * 24],
+ ["hour", 60 * 60],
+ ["minute", 60],
+ ["second", 1],
+];
+
+const formatter = new Intl.RelativeTimeFormat("en-US", { numeric: "auto" });
+
+// Same output as apps/web's formatRelativeTime: "12 minutes ago", "yesterday".
+export function formatRelativeTime(value: string, now = new Date()) {
+ const diffSeconds = Math.round(
+ (new Date(value).getTime() - now.getTime()) / 1000,
+ );
+ const [unit, unitSeconds] =
+ UNITS.find(([, seconds]) => Math.abs(diffSeconds) >= seconds) ??
+ UNITS[UNITS.length - 1];
+ return formatter.format(Math.round(diffSeconds / unitSeconds), unit);
+}
diff --git a/apps/site/components/landing/app-preview/section-header.tsx b/apps/site/components/landing/app-preview/section-header.tsx
new file mode 100644
index 000000000..8f5fbce57
--- /dev/null
+++ b/apps/site/components/landing/app-preview/section-header.tsx
@@ -0,0 +1,25 @@
+import type { ReactNode } from "react";
+
+export function SectionHeader({
+ title,
+ detail,
+ action,
+}: {
+ title: string;
+ detail?: ReactNode;
+ action?: ReactNode;
+}) {
+ return (
+ <div className="flex items-center justify-between gap-3 border-b border-border pb-2.5">
+ <div className="flex min-w-0 items-baseline gap-2">
+ <h2 className="text-[15px] font-semibold text-foreground">{title}</h2>
+ {detail && (
+ <span className="truncate text-[13px] text-muted-foreground">
+ {detail}
+ </span>
+ )}
+ </div>
+ {action}
+ </div>
+ );
+}
diff --git a/apps/site/components/landing/app-preview/sidebar.tsx b/apps/site/components/landing/app-preview/sidebar.tsx
new file mode 100644
index 000000000..3b7104937
--- /dev/null
+++ b/apps/site/components/landing/app-preview/sidebar.tsx
@@ -0,0 +1,293 @@
+import {
+ ChevronDown,
+ ChevronRight,
+ CircleCheck,
+ House,
+ Inbox,
+ type LucideIcon,
+ MoreHorizontal,
+ Plus,
+ SearchIcon,
+ Settings,
+ UserPlus,
+ Users,
+} from "lucide-react";
+import { Avatar, AvatarFallback } from "@/components/ui/avatar";
+import {
+ Collapsible,
+ CollapsiblePanel,
+ CollapsibleTrigger,
+} from "@/components/ui/collapsible";
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuGroup,
+ DropdownMenuItem,
+ DropdownMenuLabel,
+ DropdownMenuSeparator,
+ DropdownMenuTrigger,
+} from "@/components/ui/menu";
+import {
+ Sidebar,
+ SidebarContent,
+ SidebarFooter,
+ SidebarGroup,
+ SidebarGroupContent,
+ SidebarGroupLabel,
+ SidebarHeader,
+ SidebarMenu,
+ SidebarMenuButton,
+ SidebarMenuItem,
+} from "@/components/ui/sidebar";
+import { cn } from "@/lib/utils";
+import type { ProjectWithTasks } from "@/types/project";
+import messages from "../../../../../i18n/en-US.json";
+import { version } from "../../../../../package.json";
+import { getCompletionPercentage } from "./assigned-tasks";
+import { CURRENT_USER, MOCK_WORKSPACE } from "./mock-data";
+import { getProjectIcon } from "./project-icon";
+import { ProjectProgress } from "./project-progress";
+
+export type PreviewPage = "home" | "inbox" | "my-tasks";
+
+type NavItem = {
+ page?: PreviewPage;
+ title: string;
+ icon: LucideIcon;
+ count?: number;
+ emphasizeCount?: boolean;
+};
+
+const sidebarCopy = messages.navigation.sidebar;
+const initials = CURRENT_USER.name
+ .split(" ")
+ .map((name) => name[0])
+ .join("");
+
+// Visually identical to apps/web's app-sidebar, driven by mock data.
+export function PreviewSidebar({
+ projects,
+ activePage,
+ activeProjectId,
+ unreadCount,
+ assignedCount,
+ onPageSelect,
+ onProjectSelect,
+}: {
+ projects: ProjectWithTasks[];
+ activePage: PreviewPage | null;
+ activeProjectId: string;
+ unreadCount: number;
+ assignedCount: number;
+ onPageSelect: (page: PreviewPage) => void;
+ onProjectSelect: (id: string) => void;
+}) {
+ const navItems: NavItem[] = [
+ { page: "home", title: sidebarCopy.home, icon: House },
+ {
+ page: "inbox",
+ title: sidebarCopy.inbox,
+ icon: Inbox,
+ count: unreadCount,
+ emphasizeCount: true,
+ },
+ {
+ page: "my-tasks",
+ title: sidebarCopy.myTasks,
+ icon: CircleCheck,
+ count: assignedCount,
+ },
+ { title: sidebarCopy.members, icon: Users },
+ ];
+
+ return (
+ <Sidebar
+ collapsible="offcanvas"
+ variant="inset"
+ className="border-none pt-1.5"
+ >
+ <SidebarHeader className="pt-1 pb-1.5">
+ <div className="flex w-full items-center justify-between gap-2">
+ <SidebarMenu>
+ <SidebarMenuItem>
+ <DropdownMenu>
+ <DropdownMenuTrigger
+ render={
+ <SidebarMenuButton
+ className="group h-8 w-full rounded-md px-2 text-sidebar-foreground data-[active=true]:bg-sidebar-accent/50"
+ size="default"
+ />
+ }
+ >
+ <div className="flex w-full min-w-0 items-center">
+ <span className="truncate text-sm font-medium text-foreground">
+ {MOCK_WORKSPACE.name}
+ </span>
+ </div>
+ <ChevronDown className="ml-1 size-3.5 text-foreground/70 opacity-90 transition-[rotate,opacity] duration-200 ease-out group-hover:opacity-100" />
+ </DropdownMenuTrigger>
+ <DropdownMenuContent
+ className="min-w-40 text-sidebar-foreground"
+ align="start"
+ side="bottom"
+ sideOffset={4}
+ >
+ <DropdownMenuGroup>
+ <DropdownMenuLabel>
+ {messages.navigation.workspaceSwitcher.workspaces}
+ </DropdownMenuLabel>
+ <DropdownMenuItem className="h-7 text-sm data-highlighted:bg-sidebar-accent">
+ {MOCK_WORKSPACE.name}
+ </DropdownMenuItem>
+ </DropdownMenuGroup>
+ <DropdownMenuSeparator />
+ <DropdownMenuGroup>
+ <DropdownMenuItem className="h-7 text-sm data-highlighted:bg-sidebar-accent">
+ {messages.navigation.workspaceSwitcher.addWorkspace}
+ </DropdownMenuItem>
+ </DropdownMenuGroup>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </SidebarMenuItem>
+ </SidebarMenu>
+ <div className="flex items-center gap-0.5">
+ <span className="flex size-8 shrink-0 items-center justify-center text-muted-foreground">
+ <SearchIcon aria-hidden="true" className="size-4" />
+ </span>
+ <Avatar className="size-8 shrink-0">
+ <AvatarFallback className="border border-border/30 text-xs font-medium">
+ {initials}
+ </AvatarFallback>
+ </Avatar>
+ </div>
+ </div>
+ </SidebarHeader>
+
+ <SidebarContent className="gap-1 overflow-hidden py-1">
+ <SidebarGroup className="gap-1 p-2">
+ <SidebarGroupContent>
+ <SidebarMenu className="gap-0.5">
+ {navItems.map((item) => (
+ <SidebarMenuItem key={item.title}>
+ <SidebarMenuButton
+ data-tour-target={item.page}
+ isActive={
+ item.page !== undefined && item.page === activePage
+ }
+ size="default"
+ className={cn(
+ "h-8 text-sm",
+ !item.page &&
+ "cursor-default hover:bg-transparent active:bg-transparent",
+ )}
+ onClick={() => item.page && onPageSelect(item.page)}
+ >
+ <item.icon aria-hidden="true" />
+ <span>{item.title}</span>
+ {item.count ? (
+ <span
+ className={cn(
+ "ml-auto flex h-4.5 min-w-4.5 shrink-0 items-center justify-center rounded-full px-1 text-[11px] tabular-nums",
+ item.emphasizeCount
+ ? "bg-foreground font-semibold text-background"
+ : "font-medium text-muted-foreground",
+ )}
+ >
+ {item.count}
+ </span>
+ ) : null}
+ </SidebarMenuButton>
+ </SidebarMenuItem>
+ ))}
+ </SidebarMenu>
+ </SidebarGroupContent>
+ </SidebarGroup>
+
+ <Collapsible defaultOpen>
+ <SidebarGroup className="gap-1 p-2 pt-1">
+ <CollapsibleTrigger
+ nativeButton={false}
+ className="data-panel-open:[&_svg]:rotate-90"
+ render={
+ <SidebarGroupLabel className="h-7 cursor-pointer justify-start gap-1 px-0 text-sidebar-accent-foreground" />
+ }
+ >
+ <span>{sidebarCopy.projects}</span>
+ <ChevronRight className="h-3.5 w-3.5 text-sidebar-foreground/60 transition-transform duration-200" />
+ </CollapsibleTrigger>
+ <span
+ aria-hidden="true"
+ className="absolute top-2 right-2 flex aspect-square w-5 items-center justify-center text-sidebar-foreground/70 [&>svg]:size-4"
+ >
+ <Plus />
+ </span>
+ <CollapsiblePanel>
+ <SidebarGroupContent>
+ <SidebarMenu className="gap-0.5">
+ {projects.map((project) => {
+ const ProjectIcon = getProjectIcon(project.icon);
+ return (
+ <SidebarMenuItem key={project.id}>
+ <SidebarMenuButton
+ data-tour-target={
+ project.id === projects[0]?.id
+ ? "project-main"
+ : "project-other"
+ }
+ isActive={
+ activePage === null &&
+ project.id === activeProjectId
+ }
+ size="default"
+ className="h-8 text-sm"
+ onClick={() => onProjectSelect(project.id)}
+ >
+ <ProjectIcon aria-hidden="true" />
+ <span className="min-w-0 flex-1 truncate">
+ {project.name}
+ </span>
+ <ProjectProgress
+ percentage={getCompletionPercentage(project)}
+ className="text-muted-foreground group-hover/menu-item:opacity-0"
+ />
+ </SidebarMenuButton>
+ <span
+ aria-hidden="true"
+ className="pointer-events-none absolute top-1.5 right-1 flex size-5 items-center justify-center opacity-0 group-hover/menu-item:opacity-100"
+ >
+ <MoreHorizontal className="size-4" />
+ </span>
+ </SidebarMenuItem>
+ );
+ })}
+ </SidebarMenu>
+ </SidebarGroupContent>
+ </CollapsiblePanel>
+ </SidebarGroup>
+ </Collapsible>
+ </SidebarContent>
+
+ <SidebarFooter>
+ <SidebarMenu className="gap-0.5">
+ {[
+ { title: sidebarCopy.invitePeople, icon: UserPlus },
+ { title: messages.navigation.userMenu.settings, icon: Settings },
+ ].map((item) => (
+ <SidebarMenuItem key={item.title}>
+ <SidebarMenuButton
+ size="default"
+ className="h-8 cursor-default text-sm hover:bg-transparent active:bg-transparent"
+ >
+ <item.icon aria-hidden="true" />
+ <span>{item.title}</span>
+ </SidebarMenuButton>
+ </SidebarMenuItem>
+ ))}
+ </SidebarMenu>
+ <div className="flex items-center justify-center px-2 py-1.5">
+ <span className="text-xs text-muted-foreground">v{version}</span>
+ </div>
+ </SidebarFooter>
+ </Sidebar>
+ );
+}
diff --git a/apps/site/components/landing/app-preview/task-card.tsx b/apps/site/components/landing/app-preview/task-card.tsx
index 425fd34fd..77afeefa0 100644
--- a/apps/site/components/landing/app-preview/task-card.tsx
+++ b/apps/site/components/landing/app-preview/task-card.tsx
@@ -1,12 +1,32 @@
import { format } from "date-fns";
-import { Calendar, SlidersHorizontal, SquareCheck } from "lucide-react";
-import { PublicTaskLabels } from "@/components/project-task-labels";
+import {
+ Calendar,
+ CalendarClock,
+ CalendarX,
+ SlidersHorizontal,
+ SquareCheck,
+} from "lucide-react";
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
-import { dueDateStatusColors, getDueDateStatus } from "@/lib/due-date-status";
+import { type DueDateStatus, getDueDateStatus } from "@/lib/due-date-status";
import { getPriorityIcon } from "@/lib/priority";
import { cn } from "@/lib/utils";
import messages from "../../../../../i18n/en-US.json";
import type { PreviewTaskDetails, TaskWithExtras } from "./mock-data";
+import { PreviewTaskLabels } from "./task-labels";
+
+const dueDateTextColors: Record<DueDateStatus, string> = {
+ overdue: "text-destructive-foreground",
+ "due-soon": "text-warning-foreground",
+ "far-future": "text-muted-foreground",
+ "no-due-date": "text-muted-foreground",
+};
+
+const dueDateIcons: Record<DueDateStatus, typeof Calendar> = {
+ overdue: CalendarX,
+ "due-soon": CalendarClock,
+ "far-future": Calendar,
+ "no-due-date": Calendar,
+};
// Same card hierarchy and metadata as apps/web's kanban-board/task-card.
export function PreviewTaskCard({
@@ -25,79 +45,115 @@ export function PreviewTaskCard({
const completed =
details?.checklist.filter((item) => item.completed).length ?? 0;
const fields = details?.fields.filter((field) => field.value !== "") ?? [];
+ const dueDateStatus = getDueDateStatus(task.dueDate, isCompleted);
+ const isOverdue = dueDateStatus === "overdue";
+ const hasPriority = Boolean(task.priority) && task.priority !== "no-priority";
+ const DueDateIcon = dueDateIcons[dueDateStatus];
+
return (
<button
type="button"
data-task-id={task.id}
onClick={() => onTaskClick(task)}
- className="group relative w-full rounded-lg border border-border bg-background p-3 text-left shadow-xs/5 transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ className={cn(
+ "group relative w-full rounded-lg border p-3 text-left transition-[background-color,border-color,box-shadow] duration-150 ease-out hover:bg-background hover:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
+ // Finished work steps back so open cards draw the eye.
+ isCompleted ? "bg-background/60" : "bg-background shadow-xs/5",
+ isOverdue
+ ? "border-destructive/70 ring-[3px] ring-destructive/10"
+ : "border-border hover:border-border/90",
+ )}
>
- <div className="mb-2 flex items-center justify-between gap-2">
- <span className="text-xs font-medium text-muted-foreground">
- {projectSlug}-{task.number}
- </span>
- <Avatar
- className="h-5 w-5"
- title={
- task.assigneeName ??
- messages.common.modals.createTask.assignUnassigned
- }
- >
- <AvatarFallback className="border border-border/30 text-[10px] font-medium">
- {task.assigneeName
- ?.split(" ")
- .map((name) => name[0])
- .join("") ?? "?"}
- </AvatarFallback>
- </Avatar>
+ <div className="mb-2 text-[11px] font-medium text-muted-foreground/90">
+ {projectSlug}-{task.number}
</div>
- <div className="mb-2.5 line-clamp-3 break-words pr-6 text-[15px] font-medium leading-5 text-foreground/95">
- {task.title}
+ <div className="absolute top-3 right-3">
+ {task.assigneeName ? (
+ <Avatar className="h-5 w-5" title={task.assigneeName}>
+ <AvatarFallback className="border border-border/30 text-[10px] font-medium">
+ {task.assigneeName
+ .split(" ")
+ .map((name) => name[0])
+ .join("")}
+ </AvatarFallback>
+ </Avatar>
+ ) : (
+ <div
+ className="flex h-5 w-5 items-center justify-center rounded-full border border-border bg-muted"
+ title={messages.tasks.assignee.unassigned}
+ >
+ <span className="text-[10px] font-medium text-muted-foreground">
+ ?
+ </span>
+ </div>
+ )}
+ </div>
+ <div className={cn("pr-6", !isCompleted && "mb-2.5")}>
+ <div
+ className={cn(
+ "line-clamp-3 break-words text-[15px] font-medium leading-5",
+ isCompleted ? "text-muted-foreground" : "text-foreground/95",
+ )}
+ >
+ {task.title}
+ </div>
</div>
- {!!task.labels?.length && (
+ {!isCompleted && !!task.labels?.length && (
<div className="mb-2.5">
- <PublicTaskLabels labels={task.labels} />
+ <PreviewTaskLabels labels={task.labels} />
+ </div>
+ )}
+ {!isCompleted && (
+ <div className="flex flex-wrap items-center gap-x-2.5 gap-y-1.5 empty:hidden">
+ {hasPriority && (
+ <span
+ className="inline-flex h-5.5 items-center"
+ title={
+ messages.tasks.priority[
+ task.priority as keyof typeof messages.tasks.priority
+ ]
+ }
+ >
+ {getPriorityIcon(task.priority ?? "")}
+ </span>
+ )}
+ {fields.length > 0 && (
+ <span
+ title={fields
+ .map((field) => `${field.name}: ${field.value}`)
+ .join(" · ")}
+ className="inline-flex items-center gap-1 rounded border border-border/70 bg-muted/55 px-2 py-1 text-[10px] font-medium text-muted-foreground"
+ >
+ <SlidersHorizontal className="size-3" />
+ {fields.length}
+ </span>
+ )}
+ {!!details?.checklist.length && (
+ <span
+ className={cn(
+ "inline-flex h-5.5 items-center gap-1 rounded border border-border/70 bg-muted/50 px-2 py-1 text-[10px] font-medium tabular-nums text-muted-foreground",
+ completed === details.checklist.length &&
+ "border-success/20 bg-success/10 text-success-foreground",
+ )}
+ >
+ <SquareCheck className="size-3" />
+ {completed}/{details.checklist.length}
+ </span>
+ )}
+ {task.dueDate && (
+ <span
+ className={cn(
+ "flex h-5.5 items-center gap-1 text-[10px]",
+ isOverdue && "font-medium",
+ dueDateTextColors[dueDateStatus],
+ )}
+ >
+ <DueDateIcon className="size-3" />
+ {format(new Date(task.dueDate), "MMM d")}
+ </span>
+ )}
</div>
)}
- <div className="flex flex-wrap items-center gap-1.5">
- <span className="inline-flex h-5.5 items-center rounded border border-border/70 bg-muted/55 px-2 py-1 text-[10px] text-muted-foreground">
- {getPriorityIcon(task.priority ?? "")}
- </span>
- {fields.length > 0 && (
- <span
- title={fields
- .map((field) => `${field.name}: ${field.value}`)
- .join(" · ")}
- className="inline-flex items-center gap-1 rounded border border-border/70 bg-muted/55 px-2 py-1 text-[10px] text-muted-foreground"
- >
- <SlidersHorizontal className="size-3" />
- {fields.length}
- </span>
- )}
- {!!details?.checklist.length && (
- <span
- className={cn(
- "flex h-5.5 items-center gap-1 rounded bg-muted/50 px-2 py-1 text-[10px] text-muted-foreground",
- completed === details.checklist.length &&
- "bg-success/10 text-success-foreground",
- )}
- >
- <SquareCheck className="size-3" />
- {completed}/{details.checklist.length}
- </span>
- )}
- {task.dueDate && (
- <span
- className={cn(
- "flex h-5.5 items-center gap-1 rounded px-2 py-1 text-[10px]",
- dueDateStatusColors[getDueDateStatus(task.dueDate, isCompleted)],
- )}
- >
- <Calendar className="size-3" />
- {format(new Date(task.dueDate), "MMM d")}
- </span>
- )}
- </div>
</button>
);
}
diff --git a/apps/site/components/landing/app-preview/task-labels.tsx b/apps/site/components/landing/app-preview/task-labels.tsx
new file mode 100644
index 000000000..412eda90d
--- /dev/null
+++ b/apps/site/components/landing/app-preview/task-labels.tsx
@@ -0,0 +1,32 @@
+import { resolveLabelColor } from "./label-color";
+
+// Same dot-and-name labels as apps/web's kanban-board/task-labels.
+export function PreviewTaskLabels({
+ labels,
+}: {
+ labels: Array<{ id: string; name: string; color: string }>;
+}) {
+ if (!labels.length) return null;
+
+ const sortedLabels = [...labels].sort((a, b) => a.name.localeCompare(b.name));
+
+ return (
+ <div className="flex min-w-0 flex-wrap gap-x-2.5 gap-y-1">
+ {sortedLabels.map((label) => (
+ <span
+ key={label.id}
+ className="flex max-w-full min-w-0 items-center gap-1.5 text-[10px] font-medium text-foreground/85"
+ >
+ <span
+ aria-hidden="true"
+ className="inline-block size-1.5 shrink-0 rounded-full"
+ style={{ backgroundColor: resolveLabelColor(label.color) }}
+ />
+ <span className="min-w-0 truncate" title={label.name}>
+ {label.name}
+ </span>
+ </span>
+ ))}
+ </div>
+ );
+}
diff --git a/apps/site/components/landing/app-preview/week-strip.tsx b/apps/site/components/landing/app-preview/week-strip.tsx
new file mode 100644
index 000000000..f72c15bee
--- /dev/null
+++ b/apps/site/components/landing/app-preview/week-strip.tsx
@@ -0,0 +1,105 @@
+import { format } from "date-fns";
+import { useMemo } from "react";
+import { cn } from "@/lib/utils";
+import messages from "../../../../../i18n/en-US.json";
+import type { AssignedTask } from "./assigned-tasks";
+import { buildWeek } from "./build-week";
+import { pluralMessage } from "./fill-message";
+
+const VISIBLE_TASKS_PER_DAY = 2;
+const copy = messages.workspace;
+
+export function WeekStrip({
+ tasks,
+ onTaskClick,
+}: {
+ tasks: AssignedTask[];
+ onTaskClick: (task: AssignedTask) => void;
+}) {
+ const week = useMemo(() => buildWeek(tasks), [tasks]);
+
+ return (
+ <div className="overflow-hidden rounded-xl border border-border bg-card">
+ <ol className="flex divide-x divide-border/70">
+ {week.map((day) => (
+ <li
+ key={day.date.toISOString()}
+ className={cn(
+ "flex min-h-28 min-w-0 flex-1 flex-col gap-2.5 px-3 py-3",
+ day.isToday && "bg-muted/50",
+ )}
+ >
+ <div className="flex items-center gap-1.5 text-xs">
+ {day.isToday ? (
+ <>
+ <span className="font-semibold text-foreground">
+ {copy.myWork.due.today}
+ </span>
+ {day.tasks.length > 0 && (
+ <span className="flex size-4.5 items-center justify-center rounded-full bg-foreground text-[11px] font-semibold tabular-nums text-background">
+ {day.tasks.length}
+ </span>
+ )}
+ </>
+ ) : (
+ <>
+ <span className="font-medium text-muted-foreground">
+ {format(day.date, "EEE")}
+ </span>
+ <span className="tabular-nums text-muted-foreground/80">
+ {format(day.date, "d")}
+ </span>
+ </>
+ )}
+ </div>
+
+ <div className="flex flex-col gap-1">
+ {day.tasks.slice(0, VISIBLE_TASKS_PER_DAY).map((task) => (
+ <button
+ key={task.id}
+ type="button"
+ onClick={() => onTaskClick(task)}
+ className={cn(
+ "flex flex-col gap-0.5 rounded-md px-2 py-1.5 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",
+ day.isPast
+ ? "bg-destructive/8 hover:bg-destructive/12"
+ : day.isToday
+ ? "border border-border bg-background hover:bg-accent/50"
+ : "bg-muted/70 hover:bg-muted",
+ )}
+ >
+ <span
+ className={cn(
+ "text-[11px] font-medium",
+ day.isPast
+ ? "text-destructive-foreground"
+ : "text-muted-foreground",
+ )}
+ >
+ {day.isPast
+ ? copy.myWork.due.overdue
+ : `${task.projectSlug}-${task.number}`}
+ </span>
+ <span className="truncate text-xs text-foreground">
+ {task.title}
+ </span>
+ </button>
+ ))}
+ {day.tasks.length > VISIBLE_TASKS_PER_DAY && (
+ <span className="px-2 text-[11px] font-medium text-muted-foreground">
+ {pluralMessage(
+ {
+ one: copy.home.week.more_one,
+ other: copy.home.week.more_other,
+ },
+ day.tasks.length - VISIBLE_TASKS_PER_DAY,
+ )}
+ </span>
+ )}
+ </div>
+ </li>
+ ))}
+ </ol>
+ </div>
+ );
+}
diff --git a/apps/site/components/landing/product-showcase.tsx b/apps/site/components/landing/product-showcase.tsx
index 87d5c5b86..bbc5ce880 100644
--- a/apps/site/components/landing/product-showcase.tsx
+++ b/apps/site/components/landing/product-showcase.tsx
@@ -43,6 +43,10 @@ const tourTargets = [
"gantt",
"board",
"drag-back",
+ "home",
+ "inbox",
+ "inbox-notification",
+ "my-tasks",
"project-other",
"project-main",
];