Implement tasks 25, 26 + completion visibility setting

Task 25: Multiple dashboards — dashboards table + migration, /d/[slug]
route, root redirect, dashboard tabs in nav with create/rename/delete/
set-default. Task 26: Editable dashboard — react-grid-layout drag/resize
editor, widget picker modal with per-widget configurator auto-generated
from default config, save/reset server actions with Zod validation.

Completion visibility: server-side per-user setting (hours) replaces
localStorage timer; queries filter completed items by updatedAt cutoff;
Settings page dropdown persists preference via server action.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ginnoir
2026-05-06 15:52:59 -05:00
co-authored by Claude Sonnet 4.6
parent 2ad9521ef9
commit d5a8bf9d95
27 changed files with 1646 additions and 237 deletions
+20 -1
View File
@@ -1,5 +1,6 @@
import type { AdapterAccountType } from "@auth/core/adapters";
import {
boolean,
index,
integer,
jsonb,
@@ -24,7 +25,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"),
completionVisibilityHours: integer("completion_visibility_hours").notNull().default(24),
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
});
@@ -129,6 +130,24 @@ export const shareLinks = pgTable(
],
);
export const dashboards = pgTable(
"dashboards",
{
id: uuid("id").primaryKey().defaultRandom(),
userId: uuid("user_id")
.notNull()
.references(() => users.id, { onDelete: "cascade" }),
name: text("name").notNull(),
slug: text("slug").notNull(),
isDefault: boolean("is_default").notNull().default(false),
position: integer("position").notNull().default(0),
layout: jsonb("layout").notNull().default({ version: 1, widgets: [] }),
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
},
(t) => [uniqueIndex("dashboards_user_slug_uq").on(t.userId, t.slug)],
);
export const reminders = pgTable(
"reminders",
{