Implement dashboard composition (task 20)
- Add default_dashboard_layout jsonb to users + migration 0007 - Create _core/manifest.tsx with core.activity placeholder widget - Register core manifest alongside calendar/lists/notes - Update all three module manifests with real async server-component widget renders (upcoming events, month view, list items, notes) - Add src/lib/dashboard.ts: computeDefaultLayout greedy packer + parseDashboardLayout Zod validator - Build src/app/page.tsx: 12-col CSS Grid, static smColSpan lookup, per-widget Suspense for parallel loading, generic widget.render() dispatch — no widgetId branches - Add tests/e2e/dashboard.spec.ts; all 4 E2E specs pass Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
d7069d14a2
commit
b4dde92757
@@ -0,0 +1,31 @@
|
||||
import type { ModuleManifest } from "./module";
|
||||
import { z } from "zod";
|
||||
|
||||
const coreManifest: ModuleManifest = {
|
||||
id: "_core",
|
||||
name: "Core",
|
||||
entities: [],
|
||||
dashboardWidgets: [
|
||||
{
|
||||
id: "core.activity",
|
||||
title: "Recent activity",
|
||||
description: "Latest changes across your household.",
|
||||
category: "Core",
|
||||
defaultSize: { w: 4, h: 3 },
|
||||
minSize: { w: 3, h: 2 },
|
||||
defaultPriority: 50,
|
||||
configSchema: z.object({
|
||||
limit: z.number().int().min(1).max(50).optional(),
|
||||
}),
|
||||
defaultConfig: { limit: 10 },
|
||||
resolveConfigOptions: async () => undefined,
|
||||
render: () => (
|
||||
<div className="flex h-full items-center justify-center text-sm text-muted-foreground">
|
||||
Activity log coming in task 22
|
||||
</div>
|
||||
),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default coreManifest;
|
||||
@@ -2,6 +2,7 @@ import type { AdapterAccountType } from "@auth/core/adapters";
|
||||
import {
|
||||
index,
|
||||
integer,
|
||||
jsonb,
|
||||
pgEnum,
|
||||
pgTable,
|
||||
primaryKey,
|
||||
@@ -23,6 +24,7 @@ export const users = pgTable("users", {
|
||||
image: text("image"),
|
||||
theme: text("theme").notNull().default("default"),
|
||||
themeMode: text("theme_mode").notNull().default("system"),
|
||||
defaultDashboardLayout: jsonb("default_dashboard_layout"),
|
||||
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user